-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
30 lines (28 loc) · 1.19 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
language: python
python:
- "2.7"
env:
global:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
jobs:
include:
- stage: build and push docker image
script:
- export IMAGE_TAG=$(echo "$TRAVIS_COMMIT" | head -c7)
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- make build tag=$IMAGE_TAG
- make push
- stage: deploy production
install:
- export IMAGE_TAG=$(echo "$TRAVIS_COMMIT" | head -c7)
- echo "$SERVICE_ACCOUNT_KEY" | base64 --decode > ${HOME}/service-account-key.json
- curl https://sdk.cloud.google.com | bash > /dev/null
- source $HOME/google-cloud-sdk/path.bash.inc
- gcloud components install kubectl
- gcloud auth activate-service-account $SERVICE_ACCOUNT --key-file=${HOME}/service-account-key.json
- gcloud container clusters get-credentials prod --project $PROJECT --zone $ZONE
- kubectl config set-context --current --namespace=production
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- helm version
script:
- helm upgrade maps-n-magic helm/maps-n-magic/ --wait --set image.tag=$IMAGE_TAG