Created
November 29, 2016 05:07
-
-
Save au5ton/96b666671ba974a63848d580d99d223b to your computer and use it in GitHub Desktop.
crummy automatic deploy system for a directory of node apps, running on a crontab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Do both | |
cd `dirname $0` | |
./pull.sh | |
./deploy.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# kill, install, and restart node processes | |
cd `dirname $0` | |
echo "POLITELY SHUTTING DOWN NODE INSTANCES:" | |
killall --user bot --signal SIGTERM node | |
find . -maxdepth 1 -type d -not -name "." -exec echo "DEPLOYING: " {} \; -exec npm --prefix {} install {} \; -exec npm --prefix {} start {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Only concern is updating the repositories | |
cd `dirname $0` | |
echo "PULLING GIT REPOSITORIES" | |
find . -maxdepth 1 -type d -not -name "." -exec git -C {} pull origin master \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment