File tree 2 files changed +27
-4
lines changed
2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,12 @@ install:
20
20
- npm install grunt-cli -g
21
21
- npm install
22
22
- docker build -t cloudboost/cloudboost:2.0.$TRAVIS_BUILD_NUMBER .
23
- - docker build -t cloudboost/cloudboost:latest .
23
+ - if [ "$TRAVIS_BRANCH" == "master" ]; then
24
+ docker build -t cloudboost/cloudboost:latest .;
25
+ fi
26
+ - if [ "$TRAVIS_BRANCH" == "staging" ]; then
27
+ docker build -t cloudboost/cloudboost:staging .;
28
+ fi
24
29
- 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
25
30
- sleep 30s
26
31
- git clone https://github.com/cloudboost/javascriptsdk
@@ -30,7 +35,16 @@ install:
30
35
- npm test
31
36
- cd ..
32
37
after_success :
33
- - echo "OK"
38
+ - if [ "$TRAVIS_BRANCH" == "staging" ]; then
39
+ docker login --username $DOCKERUSERNAME --password $DOCKERPASSWORD --email $DOCKEREMAIL;
40
+ docker push cloudboost/cloudboost:staging;
41
+ git clone https://github.com/CloudBoost/kube-cred.git;
42
+ cd kube-cred;
43
+ openssl enc -in config.enc -out config -d -aes256 -k $KUBE_ENC;
44
+ mkdir ~/.kube;
45
+ mv config ~/.kube/;
46
+ kubectl rolling-update cloudboost-engine-staging --image=cloudboost/cloudboost:staging --image-pull-policy=Always;
47
+ fi
34
48
before_deploy :
35
49
-
git config --global user.email "[email protected] "
36
50
- git config --global user.name "Travis CI"
@@ -44,7 +58,7 @@ deploy:
44
58
skip_cleanup : true
45
59
on :
46
60
tags : false
47
- all_branches : true
61
+ branch : master
48
62
after_deploy :
49
63
# Docker Deploy.
50
64
- if [ "$TRAVIS_BRANCH" == "master" ]; then
Original file line number Diff line number Diff line change @@ -479,10 +479,19 @@ function setUpAnalytics() {
479
479
if ( process . env [ "CLOUDBOOST_ANALYTICS_SERVICE_HOST" ] ) {
480
480
//this is running on Kubernetes
481
481
console . log ( "CloudBoost Analytics is running on Kubernetes" ) ;
482
- global . keys . analyticsUrl = "http://" + process . env [ "CLOUDBOOST_ANALYTICS_SERVICE_HOST" ] ;
482
+
483
+ if ( process . env [ "IS_STAGING" ] ) {
484
+ if ( process . env [ "CLOUDBOOST_ANALYTICS_STAGING_SERVICE_HOST" ] ) {
485
+ global . keys . analyticsUrl = "http://" + process . env [ "CLOUDBOOST_ANALYTICS_STAGING_SERVICE_HOST" ] ;
486
+ }
487
+ } else {
488
+ global . keys . analyticsUrl = "http://" + process . env [ "CLOUDBOOST_ANALYTICS_SERVICE_HOST" ] ;
489
+ }
483
490
console . log ( global . keys . analyticsUrl ) ;
491
+
484
492
} else {
485
493
console . log ( "Analytics URL : " ) ;
494
+ global . keys . analyticsUrl = "http://localhost:5555"
486
495
console . log ( global . keys . analyticsUrl ) ;
487
496
}
488
497
} catch ( err ) {
You can’t perform that action at this time.
0 commit comments