You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2018/05/19 09:29:06 UTC

[46/50] tinkerpop git commit: TINKERPOP-1897 Avoid pushing of Docker images for SNAPSHOT versions

TINKERPOP-1897 Avoid pushing of Docker images for SNAPSHOT versions

This also adds the minor version as an additional tag for Docker images
when the version is not a SNAPSHOT version.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/02208a58
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/02208a58
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/02208a58

Branch: refs/heads/TINKERPOP-1897
Commit: 02208a587d87d498d53f6b7fb8e90506784f764c
Parents: 41a3472
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Wed Mar 14 22:41:55 2018 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Sat May 19 10:51:35 2018 +0200

----------------------------------------------------------------------
 gremlin-console/pom.xml | 61 +++++++++++++++++++++++++++++++++++++-------
 gremlin-server/pom.xml  | 53 ++++++++++++++++++++++++++++++++++----
 pom.xml                 |  5 ++++
 3 files changed, 105 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/02208a58/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index b7933fb..b24c772 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -347,23 +347,66 @@ limitations under the License.
             <build>
                 <plugins>
                     <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>build-helper-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <!-- source: https://stackoverflow.com/a/39139979/6753576 -->
+                                <!-- sets the only.when.is.snapshot.used property to true if SNAPSHOT was used, 
+                                    to the project version otherwise -->
+                                <id>build-helper-regex-is-snapshot-used</id>
+                                <phase>validate</phase>
+                                <goals>
+                                    <goal>regex-property</goal>
+                                </goals>
+                                <configuration>
+                                    <name>only.when.is.snapshot.used</name>
+                                    <value>${project.version}</value>
+                                    <regex>.*-SNAPSHOT</regex>
+                                    <replacement>true</replacement>
+                                    <failIfNoMatch>false</failIfNoMatch>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
                         <groupId>com.spotify</groupId>
                         <artifactId>dockerfile-maven-plugin</artifactId>
                         <executions>
                             <execution>
-                            <id>docker-image</id>
-                            <goals>
-                                <goal>build</goal>
-                                <goal>push</goal>
-                            </goals>
+                                <id>docker-image-build</id>
+                                <goals>
+                                    <goal>build</goal>
+                                </goals>
+                                <configuration>
+                                    <tag>${project.version}</tag>
+                                    <buildArgs>
+                                        <GREMLIN_CONSOLE_DIR>target/apache-tinkerpop-${project.artifactId}-${project.version}-standalone</GREMLIN_CONSOLE_DIR>
+                                    </buildArgs>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>docker-image-tag-minor-version</id>
+                                <goals>
+                                    <goal>tag</goal>
+                                </goals>
+                                <configuration>                                                     
+                                    <tag>3.2</tag>
+                                    <skip>${only.when.is.snapshot.used}</skip>                                                     
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>docker-image-push</id>
+                                <goals>
+                                    <goal>push</goal>
+                                </goals>
+                                <configuration>                                    
+                                    <skip>${only.when.is.snapshot.used}</skip>
+                                </configuration>                                
                             </execution>
                         </executions>
                         <configuration>
                             <repository>tinkerpop/gremlin-console</repository>
-                            <tag>${project.version}</tag>
-                            <buildArgs>
-                                <GREMLIN_CONSOLE_DIR>target/apache-tinkerpop-${project.artifactId}-${project.version}-standalone</GREMLIN_CONSOLE_DIR>
-                            </buildArgs>
                         </configuration>
                     </plugin>
                 </plugins>                

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/02208a58/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index dfc6570..e71f79b 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -255,23 +255,66 @@ limitations under the License.
             <build>
                 <plugins>
                     <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>build-helper-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <!-- source: https://stackoverflow.com/a/39139979/6753576 -->
+                                <!-- sets the only.when.is.snapshot.used property to true if SNAPSHOT was used, 
+                                    to the project version otherwise -->
+                                <id>build-helper-regex-is-snapshot-used</id>
+                                <phase>validate</phase>
+                                <goals>
+                                    <goal>regex-property</goal>
+                                </goals>
+                                <configuration>
+                                    <name>only.when.is.snapshot.used</name>
+                                    <value>${project.version}</value>
+                                    <regex>.*-SNAPSHOT</regex>
+                                    <replacement>true</replacement>
+                                    <failIfNoMatch>false</failIfNoMatch>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
                         <groupId>com.spotify</groupId>
                         <artifactId>dockerfile-maven-plugin</artifactId>
                         <executions>
                             <execution>
-                                <id>docker-image</id>
+                                <id>docker-image-build</id>
                                 <goals>
                                     <goal>build</goal>
+                                </goals>
+                                <configuration>
+                                    <tag>${project.version}</tag>
+                                    <buildArgs>
+                                        <GREMLIN_SERVER_DIR>target/apache-tinkerpop-${project.artifactId}-${project.version}-standalone</GREMLIN_SERVER_DIR>
+                                    </buildArgs>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>docker-image-tag-minor-version</id>
+                                <goals>
+                                    <goal>tag</goal>
+                                </goals>
+                                <configuration>                                                     
+                                    <tag>3.2</tag>
+                                    <skip>${only.when.is.snapshot.used}</skip>                                                     
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>docker-image-push</id>
+                                <goals>
                                     <goal>push</goal>
                                 </goals>
+                                <configuration>                                    
+                                    <skip>${only.when.is.snapshot.used}</skip>
+                                </configuration>                                
                             </execution>
                         </executions>
                         <configuration>
                             <repository>tinkerpop/gremlin-server</repository>
-                            <tag>${project.version}</tag>
-                            <buildArgs>
-                                <GREMLIN_SERVER_DIR>target/apache-tinkerpop-${project.artifactId}-${project.version}-standalone</GREMLIN_SERVER_DIR>
-                            </buildArgs>
                         </configuration>
                     </plugin>
                 </plugins>                

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/02208a58/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5251de3..19866f0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -502,6 +502,11 @@ limitations under the License.
                     <artifactId>dockerfile-maven-plugin</artifactId>
                     <version>1.3.7</version>
                 </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>build-helper-maven-plugin</artifactId>
+                    <version>3.0.0</version>
+                </plugin>
             </plugins>
         </pluginManagement>
     </build>