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
Copy file name to clipboardExpand all lines: README.md
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,46 +4,54 @@
4
4
5
5
This is a static site generated with Middleman, using [alphagov/tech-docs-template](https://github.com/alphagov/tech-docs-template).
6
6
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
-
Ruby code needs to go into `/app`.
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 Ruby code needs to go into `/app`.
9
8
10
-
## Build the app locally
9
+
## Run the app locally
11
10
12
-
```sh
13
-
bundle install
14
-
```
11
+
Run govuk-developer-docs either inside or outside govuk-docker, configuring its behaviour with the ENV variables below.
15
12
16
-
##Run the tests locally
13
+
### ENV variables
17
14
18
-
```
19
-
bundle exec rake
20
-
```
15
+
-`GITHUB_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*. [Create the token on GitHub](https://github.com/settings/tokens/new) (the token doesn't need any scopes).
16
+
-`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.
17
+
-`NO_CONTRACTS=true` - [recommended setting](https://github.com/alphagov/govuk-developer-docs/commit/4b624a72761490c8e9b99a1aa7a10371415381e6) for speeding up the site build process
21
18
22
-
## Run the app locally
19
+
###Run with govuk-docker
23
20
24
-
```sh
25
-
SKIP_PROXY_PAGES=true ./startup.sh
21
+
govuk-docker doesn't have great support for passing ENV vars into the application startup. You'll need to [edit the docker-compose.yml](https://github.com/alphagov/govuk-docker/blob/ed98d3547708286f534598c78fb5c57ee3c8d112/projects/govuk-developer-docs/docker-compose.yml#L12-L17) to add the necessary ENV vars (e.g. `GITHUB_TOKEN`) under the `environment` property for both the `govuk-developer-docs-app` and `govuk-developer-docs-lite` groups, eg:
22
+
23
+
```yml
24
+
environment:
25
+
GITHUB_TOKEN: "<fill it in>"
26
26
```
27
27
28
-
## Proxy pages
28
+
1. In govuk-docker:
29
+
1. Edit `govuk-docker/projects/govuk-developer-docs/docker-compose.yml` as above
30
+
1. [make the project](https://docs.publishing.service.gov.uk/repos/govuk-docker.html#usage)
31
+
1. In govuk-developer-docs:
32
+
1. Install the dependencies (`govuk-docker-run bundle install`)
33
+
1. Run the application (`govuk-docker-up`)
34
+
1. Wait until all the GitHub API calls have completed (you'll see `Inspect your site configuration at` in the output). This can take a few minutes.
The live docs site includes pages from other alphagov GitHub repositories. To test this locally, omit `SKIP_PROXY_PAGES=true` from the command above.
37
+
### Run without govuk-docker
31
38
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:
39
+
1. Install the dependencies (`bundle install`)
40
+
1. Start up the site with `./startup.sh` (passing ENV vars on the CLI if necessary)
33
41
34
-
1.[Create a GitHub token](https://github.com/settings/tokens/new). The token doesn't need any scopes.
42
+
## Building the project, and running tests
35
43
36
-
1. Store the token in a `.env` file:
44
+
If you just want to create the site (a `build/` directory containing a set of HTML files), but not actually start up the application, you can do so as follows (again, the ENV variables described above apply here too):
0 commit comments