<name>refs/heads/$GERRIT_BRANCH</name>
</hudson.plugins.git.BranchSpec>
</branches>
- <excludedUsers/>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
- <authorOrCommitter>false</authorOrCommitter>
- <wipeOutWorkspace>true</wipeOutWorkspace>
- <pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
- <relativeTargetDir/>
<reference/>
<gitConfigName/>
<gitConfigEmail/>
- <skipTag>true</skipTag>
- <scmName/>
- <useShallowClone>false</useShallowClone>
- <ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions>
+ <hudson.plugins.git.extensions.impl.BuildChooserSetting>
+ <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
+ </hudson.plugins.git.extensions.impl.BuildChooserSetting>
<hudson.plugins.git.extensions.impl.SubmoduleOption>
<disableSubmodules>false</disableSubmodules>
<recursiveSubmodules>true</recursiveSubmodules>
<trackingSubmodules>false</trackingSubmodules>
+ <parentCredentials>false</parentCredentials>
<reference/>
<timeout>10</timeout>
</hudson.plugins.git.extensions.impl.SubmoduleOption>
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
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
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.