Skip to content

Instantly share code, notes, and snippets.

@au5ton
Created November 29, 2016 05:07
Show Gist options
  • Save au5ton/96b666671ba974a63848d580d99d223b to your computer and use it in GitHub Desktop.
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.
#!/bin/sh
# Do both
cd `dirname $0`
./pull.sh
./deploy.sh
#!/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 {} \;
#!/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