See .example.env
. Add any new Env vars required to this file, setting
placeholder data for them.
To get the application running locally, you need to:
-
git clone [email protected]:ministryofjustice/defence-request-service-rota.git
-
It is recommended that you use a ruby version manager such as rbenv or rvm
-
This can be downloaded from here.
Note: Ensure to download version
4.5.0
. -
cd defence-request-rota bundle install
-
bundle exec rake db:reset
-
cd defence-request-service-rota && bundle exec rails s
update readme with port changes
-
You can find the rota app running on
http://localhost:3000
To run the tests, you will need to install PhantomJS, the test suite is known to be working with version 1.9.7
, it may or may not work with other versions. To run the tests, use the command: bundle exec rake
In order for the rotas to be generated, clingo
will need to be installed (as instructed above). Clingo must be on the PATH of the user the process if running under.
In order to view what facts are being written, and what response clingo
returns, simply set the environment variable
ENV[CLINGO_DEBUG]
. Once set, these will be written out to the log file.
The tag remote-authentication
has been created in order to mark the point at which remote authentication
with the Auth app is stripped out. Please checkout this tag in order to familiarise yourself with how this
used to work.
Laa Rota uses Que to process jobs asychronously.
Que is configured not to process jobs in the same process as the web process, but in a seperate dedicated process.
All jobs are enqueued to the 'default' queue.
Run the que job processor with bundle exec que ./config/environment.rb
usage: que [options] file/to/require ...
-w, --worker-count [COUNT] Set number of workers in process (default: 4)
-i, --wake-interval [INTERVAL] Set maximum interval between polls of the job queue (in seconds) (default: 0.1)
-l, --log-level [LEVEL] Set level of Que's logger (debug, info, warn, error, fatal) (default: info)
-q, --queue-name [NAME] Set the name of the queue to work jobs from (default: the default queue)
-v, --version Show Que version
-h, --help Show help text
We use different containers depending on the environment - in dev and test we have test gems and phantomjs included while in production the assets get precompiled
Build all containers:
make all
or build each container seperately:
make development_container
make test_container
make production_container
docker run -d -e POSTGRES_PASSWORD=postgres --name "test-db" postgres:9.4.1
docker run -t -e RAILS_ENV=test --link "test-db:db" --name "rota-test" laa-rota:test_localbuild bash -c 'export DATABASE_URL="postgres://postgres:postgres@${DB_PORT_5432_TCP_ADDR}:${DB_PORT_5432_TCP_PORT}/laa_rota" && bundle exec rake db:create && bundle exec rake db:reset && bundle exec rake --trace'