- Docker greater than or equal to
18.03.1-ce-mac64 (24245)
We recommend you install Docker from the link above, not using homebrew.
- Copy the docker environment variables and fill in any missing secrets from the TeachingJobs 1Password vault:
$ cp docker-compose.env.sample docker-compose.env- Build the docker container and set up the database
bin/drebuild-
Start the application
bin/dstartBefore you can log in to the application locally you will need a DfE Sign-in and an invitation to join Teaching Jobs. Talk to the team to get these set up.
Populate your environment with real school data. This is taken from GIAS
bin/drake data:schools:importdb/seeds.rb contain sample school data so this is not required for development
Index the vacancies in Elasticsearch, both in the development and test environments
bin/drake elasticsearch:vacancies:indexThere are two ways that you can run the tests.
Because the setup and teardown introduces quite some latency, we use the spring service to start up all dependencies in a docker container. This makes the test run faster.
Get the test server up and running
bin/dtest-serverRun the specs. When no arguments are specified, the default rake task is executed.
bin/dspec <args>To run a single spec file, the args are simply the path to the desired spec file:line number, e.g.
bin/dspec spec/features/job_seekers_can_view_vacancies_spec.rb:23Run the javascript tests
bin/dteaspoonRebuilds the test server, runs rubocop checks, all tests (both specs and javascript) and cleans up.
bin/dtestsI see Page Not Found when I log in and try to create a job listing
Try importing the school data if you have not already. When your sign in account was created, it was assigned to a school via a URN, and you may not have a school in your database with the same URN.
I get a connection error to Elasticsearch when I try to access the application locally
It might be that the web server is attempting to connect to Elasticsearch before it has fully booted, despite Elasticsearch being listed as a dependency for the webserver. Wait for a few minutes and try again.
The application claims to have vacancies in the search results but I can't see them listed
Run the Elasticsearch vacancies index task if you haven't already:
bin/drake elasticsearch:vacancies:index