summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2018-03-23 15:18:40 -0400
committerLusheng Ji <lji@research.att.com>2018-03-24 13:48:46 +0000
commit394a02ce9a676b339670558eaf16ed361bb54815 (patch)
tree6dc5269c224f774989a5cac9435d1c76a268c0ea
parent8374ca27bb8ad13be686d689301edef2f4c1fb0f (diff)
Update docker tagging
Update the way docker images are tagged, following new guideline. Issue-ID: DCAEGEN2-206 Change-Id: Ie8d0459b8a8b9c324d34cdc085f4ead63977a969 Signed-off-by: Lusheng Ji <lji@research.att.com>
-rw-r--r--scripts/mvn-phase-lib.sh29
1 files changed, 20 insertions, 9 deletions
diff --git a/scripts/mvn-phase-lib.sh b/scripts/mvn-phase-lib.sh
index 6f8f2af..1f914b6 100644
--- a/scripts/mvn-phase-lib.sh
+++ b/scripts/mvn-phase-lib.sh
@@ -470,7 +470,18 @@ EOL
#IndependentVersioningandReleaseProcess-StandardizedDockerTagging
build_and_push_docker()
{
- IMAGENAME="onap/${FQDN}.${MVN_PROJECT_MODULEID}"
+ # Old tagging
+ #IMAGENAME="onap/${FQDN}.${MVN_PROJECT_MODULEID}"
+ # new tagging
+ ENDIND=$(echo $abc | rev | cut -f1 -d '.' |rev)
+ if [ "$ENDID" == "${MVN_PROJECT_MODULEID}" ]; then
+ #IMAGENAME="onap/${FQDN/org.onap./}"
+ IMAGENAME="onap/${FQDN}"
+ else
+ #IMAGENAME="onap/${FQDN/org.onap./}.${MVN_PROJECT_MODULEID}"
+ IMAGENAME="onap/${FQDN}.${MVN_PROJECT_MODULEID}"
+ fi
+
IMAGENAME=$(echo "$IMAGENAME" | sed -e 's/_*$//g' -e 's/\.*$//g')
IMAGENAME=$(echo "$IMAGENAME" | tr '[:upper:]' '[:lower:]')
@@ -478,7 +489,7 @@ build_and_push_docker()
VERSION="${MVN_PROJECT_VERSION//[^0-9.]/}"
VERSION2=$(echo "$VERSION" | cut -f1-2 -d'.')
- LFQI="${IMAGENAME}:${VERSION}-${TIMESTAMP}"
+ LFQI="${IMAGENAME}:${VERSION}-${TIMESTAMP}"Z
# build a docker image
docker build --rm -f ./Dockerfile -t "${LFQI}" ./
@@ -508,13 +519,13 @@ build_and_push_docker()
docker login "$REPO" -u "$USER" -p "$PASS"
# local tag is imagename:version-timestamp
- OLDTAG="${LFQI}"
- #PUSHTAGS="${REPO}/${IMAGENAME}:${VERSION2}-${TIMESTAMP} ${REPO}/${IMAGENAME}:${VERSION2} ${REPO}/${IMAGENAME}:${VERSION2}-latest"
- # four tags are pushed:
- # imagename:symver-timestamp,
- # imagename:semver, imagename:symver-snapshot : latest of current version
- # imagename:latest: latest of all, used mainly by csit
- PUSHTAGS="${REPO}/${LFQI} ${REPO}/${IMAGENAME}:${VERSION} ${REPO}/${IMAGENAME}:${VERSION}-snapshot ${REPO}/${IMAGENAME}:latest"
+ OLDTAG="${LFQI}"
+ # three tags are pushed:
+ # {imagename}:{semver}-SNAPSHOT-{timestamp}Z this is what CIMAN-132 asks
+ # {imagename}:{semver} latest of current version, for testing
+ # {imagename}:latest latest of all, used mainly by csit
+ # LFQI="${IMAGENAME}:${VERSION}-${TIMESTAMP}"Z
+ PUSHTAGS="${REPO}/${IMAGENAME}:${VERSION}-SNAPSHOT-${TIMESTAMP}Z ${REPO}/${IMAGENAME}:${VERSION} ${REPO}/${IMAGENAME}:latest"
for NEWTAG in ${PUSHTAGS}
do
echo "tagging ${OLDTAG} to ${NEWTAG}"