You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP: Re-work README to make it clearer how to run the app
App dependency install, build script and startup scripts seemed
oddly dispersed throughout the README, making it difficult to
talk about shared logic such as the ENV variables. I've consolidated
these into their own "Run the app locally" section.
Other things to note:
- I added `--verbose` to the build script, as the build initially
failed for me and I had to re-run the script with verbose mode
to see any meaningful output. The output isn't much more verbose
than without the flag, so there seems no downside.
- I removed the section on `.env` file, as it seems to be an
implementation detail, and also incompatible with running via
govuk-docker. But I'd like to revisit this.
- I'm currently able to compile the website fine, and fetch the
remote docs, but am struggling to get the app to _run_ locally
(in govuk-docker).
- I'd very much like to remove the "docker-compose.yml" hack
workaround.
Copy file name to clipboardExpand all lines: README.md
+20-32Lines changed: 20 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,43 +7,39 @@ This is a static site generated with Middleman, using [alphagov/tech-docs-templa
7
7
Some of the files (like the CSS, javascripts and layouts) are managed in the template and are not supposed to be modified here. Any project-specific
8
8
Ruby code needs to go into `/app`.
9
9
10
-
## Build the app locally
10
+
## Run the app locally
11
+
12
+
Install the dependencies:
11
13
12
14
```sh
13
15
bundle install
14
16
```
15
17
16
-
## Run the tests locally
18
+
You can then start up the site with `./startup.sh` (or `govuk-docker-up` if using [govuk-docker](https://github.com/alphagov/govuk-docker)). The startup script can optionally be configured with the following ENV variables:
17
19
18
-
```
19
-
bundle exec rake
20
-
```
20
+
-`GOVUK_TOKEN=<your private token>` - token to use to make authenticated requests to GitHub's API. Authenticated requests have a much higher rate limit. *You will need to specify a `GITHUB_TOKEN` if you want to build the entire Developer Docs site*. You can [create a GitHub token](https://github.com/settings/tokens/new) (the token doesn't need any scopes).
21
+
-`SKIP_PROXY_PAGES=true` - avoid fetching remote 'docs/' for each repo (i.e. just build the docs that live within govuk-developer-docs itself). You can use this if you don't have a `GITHUB_TOKEN` or if you don't care about including the remote docs.
21
22
22
-
## Run the app locally
23
+
If using govuk-docker, you may struggle to pass ENV variables to the script. You can work around this by [editing the docker-compose.yml](https://github.com/alphagov/govuk-docker/blob/ed98d3547708286f534598c78fb5c57ee3c8d112/projects/govuk-developer-docs/docker-compose.yml#L12) to add the following to the `govuk-developer-docs-lite` entry:
23
24
24
-
```sh
25
-
SKIP_PROXY_PAGES=true ./startup.sh
25
+
```yml
26
+
environment:
27
+
LANG: "C.UTF-8"
28
+
GITHUB_TOKEN: "<fill it in>"
29
+
NO_CONTRACTS: true
26
30
```
27
31
28
-
## Proxy pages
29
-
30
-
The live docs site includes pages from other alphagov GitHub repositories. To test this locally, omit `SKIP_PROXY_PAGES=true` from the command above.
31
-
32
-
The app downloads these "proxy pages" at startup and this can cause GitHub to rate limit your requests. You can pass a valid GitHub API token to the app to help avoid this:
33
-
34
-
1.[Create a GitHub token](https://github.com/settings/tokens/new). The token doesn't need any scopes.
35
-
36
-
1. Store the token in a `.env` file:
32
+
If you just want to create the site (a `build/` directory containing a set of HTML files), but not actyally start up the application, you can do so as follows (noting that the ENV variables described above apply here too):
0 commit comments