Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#runs the working directory unit tests
test:
NODE_ENV=test \
mocha --ignore-leaks $(shell find ./test -name \*test.js)
#deploys working directory
deploy:
make test
make deploy-git
make deploy-servers
#deploys working to git deployment branch
deploy-git:
status=$$(git status --porcelain) \
if test "x$${status}" = x
then \
git branch -f deployment \
git push origin deployment \
echo "Done deploying to git deployment branch." \
else \
git status \
echo "Error: cannot deploy. Working directory is dirty." \
exit 1 \
fi
deploy-servers:
# for each server
# @DEPLOY_SERVER_IP = "127.0.0.1" \
# make deploy-server
#deploy-server:
# connect to this server with ssh
# check if app is already running
# stop the app on the server if already running
# set working directory to app folder
# update deployment git branch
# use git to move head to deployment branch
# start app again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment