Last active
April 19, 2017 04:41
-
-
Save lorentzca/aa42bd23993ef47c7bbe to your computer and use it in GitHub Desktop.
my ghostblog updater
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
#/bin/sh -x | |
# version | |
version="0.11.8" | |
# backup | |
cd /var/www/ghost | |
sudo tar cpf /tmp/ghost_snapshot_$(date +%Y%m%d%H%M).tar . | |
# download latest ghost | |
wget --no-check-certificate -O /tmp/ghost-latest.zip https://github.com/TryGhost/Ghost/releases/download/$version/Ghost-$version.zip | |
# update ghost core | |
unzip /tmp/ghost-latest.zip -d /tmp/ghost-temp | |
sudo mv core /tmp/core.old | |
sudo cp -R /tmp/ghost-temp/core . | |
sudo cp /tmp/ghost-temp/index.js . | |
sudo cp /tmp/ghost-temp/*.json . | |
sudo chown -R h2o. ./* | |
# Upgrade dependencies | |
sudo npm install --production | |
# restart ghost | |
echo | |
echo 'Restart ghost! ex) "sudo systemctl restart ghost"' |
Usage
curl -s https://gist.githubusercontent.com/Lorentzca/aa42bd23993ef47c7bbe/raw/ghostblog_update.sh | sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see how-to-upgrade