forked from cotsog/JavaScriptSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
56 lines (56 loc) · 2.11 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
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:
- 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'});"
- 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:latest
- sleep 30s
install:
- npm install grunt-cli -g
- npm install
- grunt
after_success:
- echo "OK"
after_failure:
- docker logs cloudboost
- /usr/local/phantomjs/bin/phantomjs -v
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/JavaScriptSDK --tags
deploy:
provider: releases
api_key: $GH_TOKEN
file: "dist/cloudboost.js"
skip_cleanup: true
on:
tags: false
all_branches: true
after_deploy:
# publish to npm
- npm set init.author.name $NPM_USERNAME
- npm set init.author.email $NPM_EMAIL
- npm set init.author.url "https://cloudboost.io"
- npm --no-git-tag-version version 2.0.$TRAVIS_BUILD_NUMBER --force
- echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
- sleep 10s
- npm publish
- 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}"
branches:
except:
- /^*-v[0-9]/
#Notify Team on Slack
notifications:
slack: cloudboost:gm7nWJDLDtBRyF75VKLKOoMW