-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
36 lines (36 loc) · 1.58 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
sudo: required
language: node_js
services:
- docker
node_js:
- '7.8'
install:
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update && sudo apt-get install yarn
- yarn
after_success:
- yarn build
- 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 apollo -p'{"spec":{"template":{"spec":{"containers":[{"name":"apollo","image":"chinclubi/apollo:'$TRAVIS_BUILD_NUMBER'"}]}}}}'
on:
branch: master
before_install:
- openssl aes-256-cbc -K $encrypted_02a30cc79da2_key -iv $encrypted_02a30cc79da2_iv
-in interact-4a4118c938d7.json.enc -out interact-4a4118c938d7.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-4a4118c938d7.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