Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startup script to match frontend apps #135

Merged
merged 1 commit into from Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
68 changes: 42 additions & 26 deletions README.md
Expand Up @@ -40,32 +40,6 @@ And then execute:
$ bundle
```

### Running as a standalone app

If you want to work on this gem directly, without having to add it to another
application, you can run it in the development vm:

```
$ cd /var/govuk/govuk_publishing_components
$ bundle

$ cd /var/govuk/govuk-puppet/development-vm
$ bowl publishing-components
```

Then visit [publishing-components.dev.gov.uk/component-guide](http://publishing-components.dev.gov.uk/component-guide).

If you don't want to run it in the development vm, you can start the app with:

```
$ cd /var/govuk/govuk_publishing_components
$ bundle

$ PLEK_SERVICE_STATIC_URI=assets.publishing.service.gov.uk bundle exec foreman start
```

Then visit [localhost:5000/component-guide](http://localhost:5000/component-guide).

#### Integration with Heroku

To make the best use of the component guide we use Heroku to serve the current `master` build and whenever a [pull request is added](https://devcenter.heroku.com/articles/github-integration-review-apps)
Expand Down Expand Up @@ -121,6 +95,48 @@ if defined?(GovukPublishingComponents)
end
```

### Running the gem as a standalone app

If you want to work on this gem directly, without having to add it to another
application, you can run it in the development vm:

```
./startup.sh
```

The app should start on http://localhost:3212 or http://publishing-components.dev.gov.uk/component-guide on GOV.UK development machines.

```
./startup.sh --live
```

This will run the app and point it at the production `static` instance.

#### Running with bowl on the VM

```
$ cd /var/govuk/govuk_publishing_components
$ bundle

$ cd /var/govuk/govuk-puppet/development-vm
$ bowl publishing-components
```

Then visit [publishing-components.dev.gov.uk/component-guide](http://publishing-components.dev.gov.uk/component-guide).

#### Running locally

If you don't want to run it in the development vm, you can start the app with:

```
$ cd /var/govuk/govuk_publishing_components
$ bundle

$ PLEK_SERVICE_STATIC_URI=assets.publishing.service.gov.uk bundle exec foreman start
```

Then visit [localhost:5000/component-guide](http://localhost:5000/component-guide).

### Test the component guide

The gem [includes integration tests](lib/govuk_publishing_components/minitest/component_guide_test.rb) to check that your component guide and examples are error free and that they meet basic accessibility needs.
Expand Down
12 changes: 12 additions & 0 deletions startup.sh
@@ -0,0 +1,12 @@
#!/bin/bash

bundle install

if [[ $1 == "--live" ]] ; then
GOVUK_APP_DOMAIN=www.gov.uk \
GOVUK_WEBSITE_ROOT=https://www.gov.uk \
PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.publishing.service.gov.uk} \
bundle exec rackup spec/dummy/config.ru --host 0.0.0.0 -p 3212
else
bundle exec rackup spec/dummy/config.ru --host 0.0.0.0 -p 3212
fi