-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
45 lines (38 loc) · 1.28 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
language: generic
cache:
directories:
- "$HOME/google-cloud-sdk/"
dist: trusty
# Set env vars
env:
global:
- GOOGLE_APPLICATION_CREDENTIALS=~/gcloud-service-key.json
- PROJECT_NAME_PRD=glowing-thunder-215513
- CLUSTER_NAME_PRD=siwecoscluster
- CLOUDSDK_COMPUTE_ZONE=europe-west1-b
jobs:
include:
- stage: build docker image
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t "$DOCKER_IMAGE" . --no-cache
- docker images
- docker tag "$DOCKER_IMAGE" "$DOCKER_REPO"/"$DOCKER_IMAGE":"$TRAVIS_BRANCH"
- docker push "$DOCKER_REPO"/"$DOCKER_IMAGE":"$TRAVIS_BRANCH"
before_deploy:
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
- 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 deploy-master.sh && ./deploy-master.sh
skip_cleanup: true
on:
branch: master
- provider: script
script: chmod +x deploy-staging.sh && ./deploy-staging.sh
skip_cleanup: true
on:
branch: develop