summaryrefslogtreecommitdiffstats
path: root/jjb/opnfv/opnfv-docker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/opnfv/opnfv-docker.sh')
-rw-r--r--jjb/opnfv/opnfv-docker.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
index bf355973c..4089a6ff3 100644
--- a/jjb/opnfv/opnfv-docker.sh
+++ b/jjb/opnfv/opnfv-docker.sh
@@ -1,4 +1,12 @@
#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2016 Ericsson AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
set -o errexit
set -o nounset
set -o pipefail
@@ -86,11 +94,11 @@ echo "Tag version to be build and pushed: $DOCKER_TAG"
# Start the build
-echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG..."
+echo "Building docker image: $DOCKER_REPO_NAME:latest"
-docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG .
-echo "Creating tag 'latest'..."
-docker tag $DOCKER_REPO_NAME:$DOCKER_TAG $DOCKER_REPO_NAME:latest
+docker build --no-cache -t $DOCKER_REPO_NAME:latest .
+echo "Creating tag '$DOCKER_TAG'..."
+docker tag -f $DOCKER_REPO_NAME:latest $DOCKER_REPO_NAME:$DOCKER_TAG
# list the images
echo "Available images are:"
@@ -102,8 +110,9 @@ if [[ "$PUSH_IMAGE" == "true" ]]; then
echo "--------------------------------------------------------"
echo
# Push to the Dockerhub repository
- docker push $DOCKER_REPO_NAME:$DOCKER_TAG
-
- echo "Updating $DOCKER_REPO_NAME:latest to the docker registry..."
+ echo "Pushing $DOCKER_REPO_NAME:latest ..."
docker push $DOCKER_REPO_NAME:latest
+
+ echo "Pushing $DOCKER_REPO_NAME:$DOCKER_TAG ..."
+ docker push $DOCKER_REPO_NAME:$DOCKER_TAG
fi