diff options
author | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2016-02-23 11:44:46 +0100 |
---|---|---|
committer | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2016-02-25 14:17:23 +0100 |
commit | c2433197d4fba6bea36713878cd38c3c523b4327 (patch) | |
tree | 23ba0afcde625ebfb098ddaa8cba5496a683db58 /jjb/opnfv/opnfv-docker.sh | |
parent | 1525a2ec04f7e592fc97d8b7d20a1870ac9312d5 (diff) |
docker: Make it possible to specify tags for Docker Images of test projects
Also use latest for images built on master and stable for images built on stable branch.
Change-Id: I0988be86abcb2a13d8e94962b4ba1ced8778793b
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/opnfv/opnfv-docker.sh')
-rw-r--r-- | jjb/opnfv/opnfv-docker.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh index 4089a6ff3..2b4ca907a 100644 --- a/jjb/opnfv/opnfv-docker.sh +++ b/jjb/opnfv/opnfv-docker.sh @@ -78,11 +78,13 @@ echo "Current branch: $branch" if [[ "$branch" == "master" ]]; then DOCKER_TAG="master" + DOCKER_BRANCH_TAG="latest" else git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng DOCKER_TAG=$($WORKSPACE/releng/utils/calculate_version.sh -t docker \ -n $DOCKER_REPO_NAME) + DOCKER_BRANCH_TAG="stable" ret_val=$? if [[ $ret_val -ne 0 ]]; then @@ -94,11 +96,11 @@ echo "Tag version to be build and pushed: $DOCKER_TAG" # Start the build -echo "Building docker image: $DOCKER_REPO_NAME:latest" +echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG" -docker build --no-cache -t $DOCKER_REPO_NAME:latest . +docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG . echo "Creating tag '$DOCKER_TAG'..." -docker tag -f $DOCKER_REPO_NAME:latest $DOCKER_REPO_NAME:$DOCKER_TAG +docker tag -f $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG $DOCKER_REPO_NAME:$DOCKER_TAG # list the images echo "Available images are:" @@ -110,8 +112,8 @@ if [[ "$PUSH_IMAGE" == "true" ]]; then echo "--------------------------------------------------------" echo # Push to the Dockerhub repository - echo "Pushing $DOCKER_REPO_NAME:latest ..." - docker push $DOCKER_REPO_NAME:latest + echo "Pushing $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG ..." + docker push $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG echo "Pushing $DOCKER_REPO_NAME:$DOCKER_TAG ..." docker push $DOCKER_REPO_NAME:$DOCKER_TAG |