Skip to content

Instantly share code, notes, and snippets.

@Tubbz-alt
Forked from nrkirby/gobust
Created January 7, 2021 22:45
Show Gist options
  • Select an option

  • Save Tubbz-alt/181483b328ae14276d21faa1118833b5 to your computer and use it in GitHub Desktop.

Select an option

Save Tubbz-alt/181483b328ae14276d21faa1118833b5 to your computer and use it in GitHub Desktop.
#!/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