dovetail: docker build not set branch parameter 49/29049/1
authorMatthewLi <matthew.lijun@huawei.com>
Mon, 20 Feb 2017 06:31:29 +0000 (01:31 -0500)
committerMatthewLi <matthew.lijun@huawei.com>
Mon, 20 Feb 2017 06:36:04 +0000 (01:36 -0500)
JIRA: DOVETAIL-354

1)in https://build.opnfv.org/ci/view/dovetail/job/dovetail-compass-baremetal-debug-master/200/artifact/results/dovetail_report.txt
Version isn't correct, version should be obtained from https://git.opnfv.org/dovetail/tree/setup.cfg
2)since dovetail not have A/B/C/D branches such as Danube, no need to set branch parameter
when doing "docker build", if branch parameter settled, the "version" info in setup.cfg will not obtained.
3)related patch https://gerrit.opnfv.org/gerrit/#/c/29045/

Change-Id: I2b2880e417460a4a3da3e108bb83800e2acb3a83
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
jjb/releng/opnfv-docker.sh

index c906e1f..edb10d1 100644 (file)
@@ -77,8 +77,12 @@ fi
 echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG"
 echo "--------------------------------------------------------"
 echo
-cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$BRANCH
-    -f $DOCKERFILE ."
+if [[ $DOCKER_REPO_NAME == *"dovetail"* ]]; then
+    cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG -f $DOCKERFILE ."
+else
+    cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$BRANCH
+        -f $DOCKERFILE ."
+fi
 
 echo ${cmd}
 ${cmd}