-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
39 lines (33 loc) · 1.29 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
sudo: required
language: node_js
node_js:
- "node"
services:
- docker
env:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
- curl https://sdk.cloud.google.com | bash
- bash -l ./.gcloud version
- bash -l ./.gcloud components update kubectl -q
install: npm install
script:
- npm run build
after_success:
- export REPO="us.gcr.io/brave-reason-142805/blogui"
- export V="$TRAVIS_COMMIT"
- export PATH=$PATH:/usr/local/share/google/google-cloud-sdk/bin/
- export GOOGLE_APPLICATION_CREDENTIALS="./keyfile.json"
- echo "building version $V"
- touch keyfile.json
- echo $SERVICE_KEY > keyfile.json
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p "$(cat keyfile.json)" $REPO
- docker build -f Dockerfile -t $REPO:$V .
- docker images
- bash -l ./.gcloud docker --authorize-only
- docker push $REPO:$V
- bash -l ./.gcloud auth activate-service-account --key-file keyfile.json
- bash -l ./.gcloud container clusters get-credentials blogui-1 --zone us-central1-b --project brave-reason-142805
- bash -l ./.gcloud config set container/use_client_certificate True
- bash -l ./.kubectl config set-credentials --password="$KUB_PASS" --username="$KUB_USER"
- bash -l ./.kubectl set image deployment/blogui-1 blogui-1=$REPO:$V