Protect vs build-args not consumed 09/65109/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Wed, 14 Nov 2018 09:52:38 +0000 (10:52 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Wed, 14 Nov 2018 09:54:16 +0000 (10:54 +0100)
BRANCH is useless in case of components which only inherits from tempest.
The build could simply fail depending on the docker version [1].

[1] https://build.opnfv.org/ci/job/opnfv-functest-components-latest-build/1/console

Change-Id: I7fe0c5bf8373e61a658153fda3d3a4bd233f6bc0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 284e30415fdec9c1a17c7f0b0b023fb0bbf045ce)

ci/gate.yaml

index 58f1fd6..fa872c9 100644 (file)
       - functest-gerrit
     builders:
       - shell: |
+          case "{container}" in
+          "components")
+              args="" ;;
+          *)
+              args="--build-arg BRANCH=${{branch}}" ;;
+          esac
           cd docker/$(echo {container} |cut -d\- -f 2)
-          docker build \
-            --pull=false --no-cache --force-rm=true \
-            --build-arg BRANCH=${{branch}} \
+          sudo docker build \
+            ${{args}} --pull=false --no-cache --force-rm=true \
             -t {repo}/functest-{container}:{tag} .
 
 - project: