Skip to content

Commit

Permalink
Updated readme to reflect new codespaces config
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons authored Jul 7, 2022
1 parent 730d405 commit e842719
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,14 @@ In your [Github Codespaces settings](https://github.com/settings/codespaces), se

Then in the [caps repo](https://github.com/mysociety/caps/), click the code dropdown (top right), and select the codespaces tab, then create new codespace.

Once it has cloned and set up the docker configuration (it may prompt you to reload with the pylance extension, this is fine and takea a few seconds). You have two options:
Once it has cloned and set up the docker configuration (it may prompt you to reload with the pylance extension, this is fine and takea a few seconds), you should have a set-up populated a recent version of the current data process.

To run the data population from scratch run `script/setup-in-docker` (as warned above, this takes a while).
To restore a previous database dump, run `script/quick-setup`.
If you have used one of the devcontainer options that doesn't use this repopulation:

Once this is finished `script/server` will run the test server. You can access this by right clicking the `0.0.0.0:8000` link in the terminal, or follow the links in the ports page (where it can also be made public/shared to organisation).

#### Changes to docker image

The development docker image used by vscode/codespaces is based on a prebuilt version of the main Dockerfile to save start-up time.

This means some adjustments are necessary when a change to the branch involves a change to the base image (e.g. new packages or changed version).

In this event, commit the changes that affect the image to the branch, and go to [the workflow page](https://github.com/mysociety/caps/actions/workflows/main.yml) that can create a new image.

In this page click run workflow, and use the workflow from your new branch.

This will build the docker image and tag it with the name of the your branch. This will appear in the [package page](https://github.com/mysociety/caps/pkgs/container/caps) when ready. If the build fails, the details are in the actions tab.

Now, in the `Dockerfile.dev` file (which is the one used by the development environment), adjust the name of the image pulled in the FROM command from 'master' to the branch name.

New instances will then be referencing the changes made. When merging back into 'master' you can remove this, but technically it shouldn't matter (this image will be 'good' until a new branch that amends the dockerfile comes along).
* To run the data population from scratch run `script/setup-in-docker` (as warned above, this takes a while).
* To restore a previous database dump, run `script/restore-dev-data`.

Once this is finished `script/server` will run the test server. You can access this by right clicking the `0.0.0.0:8000` link in the terminal, or follow the links in the ports page (where it can also be made public/shared to organisation).

## Vagrant

Expand Down

0 comments on commit e842719

Please sign in to comment.