Documentation

Requirements

Since Panoptes uses Docker to manage its environment, the requirements listed below are also found in docker-compose.yml. The means by which a new Panoptes instance is created with Docker is located in the Dockerfile. If you plan on using Docker to manage Panoptes, skip ahead to Installation.

Panoptes is primarily developed against stable MRI, currently 2.3. If you're running MRI Ruby you'll need to have the Postgresql client libraries installed as well as have Postgresql version 9.4 running.

If you have an existing Panoptes Docker container, or if your Gemfile or Ruby version has changed, run docker-compose build to rebuild the containers.

Otherwise, create and run the application containers by running docker-compose up

After step 5 finishes, open a new terminal and run docker-compose run --rm --entrypoint=rake panoptes db:setup to setup the database. This will launch a new Docker container, run the rake DB setup task, and then clean up the container.

To seed the development database with an Admin user and a Doorkeeper client application for API access run docker-compose run --rm --entrypoint=rails panoptes runner db/fig_dev_seed_data/fig_dev_seed_data.rb

Run the full spec suite docker-compose run -T --rm -e RAILS_ENV=test --entrypoint=rspec panoptes. Note: this will be slow. Use rspec focus set or specify the spec you want to run, e.g. `docker-compose run -T --rm -e RAILS_ENV=test --entrypoint="rspec path/to/spec/file.rb" panoptes

Use parts of docker-compose manually and wire them up manually to create a testing environment.

Setup the testing database if you haven't already, by running RAILS_ENV=test rake db:setup

Finally, run rspec with RAILS_ENV=test rspec

Contributing

Thanks a bunch for wanting to help Zooniverse. Here are few quick guidelines to start working on our project:

Fork the Project on Github.

Clone the code and follow one of the above guides to setup a dev environment.

Create a new git branch and make your changes.

Make sure the tests still pass by running bundle exec rspec.

Add tests if you introduced new functionality.

Commit your changes. Try to make your commit message informative, but we're not sticklers about it. Do try to to add Closes #issue or Fixes #issue somewhere in your message if it's addressing a specific open issue.

Submit a Pull Request

Wait for feedback or a merge!

Your Pull Request will run on travis-ci, and we'll probably wait for it to pass on MRI Ruby 2.3. For more information, see the wiki.