Skip to content

Commit 76877fd

Browse files
committed
Add basic .travis.yml with gcloud instructions
1 parent 1390c71 commit 76877fd

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.travis.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
sudo: false
2+
#add language, etc. here
3+
4+
cache:
5+
directories:
6+
- $HOME/gcloud/
7+
env:
8+
- GCLOUD=$HOME/gcloud/google-cloud-sdk/bin CLOUDSDK_PYTHON_SITEPACKAGES=1 GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json
9+
10+
before_install:
11+
#ENCRYPT YOUR PRIVATE KEY
12+
# 1. Install and login to the Travis CLI:
13+
# $ gem install travis
14+
# $ travis login
15+
# 2. Move your json private key to client_secrets.json
16+
# 3. Run:
17+
# $ travis encrypt-file client_secrets.json --add
18+
# 4. Commit changes:
19+
# $ git add client_secrets.json.enc
20+
# $ git commit client_secrets.json.enc .travis.yml
21+
22+
- if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then
23+
mkdir -p $HOME/gcloud &&
24+
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud &&
25+
cd $HOME/gcloud &&
26+
tar xzf google-cloud-sdk.tar.gz &&
27+
printf '\ny\n\ny\ny\n' | ./google-cloud-sdk/install.sh &&
28+
cd $TRAVIS_BUILD_DIR;
29+
fi
30+
- printf 'y\n' | $GCLOUD/gcloud components update
31+
- gcloud auth activate-service-account --key-file client_secrets.json
32+
33+
install:
34+
#Add app specific setup here
35+
36+
script:
37+
#Test and/or deploy your app with gcloud commands here!

0 commit comments

Comments
 (0)