diff options
author | Patrick Brady <pb071s@att.com> | 2017-04-27 23:58:13 -0700 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2017-04-27 23:58:20 -0700 |
commit | c9dca11d2a9888d8fcfd0f04a5ba62b3fa55d641 (patch) | |
tree | 14c694f452ec65db7741709727c69236bca703ec | |
parent | 62bbce3299681741f618da064314275ad4e0c492 (diff) |
Change docker tagging
Add script to check if a snapshot or release is being built.
Create the appropriate docker tags for each case.
Change-Id: Iac3e1804222a4ce838a3fb8a2130036ec0cda40d
Signed-off-by: Patrick Brady <pb071s@att.com>
-rw-r--r-- | installation/appc/pom.xml | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/installation/appc/pom.xml b/installation/appc/pom.xml index db1cb67..3982e23 100644 --- a/installation/appc/pom.xml +++ b/installation/appc/pom.xml @@ -192,6 +192,40 @@ <build> <plugins> <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <properties> + <ver>${project.version}</ver> + <timestamp>${maven.build.timestamp}</timestamp> + </properties> + <source> + println project.properties['ver']; + def versionArray; + if ( project.properties['ver'] != null ) { + versionArray = project.properties['ver'].split('\\.'); + } + if ( project.properties['ver'].endsWith("-SNAPSHOT") ) { + project.properties['dockertag1']=project.properties['ver'] + "-latest"; + project.properties['dockertag2']="latest"; + } else { + project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp']; + } + println 'docker tag 1: ' + project.properties['dockertag1']; + println 'docker tag 2: ' + project.properties['dockertag2']; + </source> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.16.5</version> @@ -205,8 +239,8 @@ <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile> <tags> - <tag>${appc.docker.staging.version}-STAGING-${maven.build.timestamp}</tag> - <tag>${release_name}.${sprint_number}-STAGING-latest</tag> + <tag>${dockertag1}</tag> + <tag>${dockertag2}</tag> </tags> </build> </image> |