summaryrefslogtreecommitdiffstats
path: root/jjb/opnfv/opnfv-docker.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-01-08 16:24:55 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2016-01-11 09:42:52 +0100
commitb1c855f195b0499f8e499e28419f0b5f059f020a (patch)
tree86d469358d1576e2658b2acbb1ab66e069844941 /jjb/opnfv/opnfv-docker.sh
parentf181fcd9d772b4bc34f67949acd65c1afcfb502e (diff)
Enable test projects' docker image builds for stable/brahmaputra branch
Change-Id: Ib936f58d1f21c4e782cdb1e19d1615b1bed30007 Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/opnfv/opnfv-docker.sh')
-rw-r--r--jjb/opnfv/opnfv-docker.sh37
1 files changed, 21 insertions, 16 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
index 545aef6dd..81bab33bb 100644
--- a/jjb/opnfv/opnfv-docker.sh
+++ b/jjb/opnfv/opnfv-docker.sh
@@ -53,22 +53,6 @@ if [[ "$UPDATE_LATEST_STABLE" == "true" ]]; then
fi
-# Get tag version
-cd $WORKSPACE
-git clone https://gerrit.opnfv.org/gerrit/releng
-
-DOCKER_TAG=$($WORKSPACE/releng/utils/calculate_version.sh -t docker \
- -n $DOCKER_REPO_NAME)
-
-ret_val=$?
-if [ $ret_val -ne 0 ]; then
- echo "Error retrieving the version tag."
- exit 1
-else
- echo "Tag version to be build and pushed: $DOCKER_TAG"
-fi
-
-
# cd to directory where Dockerfile is located
if [[ "$DOCKER_REPO_NAME" == "opnfv/functest" ]]; then
cd $WORKSPACE/docker
@@ -83,6 +67,27 @@ else
exit 1
fi
+
+# Get tag version
+branch=$(git rev-parse --abbrev-ref HEAD)
+if [ $branch == "master" ]; then
+ DOCKER_TAG="master"
+else
+ cd $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng
+
+ DOCKER_TAG=$($WORKSPACE/releng/utils/calculate_version.sh -t docker \
+ -n $DOCKER_REPO_NAME)
+
+ ret_val=$?
+ if [ $ret_val -ne 0 ]; then
+ echo "Error retrieving the version tag."
+ exit 1
+ fi
+fi
+echo "Tag version to be build and pushed: $DOCKER_TAG"
+
+
# Start the build
echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG..."