-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
37 lines (34 loc) · 1.36 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
language: go
go:
- "1.13"
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
- make build-test tag=$IMAGE_TAG
- make push-test
- 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
script:
- kubectl set image deployment/gateway gateway=sr2020/eva-gateway:$IMAGE_TAG --record
- kubectl rollout status deployment/gateway
- kubectl set image deployment/convey convey=sr2020/eva-gateway-test:$IMAGE_TAG --record
- kubectl rollout status deployment/convey
- stage: test production
script:
- make test env=production