-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml.temp
50 lines (47 loc) · 2.08 KB
/
.travis.yml.temp
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
language: go
go:
- "1.13"
env:
global:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
jobs:
include:
- stage: build and push docker image
script:
- touch .env
- 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-nginx tag=$IMAGE_TAG
- make push-nginx
- 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 gateway-new helm/gateway/ --wait --set image.gateway.tag=$IMAGE_TAG --set image.nginx.tag=$IMAGE_TAG
- stage: test 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:
- cp .env.test .env
- export JWT_SECRET=$(kubectl get secret web2 -o jsonpath="{.data.jwtSecret}" | base64 --decode)
- echo "JWT_SECRET=$JWT_SECRET" >> .env
- make test-services
- make test-main