Skip to content

hmcts/et-pet-et1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apply to an Employment Tribunal

Code Climate Test coverage Build Status

Build Status

Dependencies

Installing postgres client

Linux

sudo apt-get install libpq-dev

npm v2.x.x (not v3.x.x)

Linux

Use nvm - https://github.com/nvm-sh/nvm

OSX

To install npm v2 using brew:

brew install homebrew/versions/node4-lts

This should install node v4.4.3 and npm v2.15.1

Running the application locally

Install Docker and Docker Compose

If you already have Docker, be sure it's at least v1.11

If you're using [Kitematic] on OSX, use the terminal from there, or in any terminal run:

eval $(docker-machine env default)

Setup .env file

From the project's root folder, copy the .env.template file to .env and change as necessary.

Running Locally (2019 Update)

Please note the build section may be outdated. The following steps work in 2019:

  1. After creating a .env file, add DB_USERNAME=postgres
  2. From the project's root folder, run bundle
  3. Run docker-compose -f docker-compose-local-test.yml up
  4. Run rails db:create db:migrate
    1. If you get an error about claim.rb, open app/models/claim.rb
    2. Comment out lines 44-46:
        # bitmask :discrimination_claims, as: DISCRIMINATION_COMPLAINTS
        # bitmask :pay_claims,            as: PAY_COMPLAINTS
        # bitmask :desired_outcomes,      as: DESIRED_OUTCOMES
    3. Run rails db:create db:migrate again
    4. Uncomment lines 44-46 to return them to their original state:
        bitmask :discrimination_claims, as: DISCRIMINATION_COMPLAINTS
        bitmask :pay_claims,            as: PAY_COMPLAINTS
        bitmask :desired_outcomes,      as: DESIRED_OUTCOMES
  5. Run npm install

Build

From the project's root folder, build (this will take several minutes - grab a coffee):

docker-compose build

Run the app containers:

docker-compose up -d

Run DB setup:

docker-compose run web bash -c "RAILS_ENV=local bundle exec rake db:setup"

Get the IP of the virtual docker machine with:

docker-machine ip

Visit http://<insert-ip-from-previous-command>:8080 to access the locally running site.

Running the specs

rake

Deploying

For deployment to all environments, see the documentation at the Employment Tribunals Deployment section of Ops manual

Shuttering

In order to stop people using the system a maintenance page has been added which is controlled using environment variables.

These are :-

MAINTENANCE_ENABLED - Set to 'true' to enable maintenance page to be enabled

Any of the environment variables below can be added if you want to customize from the defaults

MAINTENANCE_ALLOWED_IPS MAINTENANCE_END - If added you will see "You will be able to use the service from " followed by this text.