sudo apt-get install libpq-dev
Use nvm - https://github.com/nvm-sh/nvm
To install npm v2 using brew:
brew install homebrew/versions/node4-lts
This should install node v4.4.3 and npm v2.15.1
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)
From the project's root folder, copy the .env.template
file to .env
and change as necessary.
Please note the build section may be outdated. The following steps work in 2019:
1) After creating a .env
file, add DB_USERNAME=postgres
1) From the project's root folder, run bundle
1) Run docker-compose -f docker-compose-local-test.yml up
1) Run rails db:create db:migrate
1) If you get an error about claim.rb
, open app/models/claim.rb
1) Comment out lines 44-46:
# bitmask :discrimination_claims, as: DISCRIMINATION_COMPLAINTS
# bitmask :pay_claims, as: PAY_COMPLAINTS
# bitmask :desired_outcomes, as: DESIRED_OUTCOMES
1) Run `rails db:create db:migrate` again
1) Uncomment lines 44-46 to return them to their original state:
```ruby
bitmask :discrimination_claims, as: DISCRIMINATION_COMPLAINTS
bitmask :pay_claims, as: PAY_COMPLAINTS
bitmask :desired_outcomes, as: DESIRED_OUTCOMES
```
1) Run npm install
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.
rake
For deployment to all environments, see the documentation at the Employment Tribunals Deployment section of Ops manual
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.