From 3512f4dd30f24602fcea891c2804899984739ce3 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Fri, 2 Jun 2017 00:41:50 -0400 Subject: Update the jenkins job for 1.1-SNAPSHOT Change-Id: Ib11656b83910992da290ccd1dfd75457adae614d Signed-off-by: Venkata Harish K Kajur --- jjb/include-docker-push.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jjb/include-docker-push.sh b/jjb/include-docker-push.sh index 2360055be..57a0264bb 100644 --- a/jjb/include-docker-push.sh +++ b/jjb/include-docker-push.sh @@ -15,6 +15,7 @@ else VERSION=1.1.0; fi +RELEASE_VERSION_REGEX="^[0-9]+\.[0-9]+\.[0-9]+$"; SNAPSHOT_TAG=${VERSION}-SNAPSHOT-${DATETIME_STAMP}; STAGING_TAG=${VERSION}-STAGING-${DATETIME_STAMP}; @@ -26,12 +27,10 @@ if [[ $PROJECT =~ $SEARCH ]] ; then docker tag $REPO_PATH:latest $REPO_PATH:$STAGING_TAG; docker tag $REPO_PATH:latest $REPO_PATH:$SNAPSHOT_TAG; - if [ "$VERSION" == "1.0.0" ]; then - docker tag $REPO_PATH:latest $REPO_PATH:1.0-STAGING-latest; - docker push $REPO_PATH:1.0-STAGING-latest; - elif [ "$VERSION" == "1.1.0" ]; then - docker tag $REPO_PATH:latest $REPO_PATH:1.1-STAGING-latest; - docker push $REPO_PATH:1.1-STAGING-latest; + if [[ "$VERSION" =~ $RELEASE_VERSION_REGEX ]]; then + STRIPPED_RELEASE=$(echo $VERSION | cut -d"." -f1,2); + docker tag $REPO_PATH:latest $REPO_PATH:${STRIPPED_RELEASE}-STAGING-latest; + docker push $REPO_PATH:${STRIPPED_RELEASE}-STAGING-latest; else docker push $REPO_PATH:latest; fi @@ -47,9 +46,10 @@ else docker tag $REPO_PATH:latest $REPO_PATH:$STAGING_TAG; docker tag $REPO_PATH:latest $REPO_PATH:$SNAPSHOT_TAG; - if [ "$VERSION" == "1.0.0" ]; then - docker tag $REPO_PATH:latest $REPO_PATH:1.0-STAGING-latest; - docker push $REPO_PATH:1.0-STAGING-latest; + if [[ "$VERSION" =~ $RELEASE_VERSION_REGEX ]]; then + STRIPPED_RELEASE=$(echo $VERSION | cut -d"." -f1,2); + docker tag $REPO_PATH:latest $REPO_PATH:${STRIPPED_RELEASE}-STAGING-latest; + docker push $REPO_PATH:${STRIPPED_RELEASE}-STAGING-latest; else docker push $REPO_PATH:latest; fi -- cgit 1.2.3-korg