Development has been done on a Hyper-V VM built via the Quick Create Action, Ubuntu 20.04 Operating System.
- Ruby 2.7.1
- PostgreSQL
- NodeJS 12.13.x
- Yarn 1.12.x
- Docker
- Run
bundle install
to install the gem dependencies - Run
yarn
to install node dependencies - Run
bin/rails db:setup
to set up the database development and test schemas, and seed with test data - Run
bundle exec rails server
to launch the app on http://localhost:3000 - Run
./bin/webpack-dev-server
in a separate shell for faster compilation of assets
- The development was initiated by cloning the DFE - GOV.UK Rails Boilerplate
- DFE - GOV.UK Design System Formbuilder
bundle exec rake
bundle exec rspec
It's best to lint just your app directories and not those belonging to the framework, e.g.
bundle exec rubocop app config db lib spec Gemfile --format clang -a
or
bundle exec scss-lint app/webpacker/styles
The application requires the following environment variables to be configured
Name | Purpose |
---|---|
FEEDBACK_EMAIL | email address for feedback emails |
FEEDBACK_FORM | Url for feedback form |
GA_TRACKING_ID | Google Analytics ID |
GOVUK_NOTIFY_API_KEY | Key to GOV.UK Notify |
GOVUK_NOTIFY_ENV | GOV.UK Notify template set |
LINK_ABOUT_OIM | Link to About OIM |
LINK_INFO_CHARTER | Link to Personal Information Charter |
LINK_START_PAGE | Url of page containing the 'Start' button |
LINK_STATEMENT | Url of Transparency statement page |
MAINTENANCE_TEXT | controls use of Service unavailable page and provides message to that page |
REPORT_ISSUE_API | URL for Azure Function |
STORAGE_ACCESS_KEY | Azure storage access key |
STORAGE_ACCOUNT_NAME | Azure storage account name |
STORAGE_CONTAINER | Azure storage container name |
- Run the application locally without installing dependencies (postgres, system libraries...)
- Run in a Linux environment similar to production
- Package the application so it can be versioned and deployed to multiple environments
- Docker >= 19.03.12
make build-local-image
It relies heavily on caching. The first build may be slow and subsequent ones faster.
The docker image doesn't contain a default command. Any command can be appended:
% docker run -p 3001:3000 dfedigital/govuk-rails-boilerplate:latest rails -vT
rails about # List versions of all Rails frameworks and the environment
rails action_mailbox:ingress:exim # Relay an inbound email from Exim to Action Mailbox (URL and INGRESS_PASSWORD required)
...