Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
app
 
 
bin
 
 
 
 
db
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Trade Tariff Duty Calculator

CircleCI

Prerequisites

  • Ruby 2.7.1
  • PostgreSQL
  • NodeJS 12.13.x
  • Yarn 1.12.x

Setting up the app in development

  1. Run bundle install to install the gem dependencies
  2. Run yarn to install node dependencies
  3. Run bundle exec rails server to launch the app on http://localhost:3000
  4. Run bin/webpack-dev-server in a separate shell for faster compilation of assets

Whats included?

  • Rails 6.0 with Webpacker
  • GOV.UK Frontend
  • RSpec
  • Dotenv (managing environment variables)

Running specs, linter(without auto correct) and annotate models and serializers

bundle exec rake

Running specs

bundle exec rspec

Linting

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

Deploying on GOV.UK PaaS

Prerequisites

  • Your department, agency or team has a GOV.UK PaaS account
  • You have a personal account granted by your organisation manager
  • You have downloaded and installed the Cloud Foundry CLI for your platform

Deploy (This is automated via CircleCI)

  1. Run cf login -a api.london.cloud.service.gov.uk -u USERNAME, USERNAME is your personal GOV.UK PaaS account email address
  2. Run bundle package --all to vendor ruby dependencies
  3. Run yarn to vendor node dependencies
  4. Run bundle exec rails webpacker:compile to compile assets
  5. Run cf push to push the app to Cloud Foundry Application Runtime

Check the file manifest.yml for customisation of name (you may need to change it as there could be a conflict on that name), buildpacks and eventual services (PostgreSQL needs to be set up).

Running locally in docker-compose

Prerequisites

  • You have working Docker environment
  • You have docker-compose installed

Run

  1. Clone this repo and change to it's root directory
  2. Run docker-compose up
  3. Open your browser to http://0.0.0.0:3000/duty-calculator/ping to verify it's running.
  4. Start the journey with the commodity ID you want to test (It uses the dev environment API by default) e.g http://0.0.0.0:3000/duty-calculator/uk/9620001000/import-date

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages