From b1cc5ba4901b76e9cbc05b3a4a53a7485e619c55 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Thu, 31 Aug 2017 17:23:57 +0200 Subject: Add Docker tags Add docker tags SNAPSHOT and STAGING to the current ones for automation Change-Id: I330271ec169cba33d0b92579e39afeed55795bd0 Issue-Id: CLAMP-43 Signed-off-by: Determe, Sebastien (sd378r) --- pom.xml | 74 +++++++++++++++++++++++++-------------- src/main/script/TagVersion.groovy | 40 +++++++++++++++++++++ 2 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 src/main/script/TagVersion.groovy diff --git a/pom.xml b/pom.xml index c1ec0e2f..8bcd5ef1 100644 --- a/pom.xml +++ b/pom.xml @@ -30,11 +30,11 @@ 1.0.1-SNAPSHOT ONAP CLAMP - - org.onap.oparent - oparent - 1.0.0-SNAPSHOT - + + + + + This project build the ONAP CLAMP JAR that contains AJSC + CLAMP code. @@ -57,6 +57,9 @@ + yyyy.MM.dd'T'hh.mm.ss'Z' + ${project.version} + ${maven.build.timestamp} 1.8 1.8 UTF-8 @@ -339,7 +342,7 @@ org.onap.policy.engine PolicyEngineAPI - 1.1.0-SNAPSHOT + 1.1.0 log4j @@ -362,7 +365,7 @@ org.onap.policy.common ONAP-Logging - 1.1.0-SNAPSHOT + 1.1.0 log4j @@ -465,6 +468,22 @@ + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + validate + + execute + + + ${project.basedir}/src/main/script/TagVersion.groovy + + + + org.apache.maven.plugins maven-jar-plugin @@ -587,8 +606,9 @@ src/main/docker docker-hub - ${project.version} latest + ${project.docker.latesttagtimestamp.version} + ${project.docker.latesttag.version} true @@ -643,7 +663,7 @@ push - ${docker.push.registry}/onap/clamp + ${docker.push.registry}/onap/clamp ${skip.docker.push} @@ -770,22 +790,22 @@ - - merge - - post-integration-test - - - - ${project.build.directory}/coverage-reports - - *.exec - - - - ${project.build.directory}/jacoco-dev.exec - - + + merge + + post-integration-test + + + + ${project.build.directory}/coverage-reports + + *.exec + + + + ${project.build.directory}/jacoco-dev.exec + + @@ -803,8 +823,8 @@ true false - false - false + true + true diff --git a/src/main/script/TagVersion.groovy b/src/main/script/TagVersion.groovy new file mode 100644 index 00000000..c365da85 --- /dev/null +++ b/src/main/script/TagVersion.groovy @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * 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============================================ + * =================================================================== + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + +package org.onap.clamp.clds.maven.scripts + +println project.properties['clamp.project.version']; +def versionArray; +if ( project.properties['clamp.project.version'] != null ) { + versionArray = project.properties['clamp.project.version'].split('\\.'); +} + +if ( project.properties['clamp.project.version'].endsWith("-SNAPSHOT") ) { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest"; + project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-"+project.properties['clamp.build.timestamp']; +} else { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-"+project.properties['clamp.build.timestamp']; +} + +println 'New Tag for docker:' + project.properties['project.docker.latesttag.version']; \ No newline at end of file -- cgit 1.2.3-korg