Don't run tests requiring secrets for external PRs
Fixes
@@ -6,22 +6,33 @@ sudo: true # give us 7.5GB and >2 bursted cores.
git:
depth: false
before_install:
- - openssl aes-256-cbc -K $encrypted_095ae97b50fd_key -iv $encrypted_095ae97b50fd_iv
- -in credentials.tar.gz.enc -out credentials.tar.gz -d
- - tar -xzf credentials.tar.gz
+ - export IS_EXTERNAL_PR=""
+ - if [ "$TRAVIS_SECURE_ENV_VARS" = "false" ]; then
+ IS_EXTERNAL_PR="true";
+ fi
- # Install and log into gcloud so that we can access the GKE CI cluster.
+ # Install gcloud CLI.
- if [ ! -d ${HOME}/google-cloud-sdk ]; then
curl https://sdk.cloud.google.com > gcloud-install.sh;
chmod a+x ./gcloud-install.sh;
./gcloud-install.sh --disable-prompts;
fi
- - gcloud auth activate-service-account --key-file client-secret.json
- - export GOOGLE_APPLICATION_CREDENTIALS="$(pwd)/client-secret.json"
- # Put kubeconfig file in the usual place. The test harness picks this up and refers to it as
- # $KUBERNETES_CONTEXT.
- - mkdir ~/.kube && mv ./kubeconfig.yaml ~/.kube/config
+ # 1. Log in to gcloud using the CI GCP service account.
+ # 2. Set up kubeconfig file so the integration tests can run.
+ #
+ # NOTE: External PRs can't run integration tests because Travis CI doesn't supply them in
+ # this case. Hence, here we simply disable them.
+ - if [ "$IS_EXTERNAL_PR" != "true" ]; then
+ openssl aes-256-cbc -K $encrypted_095ae97b50fd_key -iv $encrypted_095ae97b50fd_iv
+ -in credentials.tar.gz.enc -out credentials.tar.gz -d;
+ tar -xzf credentials.tar.gz;
+
+ gcloud auth activate-service-account --key-file client-secret.json;
+ export GOOGLE_APPLICATION_CREDENTIALS="$(pwd)/client-secret.json";
+
+ mkdir ~/.kube && mv ./kubeconfig.yaml ~/.kube/config;
+ fi
# Install istioctl for the Istio integration tests.
- curl -sL https://github.com/istio/istio/releases/download/1.0.1/istio-1.0.1-linux.tar.gz > istio.tar.gz
