diff options
Diffstat (limited to 'jjb/include-docker-push.sh')
-rw-r--r-- | jjb/include-docker-push.sh | 18 |
1 files 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 |