-
Notifications
You must be signed in to change notification settings - Fork 65
Contributing to Spotlight
Spotlight is a Rails engine and needs to be used in the context of a Rails application. We use engine_cart to create an internal test application.
Spotlight uses Solr as part of its integration tests. We use solr_wrapper to manage the Solr instance used for development and test, using the Solr schema and configuration distributed with the project.
Our rake ci
and rake spotlight:server
tasks use engine_cart and Solr automatically, but you can refer to engine_cart and solr_wrapper documentation to work with these tools outside of those rake tasks.
- Ruby (2.2.0 or greater)
- Java (8 or greater) for Solr
- ImageMagick (http://www.imagemagick.org/script/index.php) due to carrierwave
- Install the prerequisites above.
- Clone the spotlight git repo;
cd
in. - Ensure you will be using Ruby 2.2.0 or greater.
- Install gems used by spotlight:
$ bundle install
.
Note: if your system is confused by conflicting gem versions, you may need to add "bundle exec" to the beginning of each command, e.g. $ bundle exec rake engine_cart:generate
. This ensures the command is run in the context of bundler's gem version management.
The spotlight:server rake task will build a Spotlight-based application, start Solr, and run the built-in rails server.
$ rake spotlight:server
Spotlight is now running at http://localhost:3000.
engine_cart builds the testing rails app at spec/internal by default.
Solr will run at http://localhost:8983/solr/blacklight-core by default.
If you wish to work with the testing rails app independently of Solr, see below.
$ solr_wrapper
$ rake engine_cart:server
Sometimes solr doesn't shut down properly. You can check by seeing if solr is running:
$ ps -eaf | grep solr
Spin up solr (in a new tab or window):
$ solr_wrapper
Reset solr to pristine state (e.g. remove Solr docs, core, etc):
$ solr_wrapper clean
$ rake engine_cart:generate
creates a pristine testing Blacklight Rails app for spotlight at spec/internal.
You will need an initial admin user:
$ cd .internal_test_app
$ rake spotlight:initialize
And then you can start the rails testing app (from spec/internal):
$ rails s
Spotlight is now running at http://localhost:3000.
Note that the testing app expects Solr to be running.
You can change the testing app's location - refer to the engine_cart documentation.
You may want to add the Spotlight fixtures to Solr (from spec/internal):
$ rake spotlight_test:solr:seed
To clean out the testing app: (from top level directory)
$ rake engine_cart:regenerate
The ci rake task will build a Spotlight-based application, start Solr, run the tests, and then shut down Solr when the tests are finished. Solr should not be running already when you run the tests.
$ rake ci
RuboCop is used to enforce consistent coding style, and is part of the Spotlight Travis continuous integration build. $ rake rubocop
(from the top level) will show anything flagged by RuboCop as non-conformant.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so we don't break it in a future version unintentionally.
- After making your changes, be sure to run the Spotlight tests to make sure everything works.
- Make sure your changes pass RuboCop.
- Submit your change as a Pull Request.
Configuration
- Blacklight
- Page widgets
- Resource scenarios
- Image sizes
- Queueing backends
- Creating a theme
- Configure S3 data storage
- Translations and Internationalization
- Adding new navigation menu items
Case studies
Building an exhibit
- Quickstart guide
- Configuration settings
- Adding and managing items
- Creating feature pages
- Creating about pages
- Creating browse categories
- Exhibit on exhibits - Stanford specific, yet generalizable
Development