summaryrefslogtreecommitdiffstats
path: root/jjb/opnfv
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-02-01 15:45:32 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2016-02-01 15:47:56 +0100
commit630e0f4f05697d715fcab9c86e8eeb9c821047ae (patch)
tree63b9a2cc55169353572150b5135ae75876006fc4 /jjb/opnfv
parente09952c1e3ad16537447d2f732403af4dd6a32ed (diff)
Add -f to create a new tag to docker job
Also, build latest first and create brahmaputra tag later Change-Id: Iee1d63576b21ca30d75d2ae1fe35bbd8747f9037 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'jjb/opnfv')
-rw-r--r--jjb/opnfv/opnfv-docker.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
index adb519394..4089a6ff3 100644
--- a/jjb/opnfv/opnfv-docker.sh
+++ b/jjb/opnfv/opnfv-docker.sh
@@ -94,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:"
@@ -110,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