From: Anil Belur Date: Fri, 18 Aug 2017 23:03:11 +0000 (+1000) Subject: Dont prefix PATH with hash built-in command. X-Git-Tag: v0.8.0~8 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=441d8bb3f89af4508101bc555887bd0b81e2f078;p=releng%2Fglobal-jjb.git Dont prefix PATH with hash built-in command. The changes are tested with the below job https://jenkins.hyperledger.org/job/ci-management-packer-verify/4/console Also supress wget verbose output. Jira: releng-442 Change-Id: Icab1214c19e68346a84c37179a1d8c1540ffc657 Signed-off-by: Anil Belur --- 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 0565e3cb..132f7c47 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 @@ -230,16 +230,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -342,16 +340,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet index 1bcd1550..2bcf227e 100644 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet +++ b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet @@ -230,16 +230,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -342,16 +340,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder index 7cf25b58..04df7b7f 100644 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder +++ b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder @@ -230,16 +230,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -342,16 +340,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib 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 73c50d51..9bd47daf 100644 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet +++ b/.jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet @@ -230,16 +230,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -342,16 +340,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/gerrit-ciman-packer-verify b/.jjb-test/expected-xml/gerrit-ciman-packer-verify index 04a3f527..89cec33f 100644 --- a/.jjb-test/expected-xml/gerrit-ciman-packer-verify +++ b/.jjb-test/expected-xml/gerrit-ciman-packer-verify @@ -232,16 +232,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder b/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder index 38be9216..dc166149 100644 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder +++ b/.jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder @@ -188,16 +188,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -300,16 +298,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet b/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet index 9fb389f4..c8818073 100644 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet +++ b/.jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet @@ -188,16 +188,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -300,16 +298,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder b/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder index d7df7956..96de23f0 100644 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder +++ b/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder @@ -188,16 +188,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -300,16 +298,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet b/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet index fe4bb8a6..201210c1 100644 --- a/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet +++ b/.jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet @@ -188,16 +188,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib @@ -300,16 +298,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/.jjb-test/expected-xml/github-ciman-packer-verify b/.jjb-test/expected-xml/github-ciman-packer-verify index 6e84f2b7..d78d897f 100644 --- a/.jjb-test/expected-xml/github-ciman-packer-verify +++ b/.jjb-test/expected-xml/github-ciman-packer-verify @@ -176,16 +176,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib diff --git a/shell/packer-install.sh b/shell/packer-install.sh index eb303f6e..d7af2822 100644 --- a/shell/packer-install.sh +++ b/shell/packer-install.sh @@ -18,16 +18,14 @@ PACKER_VERSION="${PACKER_VERSION:-1.0.2}" # Ensure we fail the job if any steps fail. set -eu -o pipefail -# Default packer binary made available on the build image -packer_bin="/usr/local/bin/packer.io" -if hash "$packer_bin" 2>/dev/null; then +if hash packer.io 2>/dev/null; then echo "packer.io command is available." else echo "packer.io command not is available. Installing packer ..." # Installs Hashicorp's Packer binary, required for verify & merge packer jobs pushd packer - wget "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" + 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/ # rename packer to avoid conflict with binary in cracklib