Skip to content

Commit c34a621

Browse files
tests: fix environment test issues (#181)
1 parent bf8e2b8 commit c34a621

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.kokoro/environment_tests.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
4343
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
4444
gcloud config set project $PROJECT_ID
4545

46+
# set a default zone.
47+
gcloud config set compute/zone us-central1-b
48+
4649
# authenticate docker
4750
gcloud auth configure-docker -q
4851

@@ -53,6 +56,15 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
5356
python3.6 -m pip install --upgrade --quiet nox
5457
python3.6 -m nox --version
5558

59+
# Install kubectl
60+
if [[ "${ENVIRONMENT}" == "kubernetes" ]]; then
61+
curl -LO https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectl
62+
chmod +x kubectl
63+
mkdir -p ~/.local/bin
64+
mv ./kubectl ~/.local/bin
65+
export PATH=$PATH:~/.local/bin
66+
fi
67+
5668
# create a unique id for this run
5769
UUID=$(python -c 'import uuid; print(uuid.uuid1())' | head -c 7)
5870
export ENVCTL_ID=ci-$UUID

0 commit comments

Comments
 (0)