~phw/discourse-listenbrainz

2ffbbf09b169e93724aca4d9f0d907e2e5078543 — Philipp Wolfer 9 months ago 3c7cffd
Add CONTRIBUTE.md

Gives a short introduction in setting up the Discourse
development environment for the plugin.
1 files changed, 60 insertions(+), 0 deletions(-)

A CONTRIBUTE.md
A CONTRIBUTE.md => CONTRIBUTE.md +60 -0
@@ 0,0 1,60 @@
# Contribute

## Development environment

To develop and test the Discourse ListenBrainz plugin you need a local
development Discourse setup. It is recommended to set up the docker based
development environment as described in the tutorial at

https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009


## Check out the plugin

Clone the Discourse ListenBrainz repository into the `plugins` directory of
your Discourse setup. To do so run the following while inside the Discourse
directory:

    cd plugins
    git clone https://git.sr.ht/~phw/discourse-listenbrainz

Afterwards you can start Discourse. Open two separate terminals and from
inside the Discourse directory run:

    d/rails s

In the second terminal run:

    d/ember-cli

The local discourse is available on http://127.0.0.1:4200/. Make sure the
"listenbrainz" plugin is listed at http://127.0.0.1:4200/admin/plugins and
shown as enabled.


## Run tests

The ListenBrainz plugin implements acceptance tests that can be run in Discourse:

http://127.0.0.1:4200/tests?qunit_single_plugin=listenbrainz


## Update the development environment

To update to the latest Discourse development version you need to pull the
git repository and update the development Docker container.

```bash
# Pull latest changes
git pull

# Update VM
d/shutdown_dev
d/boot_dev
d/bundle install

# Run migrations
d/rails db:migrate RAILS_ENV=development
```

Afterwards start rails and ember as described above.