Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 1.44 KB

DEVELOPERS.md

File metadata and controls

71 lines (48 loc) · 1.44 KB

Notes for developers

Setup

Set up a local development environment with:

just devenv
just npm-install
just npm-build

Update the local project staticfiles and migrations

just collectstatic
just migrate

Running locally

Start a development server with:

just run

Tests

Run the tests with:

just test <args>

Any args are passed to pytest.

Deployment

Deployment uses dokku and requires the environment variables defined in dotenv-sample. It is deployed to our dokku3 instance (see Dokku Deployment).

Adding a new action

To add a new action, first edit actions/jobs/daily/fetch_action.py.

Then, as the dokku user on dokku3, run:

dokku enter actions-registry

This starts a bash session connected to the docker container running the application. Finally, run:

python manage.py runjob actions fetch_action

This fetches metadata about all actions from GitHub.

Updating the GitHub token

  1. Log into the opensafely-readonly GitHub account (the credentials are in Bitwarden)
  2. Go to Settings / Developer settings / Personal access tokens / Tokens (classic)
  3. Click on actions-registry-token
  4. Click on Regenerate token
  5. Set the expiry to 90 days
  6. Copy the new token
  7. ssh into dokku3.ebmdatalab.net
  8. Run dokku config:set actions-registry GITHUB_TOKEN=<the new token>