Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ cache:
- node_modules
git:
depth: 3
install:
- git clone $GIT_CLONE_REMOTE
- cd $REPO_NAME
- git checkout $TRAVIS_BRANCH
- npm i
script: npm run travis-script
after_script:
- npm report-coverage
Expand All @@ -16,6 +21,9 @@ before_script:
deploy:
app: $APP_NAME
provider: $PROVIDER
on:
repo: surabhi226005/express-mongoose-es6-rest-api
branch: master
api_key:
secure: $TRAVIS_SECURE_API_KEY
after_success:
Expand Down
28 changes: 15 additions & 13 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
# vi /etc/ssh/ssh_config
# i Host 192.168.0.* StrictHostKeyChecking no UserKnownHostsFile=/dev/null

# cd ~/.ssh
# rm known_hosts
# ln -s /dev/null known_hosts

git config --global user.name "$GIT_USER_NAME"

git config --global user.email $GIT_USER_EMAIL

# Install the Heroku gem (or the Heroku toolbelt)
gem install $PROVIDER

# Add your Heroku git repo:
git remote rm $PROVIDER ;
git remote rm $PROVIDER ;

git remote add $PROVIDER git@$PROVIDER.com:$PROVIDER_APP_NAME.git ;

# Add your Heroku API key:
export HEROKU_API_KEY=$HEROKU_API_KEY

# Turn off warnings about SSH keys:
echo " Host heroku.com" >> ~/.ssh/config

echo " StrictHostKeyChecking no" >> ~/.ssh/config

echo " CheckHostIP no" >> ~/.ssh/config

echo " UserKnownHostsFile=/dev/null" >> ~/.ssh/config

# Clear your current Heroku SSH keys:
$PROVIDER keys:clear

# Add a new SSH key to Heroku
yes | $PROVIDER keys:add

git add dist/ ;

git checkout -b $NEW_TRAVIS_BRANCH ;
git commit -m "$TRAVIS_COMMIT_MESSAGE" ;
# Push to Heroku!
git fetch --all --unshallow
yes | git push --force $PROVIDER $NEW_TRAVIS_BRANCH:$PROVIDER_BRANCH ;

git commit -m "$TRAVIS_COMMIT_MESSAGE" ;

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