diff options
author | Andrew Grimberg <agrimberg@linuxfoundation.org> | 2017-02-01 07:40:38 -0800 |
---|---|---|
committer | Andrew Grimberg <agrimberg@linuxfoundation.org> | 2017-02-01 07:40:38 -0800 |
commit | 54f23e3794287656af46319ec207e12b30beb51e (patch) | |
tree | 6e89c6783422b2b6fc059ba411022552eecec52a /jjb | |
parent | a3df1881110c7975b17ede3fbf9098a553c3a4e8 (diff) |
Move packer validate to an include-raw
Rather than deal with trying to properly escape curly-braces variables
in the shell script for the packer validate it's just easier to move
that out to a script to be included with no extra parsing
Change-Id: I15ccfceafef46f05d12ba5b4e5cf7b07d75ee40f
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/ci-management/ci-management-macros.yaml | 23 | ||||
-rw-r--r-- | jjb/ci-management/raw-include-packer-validate.sh | 19 |
2 files changed, 20 insertions, 22 deletions
diff --git a/jjb/ci-management/ci-management-macros.yaml b/jjb/ci-management/ci-management-macros.yaml index 648177345..e79cf8a23 100644 --- a/jjb/ci-management/ci-management-macros.yaml +++ b/jjb/ci-management/ci-management-macros.yaml @@ -7,28 +7,7 @@ files: - file-id: 'packer-cloud-env' variable: 'CLOUDENV' - # yamllint disable rule:line-length - - shell: | - cd packer - 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 \ - -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 + - shell: !include-raw: raw-include-packer-validate.sh - builder: name: packer-build diff --git a/jjb/ci-management/raw-include-packer-validate.sh b/jjb/ci-management/raw-include-packer-validate.sh new file mode 100644 index 000000000..01984dd7a --- /dev/null +++ b/jjb/ci-management/raw-include-packer-validate.sh @@ -0,0 +1,19 @@ +cd packer +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 \ + -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 |