From c9dca11d2a9888d8fcfd0f04a5ba62b3fa55d641 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Thu, 27 Apr 2017 23:58:13 -0700 Subject: 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 --- installation/appc/pom.xml | 38 ++++++++++++++++++++++++++++++++++++-- 1 file 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 @@ -191,6 +191,40 @@ docker + + org.codehaus.groovy.maven + gmaven-plugin + + + validate + + execute + + + + ${project.version} + ${maven.build.timestamp} + + + 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']; + + + + + io.fabric8 docker-maven-plugin @@ -205,8 +239,8 @@ ${basedir}/target/docker-stage ${basedir}/target/docker-stage/Dockerfile - ${appc.docker.staging.version}-STAGING-${maven.build.timestamp} - ${release_name}.${sprint_number}-STAGING-latest + ${dockertag1} + ${dockertag2} -- cgit 1.2.3-korg