Improving ghost install

This commit is contained in:
Bob Mottram 2018-01-08 17:09:05 +00:00
parent c1ed8a4747
commit 61341e106a
1 changed files with 19 additions and 6 deletions

View File

@ -372,7 +372,7 @@ function install_ghost {
install_nodejs ghost
# now install ghost itself
npm install -g ghost-cli@1.4.1
npm install -g ghost-cli@latest
if [ ! -f /usr/local/bin/ghost ]; then
echo $'ghost was not installed'
exit 738539
@ -380,14 +380,30 @@ function install_ghost {
GHOST_ONION_HOSTNAME=$(add_onion_service ghost 80 ${GHOST_ONION_PORT})
rm -rf /var/www/$GHOST_DOMAIN_NAME/htdocs/*
npm install -g yarn
yarn install --no-emoji --no-progress
yarn cache clean
printf 'y' | ghost install ${GHOST_VERSION} --user ghost --db=sqlite3 --port ${GHOST_PORT} --verbose
adduser --system --home=/var/www/${GHOST_DOMAIN_NAME}/htdocs/ --group ghost
rm -rf /var/www/$GHOST_DOMAIN_NAME/htdocs/*
printf 'y' | ghost install ${GHOST_VERSION} --user ghost --db=sqlite3 --port ${GHOST_PORT} --verbose
if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs/versions ]; then
echo $'versions directory was not found'
exit 782523462
fi
if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs/content ]; then
echo $'content directory was not found'
exit 68352682
fi
npm install -g knex-migrator
if [ ! -f /var/www/$GHOST_DOMAIN_NAME/htdocs/versions/${GHOST_VERSION}/MigratorConfig.js ]; then
echo $'MigratorConfig.js was not found'
exit 62783538
fi
cp /var/www/$GHOST_DOMAIN_NAME/htdocs/versions/${GHOST_VERSION}/MigratorConfig.js /var/www/$GHOST_DOMAIN_NAME/htdocs
chown -R ghost: /var/www/$GHOST_DOMAIN_NAME/htdocs
cd /var/www/$GHOST_DOMAIN_NAME/htdocs/current
knex-migrator init
ghost_bust
@ -419,9 +435,6 @@ function install_ghost {
chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
n ${NODEJS_VERSION}
npm upgrade -g npm@${NPM_VERSION} --save
systemctl enable ghost
systemctl daemon-reload
systemctl start ghost