Skip to content

Instantly share code, notes, and snippets.

@mikong
Last active February 17, 2017 10:30
Show Gist options
  • Save mikong/15b446428ef1425c6b89fe5b2006603e to your computer and use it in GitHub Desktop.
Save mikong/15b446428ef1425c6b89fe5b2006603e to your computer and use it in GitHub Desktop.
The erb template for /engineyard/bin/app_chat_node
#!/bin/bash
# Author: Mikong Galero
/data/<%= @app_name %>/shared/bin/build_node_app_environment
source /data/<%= @app_name %>/shared/config/env
source /data/<%= @app_name %>/shared/config/env.custom
case "$1" in
status)
pm2 show ${application}
;;
start)
pm2 start ${current_path}/app.js --name="${application}"
;;
stop)
pm2 stop ${application}
;;
reload)
pm2 reload ${application}
;;
deploy)
pm2 reload ${application}
;;
restart)
pm2 reload ${application}
;;
*)
echo "Usage: $0 {status|start|stop|reload|restart|deploy}"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment