Skip to content

Commit cc93b47

Browse files
committed
Integrate heroku in travis setup
1 parent 437dc1a commit cc93b47

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ after_script:
1313
- npm report-coverage
1414
before_script:
1515
- npm install -g gulp-cli
16+
- git fetch --all --unshallow
1617
deploy:
1718
app: $APP_NAME
1819
provider: $PROVIDER
1920
api_key:
2021
secure: $TRAVIS_SECURE_API_KEY
2122
after_success:
2223
- if [ "$TRAVIS_BRANCH" == "develop" ] ; then
23-
if [ "$TRAVIS_PULL_REQUEST" == "true" ] ; then bash travis.sh ; fi ; fi
24+
if [ "$TRAVIS_PULL_REQUEST" == "false" ] ; then bash travis.sh ; fi ; fi

travis.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +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

5+
# Install the Heroku gem (or the Heroku toolbelt)
6+
gem install $PROVIDER
7+
8+
# Add your Heroku git repo:
119
git remote rm $PROVIDER ;
10+
1211
git remote add $PROVIDER git@$PROVIDER.com:$PROVIDER_APP_NAME.git ;
1312

13+
# Add your Heroku API key:
14+
export HEROKU_API_KEY=$HEROKU_API_KEY
15+
16+
# Turn off warnings about SSH keys:
17+
echo " Host heroku.com" >> ~/.ssh/config
18+
19+
echo " StrictHostKeyChecking no" >> ~/.ssh/config
20+
21+
echo " CheckHostIP no" >> ~/.ssh/config
22+
23+
echo " UserKnownHostsFile=/dev/null" >> ~/.ssh/config
24+
25+
# Clear your current Heroku SSH keys:
26+
$PROVIDER keys:clear
27+
28+
# Add a new SSH key to Heroku
29+
yes | $PROVIDER keys:add
30+
1431
git add dist/ ;
15-
git checkout -b $TRAVIS_BRANCH ;
32+
33+
git checkout -b $NEW_TRAVIS_BRANCH ;
34+
1635
git commit -m "$TRAVIS_COMMIT_MESSAGE" ;
17-
git push $PROVIDER $TRAVIS_BRANCH:PROVIDER_BRANCH ;
1836

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

0 commit comments

Comments
 (0)