This repository has been archived by the owner on Jun 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
/
.travis.yml
40 lines (35 loc) · 1.49 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
sudo: false
#add language, etc. here
cache:
directories:
- $HOME/gcloud/
env:
- PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json #Other environment variables on same line
before_install:
#ENCRYPT YOUR PRIVATE KEY (If you need authentication)
# 1. Install and login to the Travis CLI:
# $ gem install travis
# $ travis login
# 2. Move your json private key to client_secrets.json
# 3. Run:
# $ travis encrypt-file client_secrets.json --add
# 4. Commit changes:
# $ git add client_secrets.json.enc
# $ git commit client_secrets.json.enc .travis.yml
- if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then
mkdir -p $HOME/gcloud &&
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud &&
cd $HOME/gcloud &&
tar xzf google-cloud-sdk.tar.gz &&
printf '\ny\n\ny\ny\n' | ./google-cloud-sdk/install.sh &&
cd $TRAVIS_BUILD_DIR;
fi
- gcloud -q components update
- if [ -a client_secrets.json ]; then
gcloud -q auth activate-service-account --key-file client_secrets.json;
fi
install:
#Add app specific setup here
#Use '-q' to disable interactive prompts
script:
#Test and/or deploy your app with gcloud commands here!