polaris/docs/CONTRIBUTING.md

26 lines
1.8 KiB
Markdown
Raw Normal View History

2020-08-27 08:56:06 +00:00
# Contributing
## Compiling and Running Polaris
2017-09-29 06:16:26 +00:00
Compiling and running Polaris is very easy as it only depends on the Rust toolchain.
2020-12-08 06:08:37 +00:00
1. [Install Rust](https://www.rust-lang.org/en-US/install.html)
2017-09-29 06:16:26 +00:00
2. Clone the polaris depot with this command: `git clone --recursive https://github.com/agersant/polaris.git`
3. You can now run compile and run polaris from the newly created directory with the command: `cargo run`
Polaris supports a few command line arguments which are useful during development:
- `-w some/path/to/web/dir` lets you point to the directory to be served as the web interface. You can find a suitable directory in your Polaris install (under `/web`), or from the [latest polaris-web release](https://github.com/agersant/polaris-web/releases/latest/download/web.zip).
- `-s some/path/to/swagger/dir` lets you point to the directory to be served as the swagger API documentation. You'll probably want to point this to the `/docs/swagger` directory of the polaris repository.
2020-01-21 02:31:02 +00:00
- `-d some/path/to/a/file.db` lets you manually choose where Polaris stores its configuration and music index (you can reuse the same database accross multiple runs).
- `-c some/config.toml` lets you use a configuration file to add content to the database. This can be useful if you frequently delete the database and would like to automate the first time flow. The configuration format is not documented but can be inferred by looking at the `Config` struct in `config.rs`.
- `-f` (on Linux) makes Polaris not fork into a separate process.
2017-09-29 06:16:26 +00:00
2020-09-19 23:58:19 +00:00
Putting it all together, a typical command to compile and run the program would be: `cargo run -- -w web -s docs/swagger -d test-output/my.db`
2017-09-29 06:16:26 +00:00
While Polaris is running, access the web UI at [http://localhost:5050](http://localhost:5050).
2020-08-27 08:56:06 +00:00
## Running Unit Tests
2017-09-29 06:16:26 +00:00
That's the easy part, simply run `cargo test`!