From de400eb69786c8d4deb41085805c80ad41406eb3 Mon Sep 17 00:00:00 2001 From: Lusheng Date: Thu, 9 Mar 2017 04:57:19 +0000 Subject: docker versioning Change-Id: I99ae9992328b1ce889dc1e5bac58f15d010606e4 Signed-off-by: Lusheng --- docker-build.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'docker-build.sh') diff --git a/docker-build.sh b/docker-build.sh index c0e60a8..d74b4dc 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -108,8 +108,15 @@ EOF # # build the docker image. tag and then push to the remote repo # -IMAGE='dcae-controller-common-event' -TAG='1.0.0' +IMAGE='openecomp/dcae-controller-common-event' +#TAG='1.0.0' +VERSION=$(xpath -e "//project/version/text()" "pom.xml") +EXT=$(echo "$VERSION" | rev | cut -s -f1 -d'-' | rev) +if [ -z "$EXT" ]; then + VERSION=$(echo "${VERSION}-STAGING") +fi +TIMESTAMP=$(date +%C%y%m%dT%H%M%S) +TAG="$VERSION-$TIMESTAMP" LFQI="${IMAGE}:${TAG}" BUILD_PATH="${WORKSPACE}/target/stage" @@ -138,4 +145,13 @@ if [ ! -z "$REPO" ]; then # push to remote repo docker push "${RFQI}" + + + TAG="LATEST" + LFQI="${IMAGE}:${TAG}" + RFQI2="${REPO}/${LFQI}" + echo "$LFQI" + echo "$RFQI2" + docker tag "${RFQI}" "${RFQI2}" + docker push "${RFQI2}" fi -- cgit 1.2.3-korg