X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=.jjb-test%2Fexpected-xml%2Fgerrit-ciman-packer-merge-centos-java-builder;h=a6cdee4698654f5102e427b4a0123b8e24ec9837;hb=8cc91c0eadaa2b39f54fc5d679b0ea70aae13627;hp=33f7fa442930196f619d453eeaec10c2aa115065;hpb=f1d2d262e4e1b095c2d2c577c042404f1f3d4e1c;p=releng%2Fglobal-jjb.git diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder index 33f7fa44..a6cdee46 100644 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder +++ b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder @@ -76,7 +76,7 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'. PACKER_VERSION Packer version to download and install. - 1.1.1 + 1.1.3 @@ -151,7 +151,11 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'. ANT - packer/provision/java-builder.sh + packer/provision/*.sh + + + ANT + packer/provision/java-builder.yaml ANT @@ -205,7 +209,7 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'. - PACKER_VERSION=1.1.1 + PACKER_VERSION=1.1.3 @@ -226,7 +230,7 @@ echo "---> packer-install.sh" # $PACKER_VERSION : Define a packer version passed as job paramter -PACKER_VERSION="${PACKER_VERSION:-1.0.2}" +PACKER_VERSION="${PACKER_VERSION:-1.1.3}" # Ensure we fail the job if any steps fail. set -eu -o pipefail @@ -268,17 +272,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 @@ -315,7 +327,7 @@ exit 0 PACKER_PLATFORM=centos PACKER_TEMPLATE=java-builder -PACKER_VERSION=1.1.1 +PACKER_VERSION=1.1.3 @@ -336,7 +348,7 @@ echo "---> packer-install.sh" # $PACKER_VERSION : Define a packer version passed as job paramter -PACKER_VERSION="${PACKER_VERSION:-1.0.2}" +PACKER_VERSION="${PACKER_VERSION:-1.1.3}" # Ensure we fail the job if any steps fail. set -eu -o pipefail @@ -388,7 +400,7 @@ export PACKER_LOG_PATH="$PACKER_BUILD_LOG" && \ "../packer/templates/$PACKER_TEMPLATE.json" # Retrive the list of cloud providers -clouds=($(jq -r '.builders[].name' "../packer/templates/$PACKER_TEMPLATE.json")) +mapfile -t clouds < <(jq -r '.builders[].name' "../packer/templates/$PACKER_TEMPLATE.json") # Split public/private clouds logs for cloud in "${clouds[@]}"; do @@ -455,9 +467,9 @@ SAR_DIR="$WORKSPACE/archives/sar-reports" mkdir -p "$SAR_DIR" cp "$SYSSTAT_PATH/"* "$_" # convert sar data to ascii format -while IFS="" read -r s +while IFS="" read -r sarfilenum do - [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}" + [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true) # DON'T fail build if script fails.