-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
26 lines (24 loc) · 985 Bytes
/
.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
language: node_js
node_js:
- node
env:
- SERVER_IP_ADDRESS=138.68.163.126
before_install: # setup the RSA key for use in Dokku Deployment:
- openssl aes-256-cbc -K $encrypted_77965d5bdd4d_key -iv $encrypted_77965d5bdd4d_iv
-in deploy_key.enc -out ./deploy_key -d
- eval "$(ssh-agent -s)"
- chmod 600 ./deploy_key
- echo -e "Host $SERVER_IP_ADDRESS\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- ssh-add ./deploy_key
# test ssh connection for: https://github.com/dwyl/learn-travis/issues/42
- ssh -i ./deploy_key [email protected] pwd
after_success:
- npm install pm2 -g
# Use BASH instead of DASH! see: https://ubuntuforums.org/showthread.php?t=1932504
- ls -al /bin/sh && sudo rm /bin/sh && sudo ln -s /bin/bash /bin/sh && ls -al /bin/sh
# - if [ $TRAVIS_PULL_REQUEST_BRANCH ]; then
# sh .bin/deploy.sh;
# fi
# - sh ./bin/deploy.sh;
- pm2 deploy ecosystem.config.js production update
- pm2 deploy ecosystem.config.js production exec "pm2 reload all"