diff options
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/ci-management/ci-management-macros.yaml | 27 | ||||
-rw-r--r-- | jjb/ci-management/ci-management.yaml | 10 |
2 files changed, 25 insertions, 12 deletions
diff --git a/jjb/ci-management/ci-management-macros.yaml b/jjb/ci-management/ci-management-macros.yaml index a5427ce06..c4eef5d26 100644 --- a/jjb/ci-management/ci-management-macros.yaml +++ b/jjb/ci-management/ci-management-macros.yaml @@ -7,13 +7,28 @@ files: - file-id: 'packer-cloud-env' variable: 'CLOUDENV' + # yamllint disable rule:line-length - shell: | cd packer - export PACKER_LOG="yes" - export PACKER_LOG_PATH="packer-validate.log" - packer.io validate -var-file=$CLOUDENV \ - -var-file=vars/{platform}.json \ - templates/{template}.json + varfiles="../packer/vars/*" + templates="../packer/templates/*" + provision="../packer/provision/*.sh" + for v in $varfiles; do + [[ "${{v##*/}}" =~ ^(cloud-env.*)$ ]] && continue + for t in $templates; do + export PACKER_LOG="yes" && \ + export PACKER_LOG_PATH="packer-validate-${{v##*/}}-${{t##*/}}.log" && \ + packer.io validate -var-file=$CLOUDENV -color=false \ + -var-file=$v $t + if [ $? -ne 0 ]; then + break + fi + done + done + for p in $provision; do + /bin/bash -n $p > provision-validate-${{p##*/}}.log 2>&1 + done + # yamllint enable - builder: name: packer-build @@ -21,7 +36,7 @@ - shell: | cd packer export PACKER_LOG="yes" - export PACKER_LOG_PATH="packer-validate.log" + export PACKER_LOG_PATH="packer-build.log" packer.io build -color=false \ -var-file=$CLOUDENV \ -var-file=vars/{platform}.json \ diff --git a/jjb/ci-management/ci-management.yaml b/jjb/ci-management/ci-management.yaml index 1d230621e..f78323ed3 100644 --- a/jjb/ci-management/ci-management.yaml +++ b/jjb/ci-management/ci-management.yaml @@ -5,8 +5,8 @@ jobs: - '{project}-verify-jjb' - '{project}-merge-jjb' - # - '{project}-verify-packer-{platforms}-{templates}' - # - '{project}-merge-packer-{platforms}-{templates}' + - '{project}-verify-packer' + - '{project}-merge-packer-{platforms}-{templates}' archive-artifacts: '**/*.log' branch: 'master' @@ -123,7 +123,7 @@ # maven-version: 'mvn33' - job-template: - name: '{project}-verify-packer-{platforms}-{templates}' + name: '{project}-verify-packer' project-type: freestyle node: '{build-node}' concurrent: true @@ -156,9 +156,7 @@ files: 'packer/**' builders: - - packer-validate: - platform: '{platforms}' - template: '{templates}' + - packer-validate # publishers: # - ecomp-infra-shiplogs: |