-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.travis.yml
46 lines (45 loc) · 1.59 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
sudo: required
services:
- docker
env:
global:
# Ensure the downloaded SDK is first on the PATH
- PATH=${HOME}/google-cloud-sdk/bin:$PATH
# Ensure the install happens without prompts
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
language: node_js
node_js:
- '6'
before_install:
- npm install grunt-cli -g
- npm install -g bower
install:
- npm install
- bower install
- docker build -t cloudboost/dashboard:2.0.$TRAVIS_BUILD_NUMBER .
- docker build -t cloudboost/dashboard:latest .
after_success:
#Deploy.
#Docker Login
- openssl aes-256-cbc -K $encrypted_77038e8a6e7c_key -iv $encrypted_77038e8a6e7c_iv -in credentials.tar.enc -out credentials.tar -d
- tar -xvf credentials.tar
- docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL
# Make sure SDK is downloaded - cache once it's working
- curl https://sdk.cloud.google.com | bash;
# List the SDK contents to ensure it's downloaded
- ls -l ${HOME}/google-cloud-sdk/bin
# Ensure the correct gcloud is being used
- which gcloud
# Print the gcloud version and make sure it's something
- gcloud --version
- ls
#Activate Google Cloud SDK with your project
- gcloud auth activate-service-account --key-file gc_cred.json
#Install Kubectl
- gcloud components install kubectl
- gcloud container clusters get-credentials $GOOGLECLUSTERNAME --zone $GOOGLEZONE --project $GOOGLEPROJECT
#Push docker images.
- docker push cloudboost/dashboard:2.0.$TRAVIS_BUILD_NUMBER
- docker push cloudboost/dashboard:latest
#Upload to Kubernetes for deployment.
- kubectl rolling-update cloudboost-dashboard --image=cloudboost/dashboard:2.0.$TRAVIS_BUILD_NUMBER