Reorder build operations in xtesting jjbs 85/69485/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 2 Jan 2020 15:06:03 +0000 (16:06 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 2 Jan 2020 15:07:31 +0000 (16:07 +0100)
It eases conditional instructions (they are useless if only daily jjbs
are setup).

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

index bc797cf..ab2d58e 100644 (file)
     <<: *xtesting-containers
     test: '{test}'
 
-- xtesting-build-containers: &xtesting-build-containers
-    name: 'xtesting-build-containers'
-    <<: *xtesting-containers
-    ref_arg: '{ref_arg}'
-    path: '{path}'
-
 - builder:
     name: xtesting-pull-containers
     builders:
           fi
           sudo docker pull $image
 
-- builder:
-    name: xtesting-build-containers
-    builders:
-      - shell: |
-          set +x
-          if [ "{repo}" = "_" ]; then
-            image={container}:{tag}
-          elif [ "{port}" = "None" ]; then
-            image={repo}/{container}:{tag}
-          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 \
-            --pull=false --no-cache --force-rm=true \
-            -t $image .
-
 - builder:
     name: xtesting-run-containers
     builders:
           fi
           sudo docker rmi $image || true
 
+- xtesting-build-containers: &xtesting-build-containers
+    name: 'xtesting-build-containers'
+    <<: *xtesting-containers
+    ref_arg: '{ref_arg}'
+    path: '{path}'
+
+- builder:
+    name: xtesting-build-containers
+    builders:
+      - shell: |
+          set +x
+          if [ "{repo}" = "_" ]; then
+            image={container}:{tag}
+          elif [ "{port}" = "None" ]; then
+            image={repo}/{container}:{tag}
+          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 \
+            --pull=false --no-cache --force-rm=true \
+            -t $image .
+
 - scm:
     name: xtesting-scm
     scm: