X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=.jjb-test%2Fexpected-xml%2Fgithub-ciman-packer-verify;h=fd1dcb34d124a4c88c8a714da38ad8ed218aef2e;hb=refs%2Fchanges%2F89%2F8389%2F1;hp=532b24bcf33fd5f7451bdc2ce5c491b87e106693;hpb=743eab353a2412ea2b52d7555bf50b1f95041ba3;p=releng%2Fglobal-jjb.git diff --git a/.jjb-test/expected-xml/github-ciman-packer-verify b/.jjb-test/expected-xml/github-ciman-packer-verify index 532b24bc..fd1dcb34 100644 --- a/.jjb-test/expected-xml/github-ciman-packer-verify +++ b/.jjb-test/expected-xml/github-ciman-packer-verify @@ -9,8 +9,9 @@ build-vm false - + https://github.com/example-org/releng/ciman + @@ -91,28 +92,22 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'. $sha1 - - false - false - true - false false Default - - true - - false - false + + + false true false + false 10 @@ -126,8 +121,11 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'. false + + ^recheck$ + false true true @@ -182,12 +180,12 @@ if hash packer.io 2>/dev/null; then else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs - pushd packer + pushd "${WORKSPACE}" wget -nv "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" mkdir -p "${WORKSPACE}/bin" - unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d ${WORKSPACE}/bin/ + unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d "${WORKSPACE}/bin/" # rename packer to avoid conflict with binary in cracklib - mv ${WORKSPACE}/bin/packer "${WORKSPACE}/bin/packer.io" + mv "${WORKSPACE}/bin/packer" "${WORKSPACE}/bin/packer.io" popd fi @@ -214,17 +212,25 @@ mkdir -p "$PACKER_LOGS_DIR" export PATH="${WORKSPACE}/bin:$PATH" cd packer -varfiles=(../packer/vars/*.json) -templates=(../packer/templates/*.json) +varfiles=(vars/*.json common-packer/vars/*.json) +templates=(templates/*.json) for varfile in "${varfiles[@]}"; do + # cloud-env.json is a file containing credentials which is pulled in via + # CLOUDENV variable so skip it here. + if [[ "$varfile" == *"cloud-env.json"* ]]; then + continue + fi + + echo "-----> Testing varfile: $varfile" for template in "${templates[@]}"; do - export PACKER_LOG="yes" && \ - export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" && \ - packer.io validate -var-file="$CLOUDENV" \ - -var-file="$varfile" "$template" - if [ $? -ne 0 ]; then - break + export PACKER_LOG="yes" + export PACKER_LOG_PATH="$PACKER_LOGS_DIR/packer-validate-${varfile##*/}-${template##*/}.log" + if output=$(packer.io validate -var-file="$CLOUDENV" -var-file="$varfile" "$template"); then + echo "$template: $output" + else + echo "$template: $output" + exit 1 fi done done