X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;ds=inline;f=.jjb-test%2Fexpected-xml%2Fgerrit-ciman-packer-merge-ubuntu1604-mininet;h=052561cb049c9abba1b3b1c2e955577c6c3be80a;hb=8bacaf67000180245721363de6f699c32ee5da35;hp=305d010a10522a792b07430ec4ee538e8d63b07e;hpb=8cc91c0eadaa2b39f54fc5d679b0ea70aae13627;p=releng%2Fglobal-jjb.git
diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet
index 305d010a..052561cb 100644
--- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet
+++ b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet
@@ -96,28 +96,22 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'.
refs/heads/$GERRIT_BRANCH
-
-
false
- false
- true
- false
false
Default
-
- true
-
- false
- false
+
+
+
false
true
false
+ false
10
@@ -240,12 +234,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
@@ -277,8 +271,9 @@ 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
+ # CLOUDENV variable so skip it here. Also handle the case where a project
+ # has not vars/*.json file.
+ if [[ "$varfile" == *"cloud-env.json"* ]] || [[ "$varfile" == 'vars/*.json' ]]; then
continue
fi
@@ -358,12 +353,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
@@ -391,16 +386,22 @@ PACKER_BUILD_LOG="$PACKER_LOGS_DIR/packer-build.log"
mkdir -p "$PACKER_LOGS_DIR"
export PATH="${WORKSPACE}/bin:$PATH"
+# Prioritize the project's own version of vars if available
+platform_file="common-packer/vars/$PACKER_PLATFORM.json"
+if [ -f "$PACKER_PLATFORM" ]; then
+ platform_file="vars/$PACKER_PLATFORM.json"
+fi
+
cd packer
-export PACKER_LOG="yes" && \
-export PACKER_LOG_PATH="$PACKER_BUILD_LOG" && \
- packer.io build -color=false \
- -var-file="$CLOUDENV" \
- -var-file="../packer/vars/$PACKER_PLATFORM.json" \
- "../packer/templates/$PACKER_TEMPLATE.json"
+export PACKER_LOG="yes"
+export PACKER_LOG_PATH="$PACKER_BUILD_LOG"
+packer.io build -color=false \
+ -var-file="$CLOUDENV" \
+ -var-file="$platform_file" \
+ "templates/$PACKER_TEMPLATE.json"
# Retrive the list of cloud providers
-mapfile -t clouds < <(jq -r '.builders[].name' "../packer/templates/$PACKER_TEMPLATE.json")
+mapfile -t clouds < <(jq -r '.builders[].name' "templates/$PACKER_TEMPLATE.json")
# Split public/private clouds logs
for cloud in "${clouds[@]}"; do
@@ -691,7 +692,7 @@ rm ~/.netrc
- 45
+ 90
BUILD_TIMEOUT
true
false