-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
33 lines (33 loc) · 1.39 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
sudo: required
language: php
php:
- '7.1'
services:
- docker
before_install:
- openssl aes-256-cbc -K $encrypted_f817082538bd_key -iv $encrypted_f817082538bd_iv -in interact-fb342f8826c7.json.enc -out interact-fb342f8826c7.json -d
- if [ ! -d ${HOME}/google-cloud-sdk ]; then export CLOUDSDK_CORE_DISABLE_PROMPTS=1;
curl https://sdk.cloud.google.com | bash; fi
- source /home/travis/google-cloud-sdk/path.bash.inc
- gcloud components install kubectl
- gcloud auth activate-service-account --key-file=interact-fb342f8826c7.json
- gcloud config set project "$PROJECT_ID"
- gcloud config set container/use_client_certificate True
- gcloud container clusters get-credentials cluster-interact -z asia-east1-a
install:
- composer install
before_script: true
script: true
after_success:
- docker build -f Dockerfile -t "$DOCKER_USERNAME"/"$IMAGE_NAME":"$TRAVIS_BUILD_NUMBER"
.
- docker tag "$DOCKER_USERNAME"/"$IMAGE_NAME":"$TRAVIS_BUILD_NUMBER" "$DOCKER_USERNAME"/"$IMAGE_NAME":latest
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/"$IMAGE_NAME":"$TRAVIS_BUILD_NUMBER"
- docker push "$DOCKER_USERNAME"/"$IMAGE_NAME":latest
deploy:
provider: script
skip_cleanup: true
script: kubectl --namespace default patch deployment demo -p'{"spec":{"template":{"spec":{"containers":[{"name":"demo","image":"chaoexit/interact-demo:'$TRAVIS_BUILD_NUMBER'"}]}}}}'
on:
branch: master