A collection of code snippets and tutorials used for the uberspace environment.

update_ghost.sh 891B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # Update uberspace > 1.0.0
  3. # with this script you can update your self-hosted
  4. # ghost installation on an uberspace server.
  5. #
  6. # Please change the following parts:
  7. # line 10 & 32: path to service directory
  8. # line 14: path to your ghost installation
  9. # stop service
  10. svc -d ~/service/ghost
  11. # change to ghost directory
  12. cd ~/ghost
  13. # backup config
  14. cp core/server/config/env/config.production.json core/server/config/env/config.production.json_bak
  15. # get latest ghost version
  16. curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
  17. unzip -o ghost.zip && rm ghost.zip
  18. # restore configuration
  19. mv -f core/server/config/env/config.production.json_bak core/server/config/env/config.production.json
  20. # update dependencies & database
  21. npm install --python="usr/local/bin/python2.7" --production
  22. NODE_ENV=production knex-migrator migrate
  23. # restart ghost
  24. svc -du ~/service/ghost