forked from CloudBoost/cloudboost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
80 lines (80 loc) · 3.1 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
74
75
76
77
78
79
80
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:
- 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
- docker run --name mongo -p 27017:27017 -d mongo:3.2
- docker run --name redis -p 6379:6379 -d redis:3.0
- sleep 30s
- docker exec $(docker ps -aqf "name=mongo") mongo _GLOBAL --eval "db.getCollection('_Settings').insertOne({secureKey:'1227d1c4-1385-4d5f-ae73-23e99f74b006',clusterKey:'1227d1c4-1385-4d5f-ae73-23e99f74b006',myURL:'http://localhost:4730'});"
install:
- npm install grunt-cli -g
- npm install
- docker build -t cloudboost/cloudboost:2.0.$TRAVIS_BUILD_NUMBER .
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker build -t cloudboost/cloudboost:latest .;
fi
- if [ "$TRAVIS_BRANCH" == "staging" ]; then
docker build -t cloudboost/cloudboost:staging .;
fi
- docker run --name cloudboost -e MAIL_PROVIDER=$MAIL_PROVIDER -e MAIL_PROVIDER_API_KEY=$MAIL_PROVIDER_API_KEY -e DOMAIN=$DOMAIN -e FROM_EMAIL=$FROM_EMAIL -e FROM_NAME=$FROM_NAME -p 4730:4730 -it --link redis:redis --link mongo:mongo -d cloudboost/cloudboost:2.0.$TRAVIS_BUILD_NUMBER
- sleep 30s
- git clone https://github.com/cloudboost/javascriptsdk
- cd javascriptsdk
- npm install
- grunt
- npm test
- cd ..
after_success:
- if [ "$TRAVIS_BRANCH" == "staging" ]; then
docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL;
docker push cloudboost/cloudboost: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-engine-staging --image=cloudboost/cloudboost:staging --image-pull-policy=Always;
fi
before_deploy:
- git config --global user.email "builds@travis-ci.com"
- 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://$GITLOGIN@github.com/CloudBoost/cloudboost --tags
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/cloudboost:2.0.$TRAVIS_BUILD_NUMBER;
docker push cloudboost/cloudboost: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-engine --image=cloudboost/cloudboost:latest --image-pull-policy=Always;
fi
branches:
except:
- /^*-v[0-9]/
#Notify Team on Slack
notifications:
slack: cloudboost:gm7nWJDLDtBRyF75VKLKOoMW