-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (55 loc) · 2.09 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
46
47
48
49
50
51
52
53
54
55
dist: xenial
language: node_js
node_js:
- '10'
sudo: false
services:
- docker
branches:
only:
- master
- development
- dev2
cache:
directories:
- "$HOME/google-cloud-sdk/"
before_install:
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_3baafb376ae6_key -iv $encrypted_3baafb376ae6_iv -in credentials.tar.gz.enc -out credentials.tar.gz -d; fi
# Create environment variable for correct distribution
- export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
# Add the Cloud SDK distribution URI as a package source
- echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Import the Google Cloud Platform public key
- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Update the package list and install the Cloud SDK
- sudo apt-get update && sudo apt-get install google-cloud-sdk kubectl
- gcloud --quiet version
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
tar -xzf credentials.tar.gz;
fi
- mkdir -p lib
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
gcloud auth activate-service-account --key-file client-secret.json;
fi
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -yq --force-yes -o Dpkg::Options::="--force-confold" install docker-ce
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
jobs:
include:
- stage: deploy-dev
if: "(NOT type IN (pull_request) AND (branch = development))"
before_install:
- git submodule update --init --recursive
install:
- npm install
- cd kauri-ops
- source env_setup.sh --config-file config/config-dev.json
script:
- bash ./build-docker-image.sh 0.0.1
- bash ./k8s/redeploy-k8s.sh 0.0.1