- we try out best to separate ghost/ from our application
- depending on prod/dev ghost/ is git, or latest zip
- Prod is started using pm2.
.
├── Capfile #cap task management
├── README.md
├── app
│ ├── config.js
│ └── content #blog content
│ ├── apps
│ │ └── README.md
│ ├── data
│ │ ├── README.md
│ │ └── ghost-dev.db
│ ├── images
│ │ ├── 2015
│ │ └── README.md
│ └── themes
│ └── monologue #purchased theme
├── config #capistrano content
│ ├── deploy
│ │ ├── production.rb
│ │ └── staging.rb
│ └── deploy.rb
├── ghost #latest-ghost.zip OR ghost.git
└── lib
└── capistrano
└── tasks
REPO=repo.git
SITE=blog.com
#clone
git clone $REPO $SITE
cd $SITE
** PROD **
#populate ghost/
wget -q https://ghost.org/zip/ghost-latest.zip
unzip -q -d ghost ghost-latest.zip
cd ghost
#run tasks
npm install --production
grunt prod
** DEV **
#populate ghost/
git clone git://github.com/tryghost/ghost.git ghost
cd ghost
git checkout stable
#run tasks
npm install
grunt init
ghost environment shares app/ content and theme via link
cd ghost
rm config.js
rm -rf content/{apps,data,images}
ln -s ../app/config.example.js config.js
ln -s ../../app/content/{apps,data,images} content/
ln -s ../../../app/content/themes/monologue content/themes/.
** PROD **
npm install -g pm2
NODE_ENV="production" pm2 start index.js --name "Ghost"
NODE_ENV="production" pm2 restart Ghost
** DEV **
npm start