Skip to content

Commit fc40d99

Browse files
committed
Deploying on heroku
2 parents ba182a3 + f1c43c9 commit fc40d99

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

.travis.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
language: node_js
22
node_js:
3-
- '7.6'
3+
- '7.6'
44
services:
5-
- mongodb
5+
- mongodb
66
cache:
77
directories:
88
- node_modules
99
git:
1010
depth: 3
11+
install:
12+
- git clone $GIT_CLONE_REMOTE
13+
- cd $REPO_NAME
14+
- git checkout $TRAVIS_BRANCH
15+
- npm i
1116
script: npm run travis-script
1217
after_script:
13-
- npm report-coverage
18+
- npm report-coverage
1419
before_script:
15-
- npm install -g gulp-cli
20+
- npm install -g gulp-cli
1621
deploy:
17-
app: $APP_NAME
22+
app: $PROVIDER_APP_NAME
1823
provider: $PROVIDER
1924
on:
20-
repo: surabhi226005/express-mongoose-es6-rest-api
21-
branch: release
25+
repo: $PROVIDER_REPO_NAME
26+
all_branches: true
2227
api_key:
2328
secure: $TRAVIS_SECURE_API_KEY
2429
after_success:
25-
- if [ "$TRAVIS_BRANCH" == "develop" ] ; then
26-
if [ "$TRAVIS_PULL_REQUEST" == "false" ] ; then bash travis.sh ; fi ; fi
30+
- if [ "$TRAVIS_BRANCH" == "develop" ] ; then if [ "$TRAVIS_PULL_REQUEST" == "false"
31+
] ; then bash travis.sh ; fi ; fi

travis.sh

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
# vi /etc/ssh/ssh_config
2-
# i Host 192.168.0.* StrictHostKeyChecking no UserKnownHostsFile=/dev/null
3-
4-
# cd ~/.ssh
5-
# rm known_hosts
6-
# ln -s /dev/null known_hosts
7-
81
git config --global user.name "$GIT_USER_NAME"
2+
93
git config --global user.email $GIT_USER_EMAIL
104

115
# Install the Heroku gem (or the Heroku toolbelt)
126
gem install $PROVIDER
7+
138
# Add your Heroku git repo:
14-
git remote rm $PROVIDER ;
9+
git remote rm $PROVIDER ;
10+
1511
git remote add $PROVIDER git@$PROVIDER.com:$PROVIDER_APP_NAME.git ;
12+
1613
# Add your Heroku API key:
1714
export HEROKU_API_KEY=$HEROKU_API_KEY
15+
1816
# Turn off warnings about SSH keys:
1917
echo " Host heroku.com" >> ~/.ssh/config
18+
2019
echo " StrictHostKeyChecking no" >> ~/.ssh/config
20+
2121
echo " CheckHostIP no" >> ~/.ssh/config
22+
2223
echo " UserKnownHostsFile=/dev/null" >> ~/.ssh/config
24+
2325
# Clear your current Heroku SSH keys:
2426
$PROVIDER keys:clear
27+
2528
# Add a new SSH key to Heroku
2629
yes | $PROVIDER keys:add
2730

2831
git add dist/ ;
32+
2933
git checkout -b $NEW_TRAVIS_BRANCH ;
30-
git commit -m "$TRAVIS_COMMIT_MESSAGE" ;
31-
# Push to Heroku!
32-
git fetch --all --unshallow
33-
yes | git push --force $PROVIDER $NEW_TRAVIS_BRANCH:$PROVIDER_BRANCH ;
3434

35+
git commit -m "$TRAVIS_COMMIT_MESSAGE" ;
3536

36-
# echo -e "yes" | ./travis.sh
37+
# Push to Heroku
38+
yes | git push --force $PROVIDER $NEW_TRAVIS_BRANCH:$PROVIDER_BRANCH ;

0 commit comments

Comments
 (0)