govuk-docker: Publishing Content from Whitehall for Developing Government Frontend
This guide explains how to use GOV.UK Docker to develop features for government frontend, and how to publish content to test your work with locally. The instructions below assume that you have "made" all of the relevant projects before starting.
-
Start the Whitehall app:
govuk-docker up whitehall-app
-
Start the government-frontend app:
govuk-docker up government-frontend-app
-
Create a router backend for government frontend:
curl http://router-api.dev.gov.uk/backends/government-frontend -X PUT \ -H 'Content-type: application/json' \ -d '{"backend": {"backend_url": "http://government-frontend.dev.gov.uk/"}}'
-
Create a router backend for frontend (this is needed to serve the root taxon created in step 7):
curl http://router-api.dev.gov.uk/backends/frontend -X PUT \ -H 'Content-type: application/json' \ -d '{"backend": {"backend_url": "http://frontend.dev.gov.uk/"}}'
-
Create a router backend for collections (this is needed to serve the test taxon created in step 8):
curl http://router-api.dev.gov.uk/backends/collections -X PUT \ -H 'Content-type: application/json' \ -d '{"backend": {"backend_url": "http://collections.dev.gov.uk/"}}'
-
Publish the homepage and root taxon for GOV.UK:
govuk-docker run publishing-api rake publish_homepage
-
Publish a test taxon so that we can tag Whitehall content with it:
govuk-docker run whitehall-app-lite rails taxonomy:populate_end_to_end_test_data govuk-docker run whitehall-lite rails taxonomy:rebuild_cache
-
Publish a document. You should be able to access it at
http://government-frontend.dev.gov.uk/{{your_base_path_here}}