summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2021-02-11 13:03:24 +0000
committerwaqas.ikram <waqas.ikram@est.tech>2021-02-11 13:03:26 +0000
commitdd4dc39ac770da635fa2bed81f47c0a8c8a7d90e (patch)
tree4c9ea47079ebb938bdee20a1db61ee60fda114b4
parent886c4c67bcfb7a6b1eda33928d2e7b6ec98fbead (diff)
Adding docker image tag
Change-Id: I2fd6dbd8ee67a3a9ee5e85ec293e7ed8ccf38d70 Issue-ID: SO-3473 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
-rw-r--r--packages/docker/pom.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml
index 531ffb6..dc0eba6 100644
--- a/packages/docker/pom.xml
+++ b/packages/docker/pom.xml
@@ -22,6 +22,36 @@
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ println 'Project version: ' + project.properties['so.project.version'];
+ def versionArray;
+ if ( project.properties['so.project.version'] != null ) {
+ versionArray = project.properties['so.project.version'].split('-');
+ }
+
+ if ( project.properties['so.project.version'].endsWith("-SNAPSHOT") ) {
+ project.properties['project.docker.latesttag.version']=versionArray[0] + "-SNAPSHOT-latest";
+ } else {
+ project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest";
+ }
+
+ println 'New tag for docker: ' + project.properties['project.docker.latesttag.version'];
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration combine.self="override">
@@ -45,6 +75,7 @@
<tags>
<tag>${project.version}</tag>
<tag>${project.version}-${maven.build.timestamp}</tag>
+ <tag>${project.docker.latesttag.version}</tag>
</tags>
<assembly>
<inline>