summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-09-06 17:31:14 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-09-06 17:31:14 +0200
commit33510a178a9464521e88cd0bed3dc298f09f47fa (patch)
treea79c55c7e48cb8dd31dfef1aab1097839e1195c9
parent1a1d78d221e45c7299a6264a7f79349a351d4fd4 (diff)
[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 <jose.lausuch@ericsson.com>
-rw-r--r--jjb/opnfv/opnfv-docker.sh7
1 files changed, 6 insertions, 1 deletions
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