-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
47 lines (41 loc) · 1.53 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
41
42
43
44
45
46
47
language: python
python:
- 2.7
sudo: false
# # Cache our Gcloud SDK between commands
# cache:
# directories:
# - $HOME/google-cloud-sdk/
env:
- GAE_PYTHONPATH=${HOME}/.cache/google_appengine PATH=$PATH:${HOME}/google-cloud-sdk/bin
PYTHONPATH=${PYTHONPATH}:${GAE_PYTHONPATH} CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
# Install Google App Engine Python SDK
# - if [ ! -d "${GAE_PYTHONPATH}" ]; then
# - python scripts/fetch_gae_sdk.py $(dirname "${GAE_PYTHONPATH}");
# fi
# decrypt credentials
- openssl aes-256-cbc -K $encrypted_2cb3533d089c_key -iv $encrypted_2cb3533d089c_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}/google-cloud-sdk ]; then
curl https://sdk.cloud.google.com | bash;
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 client-secret.json
install:
- gcloud config set project geoscixyz
- gcloud -q components update gae-python
- pip install -r requirements.txt -t lib/
# Deploy the app
script:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
if [ ! -d ${HOME}/google-cloud-sdk ]; then
curl https://sdk.cloud.google.com | bash;
fi ;
gcloud -q app deploy ./geoscixyz/app.yaml --version ${TRAVIS_COMMIT} --promote ;
fi
- exit 0
notifications:
slack: ubcgif:1Z2lR3XYRSM3GHflG71ZHEN6