summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-12 18:58:32 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-13 10:18:32 +0800
commit64fcc24209acc0c1d8097e2d10bd9cdef9c2b37c (patch)
treebf8aecb238bfb2097189aa8a3fc132cb15b4ef1e
parent65b6a8067489e0ca77ae89d2f1f2e5e42b795257 (diff)
Change the Version of Dockers to "Staging"
Change-Id: I8488067c7fcb48236fc60328305c378d4c0e6245 Issue-ID: HOLMES-74 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
-rw-r--r--engine-d-standalone/pom.xml36
1 files changed, 35 insertions, 1 deletions
diff --git a/engine-d-standalone/pom.xml b/engine-d-standalone/pom.xml
index 58dcb79..e256f32 100644
--- a/engine-d-standalone/pom.xml
+++ b/engine-d-standalone/pom.xml
@@ -30,6 +30,12 @@
<name>holmes-engine/holmes-engine-d-standalone</name>
<packaging>pom</packaging>
+ <properties>
+ <holmes.engine.project.version>${project.version}</holmes.engine.project.version>
+ <maven.build.timestamp.format>yyMMdd-HHmmss</maven.build.timestamp.format>
+ <build.number>${maven.build.timestamp}</build.number>
+ </properties>
+
<build>
<plugins>
<plugin>
@@ -189,6 +195,32 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ println project.properties['holmes.engine.project.version'];
+ def versionArray;
+ if ( project.properties['holmes.engine.project.version'] != null ) {
+ versionArray = project.properties['holmes.engine.project.version'].split('\\.');
+ }
+
+ 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>
</plugins>
</build>
@@ -211,7 +243,9 @@
<dockerFileDir>${basedir}/target/version/</dockerFileDir>
<dockerFile>${basedir}/target/version/Dockerfile</dockerFile>
<tags>
- <tag>${project.version}-STAGING-latest</tag>
+ <tag>${project.version}</tag>
+ <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
+ <tag>${project.docker.latesttag.version}</tag>
</tags>
</build>
</image>