Skip to content

Instantly share code, notes, and snippets.

@ishan-marikar
Created February 19, 2018 20:26
Show Gist options
  • Save ishan-marikar/e8348e0cc3c83e244fe71a77cd172c3b to your computer and use it in GitHub Desktop.
Save ishan-marikar/e8348e0cc3c83e244fe71a77cd172c3b to your computer and use it in GitHub Desktop.
#!/bin/bash
cd ..
echo "[!] Stopping existing application"
ssh [email protected] "pm2 stop x-backend"
echo "[!] Removing existing folder"
ssh [email protected] "rm -rf /home/ubuntu/backend"
echo "[!] Copying files.."
rsync -azP backend [email protected]:/home/ubuntu/ -vv --exclude node_modules --exclude misc
echo "[!] Runing yarn on files.."
ssh [email protected] "cd /home/ubuntu/backend && yarn"
echo "[!] Restarting PM2.."
ssh [email protected] "pm2 restart x-backend"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment