diff options
author | Timoney, Dan (dt5972) <dtimoney@att.com> | 2019-02-14 16:38:27 -0500 |
---|---|---|
committer | Timoney, Dan (dt5972) <dtimoney@att.com> | 2019-02-14 16:38:27 -0500 |
commit | d4b1b9d27f4dd0563a1a1f7c25cb0ff92f2ccc0a (patch) | |
tree | caf63c020cf329c6244c33ca2f3a8fe27242e16e /installation/TagVersion.groovy | |
parent | b1e839a6b6e5ef00a48b9525317736a917e8c287 (diff) |
Fix docker tags
Fix docker image tags to conform to ONAP standards
Change-Id: Id85ab45a3b5a99f215f42177640ed03ab39004bc
Issue-ID: SDNC-645
Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
Former-commit-id: 5eadcba086124f49b7cdcc53db4b4622dc2ebd93
Diffstat (limited to 'installation/TagVersion.groovy')
-rw-r--r-- | installation/TagVersion.groovy | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/installation/TagVersion.groovy b/installation/TagVersion.groovy new file mode 100644 index 00000000..9daac313 --- /dev/null +++ b/installation/TagVersion.groovy @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP SDNC + * ================================================================================ + * 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.sdnc.oam + + +def versionArray; +if ( project.properties['sdnc.project.version'] != null ) { + versionArray = project.properties['sdnc.project.version'].split('\\.'); +} + +if ( project.properties['sdnc.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['sdnc.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['sdnc.build.timestamp']; +} |