Bladeren bron

Improving ghost install

Bob Mottram 7 jaren geleden
bovenliggende
commit
61341e106a
1 gewijzigde bestanden met toevoegingen van 19 en 6 verwijderingen
  1. 19
    6
      src/freedombone-app-ghost

+ 19
- 6
src/freedombone-app-ghost Bestand weergeven

372
     install_nodejs ghost
372
     install_nodejs ghost
373
 
373
 
374
     # now install ghost itself
374
     # now install ghost itself
375
-    npm install -g ghost-cli@1.4.1
375
+    npm install -g ghost-cli@latest
376
     if [ ! -f /usr/local/bin/ghost ]; then
376
     if [ ! -f /usr/local/bin/ghost ]; then
377
         echo $'ghost was not installed'
377
         echo $'ghost was not installed'
378
         exit 738539
378
         exit 738539
380
 
380
 
381
     GHOST_ONION_HOSTNAME=$(add_onion_service ghost 80 ${GHOST_ONION_PORT})
381
     GHOST_ONION_HOSTNAME=$(add_onion_service ghost 80 ${GHOST_ONION_PORT})
382
 
382
 
383
-    rm -rf /var/www/$GHOST_DOMAIN_NAME/htdocs/*
384
     npm install -g yarn
383
     npm install -g yarn
385
     yarn install --no-emoji --no-progress
384
     yarn install --no-emoji --no-progress
386
     yarn cache clean
385
     yarn cache clean
387
-    printf 'y' | ghost install ${GHOST_VERSION} --user ghost --db=sqlite3 --port ${GHOST_PORT} --verbose
388
     adduser --system --home=/var/www/${GHOST_DOMAIN_NAME}/htdocs/ --group ghost
386
     adduser --system --home=/var/www/${GHOST_DOMAIN_NAME}/htdocs/ --group ghost
387
+    rm -rf /var/www/$GHOST_DOMAIN_NAME/htdocs/*
388
+    printf 'y' | ghost install ${GHOST_VERSION} --user ghost --db=sqlite3 --port ${GHOST_PORT} --verbose
389
+
390
+    if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs/versions ]; then
391
+        echo $'versions directory was not found'
392
+        exit 782523462
393
+    fi
394
+    if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs/content ]; then
395
+        echo $'content directory was not found'
396
+        exit 68352682
397
+    fi
389
 
398
 
390
     npm install -g knex-migrator
399
     npm install -g knex-migrator
400
+    if [ ! -f /var/www/$GHOST_DOMAIN_NAME/htdocs/versions/${GHOST_VERSION}/MigratorConfig.js ]; then
401
+        echo $'MigratorConfig.js was not found'
402
+        exit 62783538
403
+    fi
404
+    cp /var/www/$GHOST_DOMAIN_NAME/htdocs/versions/${GHOST_VERSION}/MigratorConfig.js /var/www/$GHOST_DOMAIN_NAME/htdocs
405
+    chown -R ghost: /var/www/$GHOST_DOMAIN_NAME/htdocs
406
+    cd /var/www/$GHOST_DOMAIN_NAME/htdocs/current
391
     knex-migrator init
407
     knex-migrator init
392
 
408
 
393
     ghost_bust
409
     ghost_bust
419
 
435
 
420
     chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
436
     chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
421
 
437
 
422
-    n ${NODEJS_VERSION}
423
-    npm upgrade -g npm@${NPM_VERSION} --save
424
-
425
     systemctl enable ghost
438
     systemctl enable ghost
426
     systemctl daemon-reload
439
     systemctl daemon-reload
427
     systemctl start ghost
440
     systemctl start ghost