Improve packer verify and build jobs 71/10471/1
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 1 Aug 2017 04:31:17 +0000 (14:31 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Tue, 1 Aug 2017 04:31:17 +0000 (14:31 +1000)
- AGL uses multiple user credentials some of which are missing.
  JJB does not support setting "Ignore missing credentials" through
  JJB, therefore create a separate wrapper to fix the issue.
- Improve the packer validation builder to exclude non-packer
  templates.

Change-Id: I16524cbee14add2028d8c9e30b0f6c9315928031
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
jjb/ci-management/ci-management.yaml
jjb/global-macros.yaml

index 07811ea..5407073 100644 (file)
           choosing-strategy: 'gerrit'
 
     wrappers:
-      - agl-infra-wrappers:
-          build-timeout: '{build-timeout}'
+      - timeout:
+          type: absolute
+          timeout: '{build-timeout}'
+          timeout-var: 'BUILD_TIMEOUT'
+          fail: true
+      - ssh-agent-credentials:
+          users:
+            - 'd28b1f3b-3603-49bc-b837-bb0a2e85d4b8'
+      - ansicolor
+      - openstack:
+          single-use: false
 
     triggers:
       - gerrit-trigger-patch-submitted:
           choosing-strategy: 'gerrit'
 
     wrappers:
+      - timeout:
+          type: absolute
+          timeout: '{build-timeout}'
+          timeout-var: 'BUILD_TIMEOUT'
+          fail: true
       - ssh-agent-credentials:
           users:
-              - '{ssh-credentials}'
-      - agl-infra-wrappers:
-          build-timeout: '{build-timeout}'
+            - 'd28b1f3b-3603-49bc-b837-bb0a2e85d4b8'
+      - ansicolor
+      - openstack:
+          single-use: false
 
     triggers:
       - timed: '00 10 1 * *'
       - gerrit:
+          server-name: 'gerrit.automotivelinux.org'
           trigger-on:
             - change-merged-event
             - comment-added-contains-event:
                 comment-contains-value: 'remerge'
           projects:
             - project-compare-type: 'ANT'
-              project-pattern: 'ci-management'
+              project-pattern: '{name}'
               branches:
                 - branch-compare-type: 'ANT'
                   branch-pattern: '**/{branch}'
index c73bd86..19a794b 100644 (file)
           templates="../packer/templates/*"
           provision="../packer/provision/*.sh"
           for v in $varfiles; do
-              [[ "${v##*/}" =~ ^(cloud-env.*|README.*)$ ]] && continue
+              [[ ${v##*/} =~ ^(cloud-env.*|lava-env.*|README.md)$ ]] && continue
               for t in $templates; do
+                  [[ ${t##*/} =~ ^(cloud-env.*|lava-env.*|README.md)$ ]] && continue
                   export PACKER_LOG="yes" && \
                   export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
                               packer.io validate -var-file=$CLOUDENV \
                               -var-file=$v $t
                   if [ $? -ne 0 ]; then
-                      break
+                      exit 1
                   fi
               done
           done
+          # todo: migrate to linting with shellcheck
           for p in $provision; do
               /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
           done