Created
April 14, 2015 20:20
-
-
Save bblanchon/64ab8efebc51ec26a381 to your computer and use it in GitHub Desktop.
Automatically upgrade Ghost
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
# | |
# Automatically upgrade Ghost | |
# Benoit Blanchon 2014-2015 - MIT License | |
set -eu | |
GHOST_DIR=/var/www/blog.benoitblanchon.fr | |
function ghost_version { | |
npm -j ls ghost | jq -r .version | |
} | |
date | |
cd $GHOST_DIR | |
echo -n "Current version: " | |
ghost_version | |
echo "[0] Download" | |
rm -f ghost-latest.zip | |
wget -q http://ghost.org/zip/ghost-latest.zip | |
set +e | |
echo "[1] Stop service" | |
service ghost stop | |
echo "[2] Replace" | |
rm -rf core/ | |
unzip -uo ghost-latest.zip -d $GHOST_DIR | |
echo "[3] npm install" | |
npm install --production | |
echo "[4] Start service" | |
service ghost start | |
echo -n "Version is now: " | |
ghost_version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment