-
Docker
-
Clone the repository
git clone https://github.com/zooniverse/zoo_stats_api_graphql
. -
Install Docker from the appropriate link above.
-
cd
into the cloned folder. -
Run
docker-compose build
to build the containers Panoptes API container. You will need to re-run this command on any changes toDockerfile
-
Install the gem dependencies for the application
- Run:
docker-compose run --rm --entrypoint="bundle install" zoo_stats
- Run:
-
Create and run the application containers with
docker-compose up
-
If the above step reports a missing database error, kill the docker-compose process or open a new terminal window in the current directory and then run
docker-compose run --rm --entrypoint="bundle exec rake db:setup" zoo_stats
to setup the database. This command will launch a new Docker container, run the rake DB setup task, and then clean up the container. -
Open up the application in your browser at http://localhost:3000
Once all the above steps complete you will have a working copy of the checked out code base. Keep your code up to date and rebuild the image on any code or configuration changes.
-
Setup the test environment and database
- Run:
docker-compose run --rm -e RAILS_ENV=test --entrypoint="bundle install" zoo_stats
- Run:
docker-compose run --rm -e RAILS_ENV=test --entrypoint="bundle exec rake db:setup" zoo_stats
- Run:
-
Run the tests
- Run:
docker-compose run -T --rm -e RAILS_ENV=test --entrypoint="bundle exec rspec" zoo_stats
- Run: