The idea here is to load the routes for the router and draft-router. Life's too short to work out how to create the routes manually!
cd /var/govuk/govuk-puppet/development-vm/replication- Apply
replicate-data-local.diffpatch to skip all dbs onmongo-1.backend&api-mongo-1.api - Run the following command to import data for
router&draft-router:./replicate-data-local.sh -s -d backups/YYYY-MM-DD -p -q -e -t -i 'collections_publisher contacts release search_admin tariff_admin tariff_temporal'
sudo su -c 'echo -n oauth-authenticating-proxy > /etc/govuk/authenticating-proxy/env.d/OAUTH_ID'sudo su -c 'echo -n secret > /etc/govuk/authenticating-proxy/env.d/OAUTH_SECRET'sudo su -c 'echo -n http://draft-router.dev.gov.uk > /etc/govuk/authenticating-proxy/env.d/GOVUK_UPSTREAM_URI'sudo su -c 'echo -n http://signon.dev.gov.uk > /etc/govuk/authenticating-proxy/env.d/PLEK_SERVICE_SIGNON_URI'govuk_setenv authenticating-proxy bin/rails db:creategovuk_setenv authenticating-proxy bin/rails db:schema:load
bin/rails db:createbin/rails db:schema:load
bundle exec rake applications:create name="whitehall" home_uri="http://whitehall-admin.dev.gov.uk" redirect_uri="http://whitehall-admin.dev.gov.uk/auth/gds/callback"bundle exec rake applications:create name=authenticating-proxy description="authenticating proxy" home_uri="http://authenticating-proxy.dev.gov.uk" redirect_uri="http://authenticating-proxy.dev.gov.uk/auth/gds/callback"- Copy OAuth credentials from app env vars to Signon database:
bundle exec script/make_oauth_work_in_dev
bundle exec rake users:create name="$USER_NAME$" email="$USER_EMAIL$" applications="whitehall,authenticating-proxy"- Capture "URL to set password" from stdout
- Start signon app using
bowl signon - Visit "URL to set password" captured above
Ref: https://github.com/alphagov/signon/blob/master/doc/usage.md
-
bin/rails db:create -
bin/rails db:schema:load -
Create an API user for Whitehall in Signon
- Follow these instructions
- Create an access token for Asset Manager
- Copy this access token to Whitehall env var:
sudo su -c 'echo -n $ACCESS_TOKEN_FROM_SIGNON > /etc/govuk/whitehall/env.d/ASSET_MANAGER_BEARER_TOKEN'
bin/rails db:createbin/rails db:schema:load
RUMMAGER_INDEX=all bundle exec rake rummager:create_all_indices
GDS_SSO_STRATEGY=real bowl whitehall signon authenticating-proxy draft-government-frontend draft-router- The Whitehall app and its dependencies need to be running so that content generated by the following commands is saved/published in the Content Store via the Publishing API
govuk_app_console whitehallGovernment.create!(name: 'Government of the Lizard People', slug: 'government-of-the-lizard-people', start_date: Date.parse('2010-01-01'))Organisation.create!(organisation_type: OrganisationType.ministerial_department, slug: 'dummy-organisation', name: 'Dummy Organisation', logo_formatted_name: 'dummy-organisation', alternative_format_contact_email: 'dummy-organisation@example.com')Topic.create!(name: 'Dummy Policy Area for Testing', description: 'Dummy Policy Area for Testing - Description')# also possible via UI
- Sign-in to Whitehall app - this will create a user in Whitehall based on data from Signon