From 33510a178a9464521e88cd0bed3dc298f09f47fa Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 6 Sep 2016 17:31:14 +0200 Subject: [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 --- jjb/opnfv/opnfv-docker.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit 1.2.3-korg