-
-
Save Tubbz-alt/181483b328ae14276d21faa1118833b5 to your computer and use it in GitHub Desktop.
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 | |
| #: Title : gobust | |
| #: Date : 2015-02-02 | |
| #: Author : "Nick Kirby" <@NRKirby> | |
| #: Version : 1.0 | |
| #: Description : Common operations for blogging using Ghost | Buster | Forever | |
| #: Options : start - start Ghost in production mode using Forever | |
| #: : stop - stop Ghost using Forever | |
| #: : generate - generate static site using Buster | |
| #: : upload - Git add, prompt for comment and push origin master | |
| ghost_path="/home/nick/ghost/" | |
| ghost_static_path="/home/nick/ghost-static/" | |
| start() | |
| { | |
| echo "Starting Ghost" | |
| cd $ghost_path | |
| NODE_ENV=production forever start index.js | |
| } | |
| stop() | |
| { | |
| echo "Stopping Ghost" | |
| cd $ghost_path | |
| forever stop index.js | |
| } | |
| case "$1" in | |
| "start") start | |
| ;; | |
| "stop") stop | |
| ;; | |
| "generate") stop | |
| sleep 1 | |
| start | |
| sleep 2 | |
| cd $ghost_static_path | |
| buster generate --domain=http://127.0.0.1:2368 | |
| ;; | |
| "upload") cd $ghost_static_path"/static" | |
| git add --all | |
| echo "Enter commit msg: " | |
| read msg | |
| git commit -m "$msg" | |
| git push origin master -f | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment