Allow conditional docker build args 21/66221/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Sat, 5 Jan 2019 12:56:30 +0000 (13:56 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 5 Jan 2019 12:56:30 +0000 (13:56 +0100)
It allows managing xtesting and functest jjbs via the same role.
functest-component doesn't take BRANCH into account.

Change-Id: If487e8350bca6b37d585a4ed16214e77df6170ae
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
jjb/functest/xtesting.yaml

index 8e2b1e8..267514a 100644 (file)
           else
             image={repo}:{port}/{container}:{tag}
           fi
+          if [ "{ref_arg}" = "None" ]; then
+            build_arg=""
+          else
+            build_arg="--build-arg {ref_arg}={ref}"
+          fi
           cd {path}
-          sudo docker build --build-arg {ref_arg}={ref} \
+          sudo docker build $build_arg \
             --pull=false --no-cache --force-rm=true \
             -t $image .