From 00c3848ea8f8d2c03528838262c5c2168db2104a Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 14 Feb 2019 13:52:48 -0500 Subject: Fix docker tags Update docker tags to conform to ONAP project standards Change-Id: I348f9507e382931e6adfa224d30225f0fbe270bc Issue-ID: CCSDK-1059 Signed-off-by: Timoney, Dan (dt5972) --- TagVersion.groovy | 41 +++++++++++++++ ms/blueprintsprocessor/distribution/pom.xml | 78 ++++++++++++---------------- ms/controllerblueprints/distribution/pom.xml | 25 +++------ ms/neng/pom.xml | 26 +++------- ms/vlantag-api/pom.xml | 33 ++++-------- 5 files changed, 99 insertions(+), 104 deletions(-) create mode 100644 TagVersion.groovy diff --git a/TagVersion.groovy b/TagVersion.groovy new file mode 100644 index 00000000..68a8b780 --- /dev/null +++ b/TagVersion.groovy @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CCSDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.ccsdk.distribution + + +def versionArray; +if ( project.properties['ccsdk.project.version'] != null ) { + versionArray = project.properties['ccsdk.project.version'].split('\\.'); +} + +if ( project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT") ) { + patchArray = versionArray[2].split('-'); + project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest"; + project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-latest"; + project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-"+project.properties['ccsdk.build.timestamp']; +} else { + project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-latest"; + project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-"+project.properties['ccsdk.build.timestamp']; +} diff --git a/ms/blueprintsprocessor/distribution/pom.xml b/ms/blueprintsprocessor/distribution/pom.xml index fb5e3c12..b3eabc10 100755 --- a/ms/blueprintsprocessor/distribution/pom.xml +++ b/ms/blueprintsprocessor/distribution/pom.xml @@ -14,7 +14,9 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor @@ -33,6 +35,8 @@ ${https_proxy} deploy true + ${project.version} + ${maven.build.timestamp} @@ -77,7 +81,8 @@ package - + @@ -91,7 +96,7 @@ maven-assembly-plugin 3.1.0 - + ${basedir}/target/docker-stage src/main/docker/distribution.xml @@ -119,22 +124,7 @@ execute - - println project.properties['ccsdk.project.version'] - def versionArray - if (project.properties['ccsdk.project.version'] != null ) { - versionArray = project.properties['ccsdk.project.version'].split('\\.') - } - - if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) - { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest" - } else { - project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest" - } - - println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'] - + ${basedir}/../../../TagVersion.groovy @@ -147,30 +137,30 @@ docker - - - io.fabric8 - docker-maven-plugin - 0.26.1 - false - - - - ${image.name} - - try - ${basedir}/target/docker-stage - - ${project.version} - ${project.version}-STAGING-${maven.build.timestamp} - ${project.docker.latesttag.version} - - - - - true - - + + + io.fabric8 + docker-maven-plugin + 0.26.1 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} + + + + + true + + generate-images package @@ -193,4 +183,4 @@ - \ No newline at end of file + diff --git a/ms/controllerblueprints/distribution/pom.xml b/ms/controllerblueprints/distribution/pom.xml index 91d4bbca..c73d15b6 100755 --- a/ms/controllerblueprints/distribution/pom.xml +++ b/ms/controllerblueprints/distribution/pom.xml @@ -34,6 +34,8 @@ ${https_proxy} deploy true + ${project.version} + ${maven.build.timestamp} @@ -120,22 +122,7 @@ execute - - println project.properties['ccsdk.project.version'] - def versionArray - if (project.properties['ccsdk.project.version'] != null ) { - versionArray = project.properties['ccsdk.project.version'].split('\\.') - } - - if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) - { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest" - } else { - project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest" - } - - println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'] - + ${basedir}/../../../TagVersion.groovy @@ -162,9 +149,9 @@ try ${basedir}/target/docker-stage - ${project.version} - ${project.version}-STAGING-${maven.build.timestamp} - ${project.docker.latesttag.version} + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} diff --git a/ms/neng/pom.xml b/ms/neng/pom.xml index ed68afb4..fcd3f3d2 100644 --- a/ms/neng/pom.xml +++ b/ms/neng/pom.xml @@ -59,7 +59,9 @@ ${project.version} onap/ccsdk-apps-ms-neng ${maven.build.timestamp} - yyyyMMddHHmmss + yyyyMMddHHmmss + ${project.version} + ${maven.build.timestamp} @@ -198,9 +200,9 @@ try ${basedir}/target/docker-stage - ${project.version} - ${project.docker.latesttag.version} - ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} @@ -381,21 +383,7 @@ execute - - println project.properties['ccsdk.project.version']; - def versionArray; - if (project.properties['ccsdk.project.version'] != null) { - versionArray = project.properties['ccsdk.project.version'].split('\\.'); - } - - if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) { - project.properties['project.docker.latesttag.version'] = versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; - } else { - project.properties['project.docker.latesttag.version'] = versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; - } - - println 'New Tag for docker:' + project.properties['project.docker.latesttag.version']; - + ${basedir}/../../TagVersion.groovy diff --git a/ms/vlantag-api/pom.xml b/ms/vlantag-api/pom.xml index ea461056..e2734703 100644 --- a/ms/vlantag-api/pom.xml +++ b/ms/vlantag-api/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 org.onap.ccsdk.apps.ms.vlantagapi @@ -34,13 +36,14 @@ deploy true ${project.version} + ${maven.build.timestamp} org.onap.ccsdk.parent spring-boot-starter-parent 1.2.1-SNAPSHOT - + @@ -116,22 +119,7 @@ execute - - println project.properties['ccsdk.project.version']; - def versionArray; - if (project.properties['ccsdk.project.version'] != null ) { - versionArray = project.properties['ccsdk.project.version'].split('\\.'); - } - - if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) - { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; - } else { - project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest"; - } - - println 'New Tag for docker:' + project.properties['project.docker.latesttag.version']; - + ${basedir}/../../TagVersion.groovy @@ -152,7 +140,7 @@ jacoco-maven-plugin 0.7.5.201505241946 - pre-unit-test @@ -165,7 +153,7 @@ surefireArgLine - post-unit-test @@ -234,8 +222,9 @@ docker-hub https://${docker.registry} - ${project.version} - latest + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} true -- cgit 1.2.3-korg