X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Freleng%2Fopnfv-docker.sh;h=50efaada3e04f9a563a3723af4626e971edb28cf;hb=fe01e2d8ea9d3578cbeed5fd2b7ec50950c04b0a;hp=174bb57b9223c15ba23502ce396c3e996e8308ad;hpb=e5d71f0083ac5c343d206daab7d205c31999ffcc;p=releng.git diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index 174bb57b9..50efaada3 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -23,9 +23,9 @@ function remove_containers_images() # # $ docker ps -a # CONTAINER ID IMAGE COMMAND ... - # 6a796ed40b8e opnfv/compass-tasks:latest "/bin/bash" ... - # 99fcb59f4787 opnfv/compass-tasks-base:latest "/bin/bash" ... - # cc5eee16b995 opnfv/compass-tasks-k8s "/bin/bash" ... + # 6a796ed40b8e anuket/example-tasks:latest "/bin/bash" ... + # 99fcb59f4787 anuket/example-tasks-base:latest "/bin/bash" ... + # cc5eee16b995 anuket/example-tasks-k8s "/bin/bash" ... # # Cut image name by leading space and ending space or colon(tag) if [[ -n "$(docker ps -a | grep " $DOCKER_REPO_NAME[ :]")" ]]; then @@ -44,9 +44,9 @@ function remove_containers_images() # # $ docker images # REPOSITORY TAG IMAGE ID ... - # opnfv/compass-tasks latest 6501569fd328 ... - # opnfv/compass-tasks-base latest 8764fe29c434 ... - # opnfv/compass-tasks-k8s latest 61094cac9e65 ... + # anuket/example-tasks latest 6501569fd328 ... + # anuket/example-tasks-base latest 8764fe29c434 ... + # anuket/example-tasks-k8s latest 61094cac9e65 ... # # Cut image name by start of line and ending space if [[ -n "$(docker images | grep "^$DOCKER_REPO_NAME ")" ]]; then @@ -98,14 +98,20 @@ RELEASE_VERSION=${GERRIT_REFNAME/refs\/tags\/} # If we're being triggered by a comment-added job, then extract the tag # from the comment and use that as the release version. -# Expected comment format: retag opnfv-x.y.z +# Expected comment format: retag anuket-x.y.z if [[ "${GERRIT_EVENT_TYPE:-}" == "comment-added" ]]; then RELEASE_VERSION=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'retag' | awk '{print $2}') fi if [[ "$BRANCH" == "master" ]]; then DOCKER_TAG="latest" -elif [[ -n "${RELEASE_VERSION-}" ]]; then +fi + +if [[ "$BRANCH" =~ "stable" ]]; then + DOCKER_TAG="stable" +fi + +if [[ -n "${RELEASE_VERSION-}" ]]; then DOCKER_TAG=${RELEASE_VERSION} if git checkout ${RELEASE_VERSION}; then echo "Successfully checked out the git tag ${RELEASE_VERSION}" @@ -114,8 +120,6 @@ elif [[ -n "${RELEASE_VERSION-}" ]]; then git tag exit 1 fi -else - DOCKER_TAG="stable" fi if [[ -n "${COMMIT_ID-}" && -n "${RELEASE_VERSION-}" ]]; then