You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by zh...@apache.org on 2022/03/19 14:07:31 UTC

[dolphinscheduler] branch dev updated: [python] Separate py from main dist and auto add gpg sign (#8999)

This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new fd5e79b  [python] Separate py from main dist and auto add gpg sign (#8999)
fd5e79b is described below

commit fd5e79bd803a287aa6f7074333029347bcceef1d
Author: Jiajie Zhong <zh...@hotmail.com>
AuthorDate: Sat Mar 19 22:07:24 2022 +0800

    [python] Separate py from main dist and auto add gpg sign (#8999)
    
    * Add new profile `python` to separate build python
      package from `release`. Now someone who does not interested
      in python api could build package without python environment
    * Add auto gpg asc sign when run `mvn instal -Ppython`
    * Add property to skip gpg sign `python.sign.skip`
    * Set `python.sign.skip=false` sign python dist by default
    
    Co-authored-by: kezhenxu94 <ke...@apache.org>
---
 dolphinscheduler-dist/pom.xml   | 17 +++++++++++++++++
 dolphinscheduler-python/pom.xml | 42 +++++++++++++++++++++++++++++++++++++----
 pom.xml                         |  2 ++
 3 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/dolphinscheduler-dist/pom.xml b/dolphinscheduler-dist/pom.xml
index 0a8eee1..3445574 100644
--- a/dolphinscheduler-dist/pom.xml
+++ b/dolphinscheduler-dist/pom.xml
@@ -70,6 +70,9 @@
     <profiles>
         <profile>
             <id>release</id>
+            <properties>
+                <python.sign.skip>false</python.sign.skip>
+            </properties>
             <build>
                 <plugins>
                     <plugin>
@@ -104,6 +107,20 @@
                                 </configuration>
                             </execution>
 
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>python</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <executions>
+
                             <execution>
                                 <id>python</id>
                                 <phase>package</phase>
diff --git a/dolphinscheduler-python/pom.xml b/dolphinscheduler-python/pom.xml
index 72d1852..00aaaf8 100644
--- a/dolphinscheduler-python/pom.xml
+++ b/dolphinscheduler-python/pom.xml
@@ -105,7 +105,7 @@
             </build>
         </profile>
         <profile>
-            <id>release</id>
+            <id>python</id>
             <build>
                 <plugins>
                     <plugin>
@@ -119,7 +119,7 @@
                                     <goal>exec</goal>
                                 </goals>
                                 <configuration>
-                                    <executable>python3</executable>
+                                    <executable>python</executable>
                                     <workingDirectory>${project.basedir}/pydolphinscheduler</workingDirectory>
                                     <arguments>
                                         <argument>-m</argument>
@@ -138,7 +138,7 @@
                                     <goal>exec</goal>
                                 </goals>
                                 <configuration>
-                                    <executable>python3</executable>
+                                    <executable>python</executable>
                                     <workingDirectory>${project.basedir}/pydolphinscheduler</workingDirectory>
                                     <arguments>
                                         <argument>setup.py</argument>
@@ -153,7 +153,7 @@
                                     <goal>exec</goal>
                                 </goals>
                                 <configuration>
-                                    <executable>python3</executable>
+                                    <executable>python</executable>
                                     <workingDirectory>${project.basedir}/pydolphinscheduler</workingDirectory>
                                     <arguments>
                                         <argument>-m</argument>
@@ -161,6 +161,40 @@
                                     </arguments>
                                 </configuration>
                             </execution>
+                            <execution>
+                                <id>sign-source</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+                                    <skip>${python.sign.skip}</skip>
+                                    <executable>bash</executable>
+                                    <workingDirectory>${project.basedir}/pydolphinscheduler</workingDirectory>
+                                    <arguments>
+                                        <argument>-c</argument>
+                                        <!-- We use `bash -c` here cause plugin exec-maven-plugin do not support wildcard-->
+                                        <argument>gpg --armor --sign dist/*.tar.gz</argument>
+                                    </arguments>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>sign-wheel</id>
+                                <phase>prepare-package</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+                                    <skip>${python.sign.skip}</skip>
+                                    <executable>bash</executable>
+                                    <workingDirectory>${project.basedir}/pydolphinscheduler</workingDirectory>
+                                    <arguments>
+                                        <argument>-c</argument>
+                                        <!-- We use `bash -c` here cause plugin exec-maven-plugin do not support wildcard-->
+                                        <argument>gpg --armor --sign dist/*.whl</argument>
+                                    </arguments>
+                                </configuration>
+                            </execution>
                         </executions>
                     </plugin>
                 </plugins>
diff --git a/pom.xml b/pom.xml
index d78fef9..f02898d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -138,6 +138,8 @@
         <docker.tag>${project.version}</docker.tag>
         <docker.build.skip>true</docker.build.skip>
         <docker.push.skip>true</docker.push.skip>
+
+        <python.sign.skip>true</python.sign.skip>
     </properties>
 
     <dependencyManagement>