Created
April 25, 2017 06:10
-
-
Save anhtran/a23f1054f48c3130c662be78ab1221e9 to your computer and use it in GitHub Desktop.
Script for Upgrading ghost blog
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
#!/bin/bash | |
cd /home/username/webapps/my_ghost_blog | |
curl -LOk https://ghost.org/zip/ghost-latest.zip | |
unzip ghost-latest.zip -d ghost-latest | |
cd ./ghost | |
rm -rf core index.js package.json npm-debug.log *.md | |
cp -R ../ghost-latest/core . | |
cp -R ../ghost-latest/index.js . | |
cp -R ../ghost-latest/package.json . | |
cp -R ../ghost-latest/*.md . | |
npm cache clean | |
npm install --production | |
cd .. | |
rm -rf ghost-latest ghost-latest.zip | |
# I am using supervisord to mange processes | |
# more at http://supervisord.org/ | |
supervisorctl -c supervisord.ini restart my_ghost_blog | |
# you can change or remove these lines if don't want to make backup | |
echo "Starting backup..." | |
cd /home/username/webapps | |
tar cJf my_ghost_blog.tar.xz my_ghost_blog | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment