-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
74 lines (73 loc) · 2.84 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
sudo: required
services:
- docker
env:
global:
# Ensure the install happens without prompts
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
language: node_js
node_js:
- '6'
before_install:
- echo "Cloudboost Docs"
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- sudo mv ./kubectl /usr/local/bin/kubectl
install:
- sudo apt-get update
- sudo apt-get install curl libc6 libcurl3 zlib1g
- npm install
after_success:
# Build Docker Images
- docker build -t cloudboost/docs:2.0.$TRAVIS_BUILD_NUMBER .
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker build -t cloudboost/docs:latest .;
fi
# Docker Deploy for staging builds
- if [ "$TRAVIS_BRANCH" == "staging" ]; then
docker build -t cloudboost/docs:staging .;
docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL;
docker push cloudboost/docs:staging;
git clone https://github.com/CloudBoost/kube-cred.git;
cd kube-cred;
openssl enc -in config.enc -out config -d -aes256 -k $KUBE_ENC;
mkdir ~/.kube;
mv config ~/.kube/;
kubectl rolling-update cloudboost-docs-staging --image=cloudboost/docs:staging --image-pull-policy=Always;
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/""$cloudflare_zone""/purge_cache" -H "X-Auth-Email:[email protected]" -H "X-Auth-Key:""$cloud_flare_key" -H "Content-Type:application/json" --data "{'purge_everything':true}";
fi
before_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- export GIT_TAG=2.0.$TRAVIS_BUILD_NUMBER
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
- git push -q https://[email protected]/CloudBoost/docs --tags
- ls -R
deploy:
provider: releases
api_key: $GH_TOKEN
file: "README.md"
skip_cleanup: true
on:
tags: false
branch: master
after_deploy:
# Docker Deploy.
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL;
docker push cloudboost/docs:2.0.$TRAVIS_BUILD_NUMBER;
docker push cloudboost/docs:latest;
git clone https://github.com/CloudBoost/kube-cred.git;
cd kube-cred;
openssl enc -in config.enc -out config -d -aes256 -k $KUBE_ENC;
mkdir ~/.kube;
mv config ~/.kube/;
kubectl rolling-update cloudboost-docs --image=cloudboost/docs:latest --image-pull-policy=Always;
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/""$cloudflare_zone""/purge_cache" -H "X-Auth-Email:[email protected]" -H "X-Auth-Key:""$cloud_flare_key" -H "Content-Type:application/json" --data "{'purge_everything':true}";
fi
branches:
except:
- /^*-v[0-9]/
#Notify Team on Slack
notifications:
slack: cloudboost:gm7nWJDLDtBRyF75VKLKOoMW