forked from GoogleCloudPlatform/pubsub-shout-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
34 lines (34 loc) · 1.61 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
# Use Dockerized infrastructure
sudo: false
language: python
# Cache our gcloud SDK between commands
cache:
directories:
- "$HOME/gcloud/"
env:
# Make sure gcloud command is on our PATH and the App Engine SDK is in the Python path
- PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin PYTHONPATH=${HOME}/gcloud/google-cloud-sdk/platform/google_appengine
before_install:
# Decrypt the credentials we added to the repo using the key we added with the Travis command line tool
- openssl aes-256-cbc -K $encrypted_f04cb9432369_key -iv $encrypted_f04cb9432369_iv -in credentials.tar.gz.enc -out credentials.tar.gz -d
# If the SDK is not already cached, download it and unpack it
- 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
- tar -xzf credentials.tar.gz
- mkdir -p lib
# Here we use the decrypted service account credentials to authenticate the command line tool
- gcloud auth activate-service-account --key-file shout7q-346edad20ace.json
install:
# Set the correct project to deploy to
- gcloud config set project ${GOOGLE_APP_ID}
# Install the AppEngine SDK
- gcloud -q components update gae-python
- pip install -r appengine-python-flask/requirements.txt -t appengine-python-flask/lib/
script:
# Deploy the app
- gcloud -q preview app deploy appengine-python-flask/app.yaml --version ${GOOGLE_APP_VERSION}
# Run an end to end test
- python api_test.py
- phantomjs test.js