github.com/googlecloudplatform/kubernetes-workshops@v0.0.0-20180501174420-d8199445b2c3/.travis.yml (about) 1 # Copyright 2015 Google, Inc 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 language: go 16 17 cache: 18 directories: 19 - $HOME/gcloud/ 20 21 env: 22 - PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin 23 GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json 24 25 before_install: 26 - openssl aes-256-cbc -K $encrypted_b00a0afd0ebd_key -iv $encrypted_b00a0afd0ebd_iv -in client_secrets.json.enc -out $GOOGLE_APPLICATION_CREDENTIALS -d 27 - if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then 28 mkdir -p $HOME/gcloud && 29 wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud && 30 cd $HOME/gcloud && 31 tar xzf google-cloud-sdk.tar.gz && 32 printf '\ny\n\ny\ny\n' | ./google-cloud-sdk/install.sh && 33 cd $TRAVIS_BUILD_DIR; 34 fi 35 - gcloud -q components update 36 - if [ -a $GOOGLE_APPLICATION_CREDENTIALS ]; then 37 gcloud -q auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS; 38 fi 39 - gcloud -q components install kubectl 40 - gcloud -q config set project cloud-samples-tests 41 - gcloud -q config set compute/zone us-central1-c 42 43 install: true 44 45 before_script: 46 - gcloud -q container clusters create --num-nodes 2 kubernetes-workshops 47 48 script: 49 - travis_wait 45 go test -v -timeout 44m ./test 50 51 after_script: 52 - gcloud -q container clusters delete kubernetes-workshops