From: jose.lausuch Date: Tue, 6 Sep 2016 15:31:14 +0000 (+0200) Subject: [Docker] Use build time args only for Functest X-Git-Tag: colorado.1.0~72 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=33510a178a9464521e88cd0bed3dc298f09f47fa;p=releng.git [Docker] Use build time args only for Functest Using build-time arguments on Dockerfiles which dont use the argument throws an error: One or more build-args [BRANCH] were not consumed, failing build. Examples: https://build.opnfv.org/ci/view/functest/job/functest-docker-build-push-master/lastBuild/console Change-Id: I2acb3a52ef648ca4f160f63cdcdebf1dae5931bc Signed-off-by: jose.lausuch --- diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh index 860eee05d..07198c608 100644 --- a/jjb/opnfv/opnfv-docker.sh +++ b/jjb/opnfv/opnfv-docker.sh @@ -110,7 +110,12 @@ echo "Tag version to be build and pushed: $DOCKER_TAG" # Start the build echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG" -docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG --build-arg BRANCH=$branch . +if [[ $DOCKER_REPO_NAME == *"functest"* ]]; then + docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG --build-arg BRANCH=$branch . +else + docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG . +fi + echo "Creating tag '$DOCKER_TAG'..." docker tag -f $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG $DOCKER_REPO_NAME:$DOCKER_TAG