Quickstart for Development
After development environment has been set up:
- If k8s is running on your machine with the ruok containers, skip to step 2, else:
In local terminal (ctrl, shift, p -> new integrated terminal):
1 2 3 |
|
-
Forward ports to local machine. In local terminal (ctrl, shift, p -> new integrated terminal):
Do not close this terminal - open a new one to continue.1
make port-forward
-
Add the 'ruok' database
-
In a web browser, navigate to http://localhost:8529/
- Username - root, no password, login
- In _system db, in the left menu, select databases. Add a db called 'ruok'.
- In the header, select the refresh icon near _system db.
-
Log back into ruok database with the previous credentials.
-
Populate the database
1 2
cd api/src python initialize_db.py
-
Populate the .env files
-
Spin up webhook server (listening for events from github)
Note - you may need to direnv allow first Leave this terminal open as well, open another terminal to continue.1 2
cd /workspaces/ruok-service-autochecker/event-collectors/github-webhook-server make forward-webhook
-
If you're working with the scanners, or need the database populated with a GitHub Repo scan, either re-send an event from github, or manually send one with NATS.
1
nats pub "EventsScanner.githubEndpoints" "{\"endpoint\":\"https://github.com/PHACDataHub/ruok-service-autochecker\"}"
-
Update containers with dev changes Rebuid containers, push to kind (in local terminal)
Once pushed, delete pod (using k9s) in order to propagate the new changes.1 2
make build make kind-push-all