Allow conditional docker build args
[releng.git] / 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 .