Managing projects
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

install-discourse-plugin-for-events.md 2.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # How to Install a Discourse Plugin for Events
  2. ## 1. Create a new discourse installation for testing
  3. 1. Initialize a new discourse site:
  4. ```bash
  5. ds init discourse @forum1.flossk.org
  6. cd /var/ds/forum1.flossk.org/
  7. ```
  8. 2. Copy `settings.sh` from the original site, but change `DOMAIN` to the new one (`forum1.flossk.org`):
  9. ```bash
  10. cp ../forum.flossk.org/settings.sh .
  11. vim settings.sh
  12. ```
  13. 3. Make the container:
  14. ```bash
  15. cd /var/ds/forum1.flossk.org
  16. ds make
  17. ```
  18. (It may take a few minutes.)
  19. ## 2. Take a backup from the original site and restore it on the test site
  20. ```bash
  21. cd /var/ds/forum.flossk.org/
  22. ds backup
  23. ls backup/
  24. mkdir -p ../forum1.flossk.org/backup/
  25. cp backup/flossk-2020-07-10-171654-v20200710013237.tar.gz \
  26. ../forum1.flossk.org/backup/
  27. cd ../forum1.flossk.org/
  28. ds restore backup/flossk-2020-07-10-171654-v20200710013237.tar.gz
  29. ```
  30. **Note:** For some reason it does not work for the first time. Try it a second time:
  31. ```bash
  32. ds restore backup/flossk-2020-07-10-171654-v20200710013237.tar.gz
  33. ```
  34. Now we can open the test site https://forum1.flossk.org and login as admin.
  35. ## 3. Install the plugin on the test site
  36. Instructions on: https://meta.discourse.org/t/discourse-event/149964
  37. 1. Add `git clone https://github.com/discourse/discourse-calendar.git` on the hooks section:
  38. ```bash
  39. cd /var/ds/forum1.flossk.org/
  40. cd discourse_docker/
  41. ls containers/
  42. vim containers/forum.flossk.org.yml
  43. ```
  44. It should look like this:
  45. ```
  46. ## Plugins go here
  47. ## see https://meta.discourse.org/t/19157 for details
  48. hooks:
  49. after_code:
  50. - exec:
  51. cd: $home/plugins
  52. cmd:
  53. - git clone https://github.com/discourse/docker_manager.git
  54. - git clone https://github.com/discourse/discourse-calendar.git
  55. ```
  56. 2. Rebuild the discourse container:
  57. ```bash
  58. cd /var/ds/forum1.flossk.org/
  59. cd discourse_docker/
  60. ls containers/
  61. ./launcher rebuild forum1.flossk.org
  62. ```
  63. 3. Login as admin and enable the settings `calendar_enabled` and `discourse_post_event_enabled`.
  64. 4. Try to post a new topic, then click on the gear icon and create an event
  65. ## 4. Clean up the test site
  66. After testing is done, clean up the test site:
  67. ```bash
  68. cd /var/ds/forum1.flossk.org/
  69. ds remove
  70. cd ..
  71. rm -rf forum1.flossk.org/
  72. ```
  73. ## 5. Install the plugin on the real site
  74. Follow the steps on the section above, as described on: https://meta.discourse.org/t/discourse-event/149964