Skip to content

Instantly share code, notes, and snippets.

@lorentzca
Last active April 19, 2017 04:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorentzca/aa42bd23993ef47c7bbe to your computer and use it in GitHub Desktop.
Save lorentzca/aa42bd23993ef47c7bbe to your computer and use it in GitHub Desktop.
my ghostblog updater
#/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"'
@lorentzca
Copy link
Author

lorentzca commented Jan 27, 2016

@lorentzca
Copy link
Author

lorentzca commented Jul 11, 2016

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