From 99dadce1f0f15a22f26bf9d9c3c09f25a5972f4a Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Fri, 7 Jun 2019 15:53:59 -0400 Subject: policy/pap must publish docker images with tag X.Y-SNAPSHOT-latest Issue-ID: POLICY-1808 Signed-off-by: Rashmi Pujar Change-Id: I372de55eca0208df4bb059221ceae76d05737a10 --- packages/policy-pap-docker/pom.xml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/packages/policy-pap-docker/pom.xml b/packages/policy-pap-docker/pom.xml index e839b63e..4aecace4 100644 --- a/packages/policy-pap-docker/pom.xml +++ b/packages/policy-pap-docker/pom.xml @@ -60,25 +60,19 @@ - println 'Project version: ' + project.properties['dist.project.version']; - def - versionArray; - if ( project.properties['dist.project.version'] != null ) { - versionArray = - project.properties['dist.project.version'].split('-'); + println 'Project version: ' + project.properties['dist.project.version'] + if (project.properties['dist.project.version'] != null) { + def versionArray = project.properties['dist.project.version'].split('-') + def minMaxVersionArray = versionArray[0].tokenize('.') + if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) { + project.properties['project.docker.latest.minmax.tag.version'] = + minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest" + } else { + project.properties['project.docker.latest.minmax.tag.version'] = + minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest" + } + println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version'] } - - if ( - project.properties['dist.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']; @@ -105,7 +99,7 @@ ${project.version} ${project.version}-${maven.build.timestamp} - ${project.docker.latesttag.version} + ${project.docker.latest.minmax.tag.version} @@ -178,4 +172,4 @@ tar.gz - \ No newline at end of file + -- cgit 1.2.3-korg