Skip to content

Commit

Permalink
Merge pull request #11941 from ilya-zuyev/ilyaz/fix_arm_tests
Browse files Browse the repository at this point in the history
minor fixes in common.sh
  • Loading branch information
ilya-zuyev authored Jul 13, 2021
2 parents 4c66799 + 92604a3 commit e27dba4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ else
fi

# installing golang so we could do go get for gopogh
sudo ARCH="$ARCH"./installers/check_install_golang.sh "1.16.4" "/usr/local" || true
./installers/check_install_golang.sh "1.16.4" "/usr/local" || true

# install docker and kubectl if not present
sudo ARCH="$ARCH" ./installers/check_install_docker.sh || true
Expand Down Expand Up @@ -444,11 +444,11 @@ if [ -z "${EXTERNAL}" ]; then
echo ">> public URL: ${REPORT_URL_BASE}/${JOB_GCS_BUCKET}.json"
gsutil -qm cp "${JSON_OUT}" "gs://${JOB_GCS_BUCKET}.json" || true

echo ">> uploading ${HTML_OUT} to ${REPORT_URL_BASE}/${JOB_GCS_BUCKET}.html"
echo ">> uploading ${HTML_OUT} to gs://${JOB_GCS_BUCKET}.html"
echo ">> public URL: ${REPORT_URL_BASE}/${JOB_GCS_BUCKET}.html"
gsutil -qm cp "${HTML_OUT}" "gs://${JOB_GCS_BUCKET}.html" || true

echo ">> uploading ${SUMMARY_OUT} to ${REPORT_URL_BASE}/${JOB_GCS_BUCKET}_summary.json"
echo ">> uploading ${SUMMARY_OUT} to gs://${JOB_GCS_BUCKET}_summary.json"
echo ">> public URL: ${REPORT_URL_BASE}/${JOB_GCS_BUCKET}_summary.json"
gsutil -qm cp "${SUMMARY_OUT}" "gs://${JOB_GCS_BUCKET}_summary.json" || true
else
Expand Down
20 changes: 14 additions & 6 deletions hack/jenkins/installers/check_install_golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,28 @@ function check_and_install_golang() {

# install_golang takes two parameters version and path to install.
function install_golang() {
echo "Installing golang version: $1 on $2"
pushd /tmp >/dev/null
local -r GO_VER="$1"
local -r GO_DIR="$2/go"
echo "Installing golang version: $GO_VER in $GO_DIR"

INSTALLOS=linux
if [[ "$OSTYPE" == "darwin"* ]]; then
INSTALLOS=darwin
fi

local -r GO_TGZ="go${GO_VER}.${INSTALLOS}-${ARCH}.tar.gz"
pushd /tmp

# using sudo because previously installed versions might have been installed by a different user.
# as it was the case on jenkins VM.
sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.${INSTALLOS}-${ARCH}.tar.gz" &&
sudo tar -xzf go${1}.${INSTALLOS}-${ARCH}.tar.gz &&
sudo rm -rf "${2}/go" &&
sudo mv go "${2}/" && sudo chown -R $(whoami): ${2}/go
sudo rm -rf "$GO_TGZ"
curl -qL -O "https://storage.googleapis.com/golang/$GO_TGZ"
sudo rm -rf "$GO_DIR"
sudo mkdir -p "$GO_DIR"
sudo tar -C "$GO_DIR" --strip-components=1 -xzf "$GO_TGZ"

popd >/dev/null
echo "installed in $GO_DIR: $($GO_DIR/bin/go version)"
}

check_and_install_golang

0 comments on commit e27dba4

Please sign in to comment.