Skip to content

Commit

Permalink
Set GOPATH in library.sh if unset (knative#130)
Browse files Browse the repository at this point in the history
1. For convenience.
2. To avoid this pattern being replicatd unnecessarily across all repos and scripts.
  • Loading branch information
adrcunha authored and knative-prow-robot committed Sep 18, 2018
1 parent 1d02e42 commit 9914e68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions scripts/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ function download_k8s() {
return 1
fi
# Download k8s to staging dir
if [[ -z "${GOPATH}" ]]; then
local GOPATH=$(go env GOPATH)
fi
version=v${version}
local staging_dir=${GOPATH}/src/k8s.io/kubernetes/_output/gcs-stage
rm -fr ${staging_dir}
Expand Down
8 changes: 8 additions & 0 deletions scripts/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ readonly KNATIVE_SERVING_RELEASE=https://storage.googleapis.com/knative-releases
readonly KNATIVE_BUILD_RELEASE=https://storage.googleapis.com/knative-releases/build/latest/release.yaml
readonly KNATIVE_EVENTING_RELEASE=https://storage.googleapis.com/knative-releases/eventing/latest/release.yaml

# Conveniently set GOPATH if unset
if [[ -z "${GOPATH:-}" ]]; then
export GOPATH="$(go env GOPATH)"
if [[ -z "${GOPATH}" ]]; then
echo "WARNING: GOPATH not set and go binary unable to provide it"
fi
fi

# Useful environment variables
[[ -n "${PROW_JOB_ID:-}" ]] && IS_PROW=1 || IS_PROW=0
readonly IS_PROW
Expand Down

0 comments on commit 9914e68

Please sign in to comment.