# How to Install a Discourse Plugin for Events ## 1. Create a new discourse installation for testing 1. Initialize a new discourse site: ```bash ds init discourse @forum1.flossk.org cd /var/ds/forum1.flossk.org/ ``` 2. Copy `settings.sh` from the original site, but change `DOMAIN` to the new one (`forum1.flossk.org`): ```bash cp ../forum.flossk.org/settings.sh . vim settings.sh ``` 3. Make the container: ```bash cd /var/ds/forum1.flossk.org ds make ``` (It may take a few minutes.) ## 2. Take a backup from the original site and restore it on the test site ```bash cd /var/ds/forum.flossk.org/ ds backup ls backup/ mkdir -p ../forum1.flossk.org/backup/ cp backup/flossk-2020-07-10-171654-v20200710013237.tar.gz \ ../forum1.flossk.org/backup/ cd ../forum1.flossk.org/ ds restore backup/flossk-2020-07-10-171654-v20200710013237.tar.gz ``` **Note:** For some reason it does not work for the first time. Try it a second time: ```bash ds restore backup/flossk-2020-07-10-171654-v20200710013237.tar.gz ``` Now we can open the test site https://forum1.flossk.org and login as admin. ## 3. Install the plugin on the test site Instructions on: https://meta.discourse.org/t/discourse-event/149964 1. Add `git clone https://github.com/discourse/discourse-calendar.git` on the hooks section: ```bash cd /var/ds/forum1.flossk.org/ cd discourse_docker/ ls containers/ vim containers/forum.flossk.org.yml ``` It should look like this: ``` ## Plugins go here ## see https://meta.discourse.org/t/19157 for details hooks: after_code: - exec: cd: $home/plugins cmd: - git clone https://github.com/discourse/docker_manager.git - git clone https://github.com/discourse/discourse-calendar.git ``` 2. Rebuild the discourse container: ```bash cd /var/ds/forum1.flossk.org/ cd discourse_docker/ ls containers/ ./launcher rebuild forum1.flossk.org ``` 3. Login as admin and enable the settings `calendar_enabled` and `discourse_post_event_enabled`. 4. Try to post a new topic, then click on the gear icon and create an event ## 4. Clean up the test site After testing is done, clean up the test site: ```bash cd /var/ds/forum1.flossk.org/ ds remove cd .. rm -rf forum1.flossk.org/ ``` ## 5. Install the plugin on the real site Follow the steps on the section above, as described on: https://meta.discourse.org/t/discourse-event/149964