Created
August 4, 2017 14:57
-
-
Save nickisnoble/7102c0317cf343a5559a59afc4e2a55c to your computer and use it in GitHub Desktop.
A quick script to update a self hosted Ghost installation (must have root access)
This file contains 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
# update server software | |
apt-get update | |
# go to web root | |
cd /var/www/ | |
# Remove any previous zips | |
rm ghost*.zip | |
# download the latest version of ghost | |
curl -LOk https://ghost.org/zip/ghost-latest.zip | |
# Stop ghost from running | |
service ghost stop | |
# Remove ghost core | |
rm -rf ghost/core | |
# Unzip and copy updated files | |
# -uo overwrites only where necessary | |
unzip -uo ghost*.zip -d ghost | |
# Reset permissions | |
chown -R ghost:ghost ghost/* | |
# Cleanup zip | |
rm ghost*.zip | |
# Go into ghost folder | |
cd ghost | |
# Install any new dependencies | |
npm install --production | |
# Start ghost service again | |
service ghost start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment