Created
January 21, 2015 16:26
-
-
Save imyelo/c68cef4c53f6cdd23030 to your computer and use it in GitHub Desktop.
webapp workflow - nodejs
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
FOREVER_COMMAND = "node --harmony" | |
FOREVER_UID = "webapp" | |
FOREVER_OUTFILE = "./logs/out.log" | |
FOREVER_ERRFILE = "./logs/err.log" | |
FOREVER_LOGFILE = "./logs/forever.log" | |
FOREVER = forever start \ | |
-c ${FOREVER_COMMAND} \ | |
--uid ${FOREVER_UID} \ | |
-l ${FOREVER_LOGFILE} \ | |
-o ${FOREVER_OUTFILE} \ | |
-e ${FOREVER_ERRFILE} \ | |
-p ./ -a | |
ENTRY = ./app | |
GULP = ./node_modules/.bin/gulp | |
logs: | |
@touch ${FOREVER_LOGFILE} ${FOREVER_OUTFILE} ${FOREVER_ERRFILE} | |
static: | |
@${GULP} build | |
node_modules: | |
npm install | |
local: static stop | |
@NODE_ENV=local NODE_MOCK=true pm2 start processes.json | |
@pm2 logs | |
production: node_modules static logs stop | |
@NODE_ENV=production $(FOREVER) ${ENTRY} | |
deploy: | |
@deploy prod | |
stop: | |
-forever stop ${FOREVER_UID} | |
@pm2 kill | |
clean: | |
@rm -rf ./app/uploads/* | |
@rm -rf ./logs/*.log | |
.PHONY: logs static node_modules local production deploy stop clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment