-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
62 lines (55 loc) · 1.87 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
sudo: required
services:
- docker
language: python
rvm:
- 3.6.7
env:
global:
- DOCKER_COMPOSE_VERSION=3
- GOOGLE_APPLICATION_CREDENTIALS=~/client-secret.json
- PROJECT_PROD=utility-logic-238209
- CLUSTER=rts-cluster
- ZONE=europe-west3-a
- LOCAL_SCRIPT_IMAGE=rts_script:v0.1
- LOCAL_SITE_IMAGE=rts_site:v0.1
- SCRIPT_IMAGE=script
- SITE_IMAGE=site
- MONGO_IMAGE=mongo
- MQTT_IMAGE=eclipse-mosquitto
- SCRIPT_DEPLOYMENT=script-deploy
- SITE_DEPLOYMENT=site-deploy
- MONGO_DEPLOYMENT=db-deploy
- MQTT_DEPLOYMENT=mqtt-deploy
- SCRIPT_CONTAINER=script-container
- SITE_CONTAINER=site-container
- MONGO_CONTAINER=db-container
- MQTT_CONTAINER=mqtt-container
script:
- docker-compose up -d
- docker ps
after_success:
# [START auth]
# 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_6cbe24f4105f_key -iv $encrypted_6cbe24f4105f_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 rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; 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
# [END auth]
before_deploy:
- source /home/travis/google-cloud-sdk/path.bash.inc
- gcloud --quiet version
- gcloud --quiet components update
- gcloud --quiet components update kubectl
deploy:
- provider: script
script: chmod +x gcloud/deploy.sh && gcloud/deploy.sh
skip_cleanup: true
on:
all_branches: true
after_script:
- docker-compose stop
- docker-compose rm -f