2019-01-22 19:27:56 +03:00
|
|
|
# Common tasks
|
2014-03-05 19:05:18 +04:00
|
|
|
|
2019-05-17 00:56:02 +03:00
|
|
|
## Serving the docs locally
|
2015-08-11 14:41:54 +03:00
|
|
|
|
2019-05-17 00:56:02 +03:00
|
|
|
The docs are built using MkDocs, which has a live-reloading development server,
|
|
|
|
that makes working on the docs locally much easier.
|
2015-08-11 14:41:54 +03:00
|
|
|
|
2019-05-17 00:56:02 +03:00
|
|
|
To use this within the Docker environment, run:
|
2015-09-30 17:30:45 +03:00
|
|
|
|
2019-05-17 00:56:02 +03:00
|
|
|
```bash
|
|
|
|
docker-compose run -p 8000:8000 backend mkdocs serve -a 0.0.0.0:8000
|
|
|
|
```
|
|
|
|
|
|
|
|
Or if you would rather not use Docker, instead activate a virtualenv on the host
|
|
|
|
machine, and from the root of the Treeherder repo, run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
> pip install -r requirements/docs.txt
|
|
|
|
> mkdocs serve
|
|
|
|
```
|
|
|
|
|
|
|
|
In either case, the docs will then be available at: <http://localhost:8000>
|
2015-08-11 14:41:54 +03:00
|
|
|
|
2019-01-22 19:27:56 +03:00
|
|
|
## Updating package.json
|
2015-09-22 20:46:44 +03:00
|
|
|
|
2019-01-22 19:27:56 +03:00
|
|
|
- Always use `yarn` to make changes, not `npm`, so that `yarn.lock` remains in sync.
|
|
|
|
- Add new packages using `yarn add <PACKAGE>` (`yarn.lock` will be automatically updated).
|
|
|
|
- After changes to `package.json` use `yarn install` to install them and automatically update `yarn.lock`.
|
|
|
|
- For more details see the [Yarn documentation].
|
2015-09-22 20:46:44 +03:00
|
|
|
|
2019-01-22 19:27:56 +03:00
|
|
|
[yarn documentation]: https://yarnpkg.com/en/docs/usage
|
2016-05-30 17:07:55 +03:00
|
|
|
|
2019-01-22 19:27:56 +03:00
|
|
|
## Add a new Mercurial repository
|
2016-05-30 17:07:55 +03:00
|
|
|
|
2018-10-09 22:38:30 +03:00
|
|
|
To add a new repository, the following steps are needed:
|
2016-05-30 17:07:55 +03:00
|
|
|
|
2019-01-22 19:27:56 +03:00
|
|
|
- Append new repository information to the fixtures file located at:
|
2018-10-09 22:38:30 +03:00
|
|
|
`treeherder/model/fixtures/repository.json`
|
2019-05-17 00:56:02 +03:00
|
|
|
- Restart any running Django runserver/Celery processes.
|
2018-07-20 17:35:05 +03:00
|
|
|
|
2018-10-09 22:38:30 +03:00
|
|
|
For more information on adding a new GitHub repository, see
|
2019-02-06 22:34:08 +03:00
|
|
|
[Adding a GitHub repository](submitting_data.md#adding-a-github-repository).
|