Supermarket is Chef's new community project with the goals of being the community repository for cookbooks, an easy to contribute to project, and the behind-the-firewall solution to serving cookbooks.
The goal of this README is to introduce you to the project and get you up and running. More information about Supermarket can be found in the wiki. Supermarket is currently pre-release and under active development. View the roadmap, and follow along with the project development in Trello. Supermarket has an open project chat on Gitter and a mailing list.
If you want to contribute to Supermarket, read the contributor's workflow for license information and helpful tips to get you started. There are project artifacts such as planning docs, wireframes, recorded demos, and team retrospectives in a public Google Drive folder and on InVision.
If you have questions, feature ideas, or other suggestions, please open a GitHub Issue.
- Ruby 2.0.0
- PostgreSQL 9.3+
- Redis 2.4+
Configure the dotenv keys and secrets to .
See .env.example
for required keys and secrets to get up and running.
docs/CONFIGURING.md
goes into detail about the not so straight forward configuration that needs
to happen to get Supermarket working locally.
Supermarket includes a collection of Chef cookbooks and a preconfigured
Vagrantfile
to make it easy to get up an running without modifying your local system.
-
Install VirtualBox and Vagrant
-
Install the
vagrant-omnibus
plugin:
$ vagrant plugin install vagrant-omnibus
- Install the
vagrant-berkshelf
plugin:
$ vagrant plugin install vagrant-berkshelf --plugin-version '>= 2.0.1'
- Run the server:
$ ./bin/supermarket server
The next time you want to start the application, you only need to run:
$ ./bin/supermarket server
Vagrant uses VirtualBox to run a VM that has access to the application project
files. It syncs your local project files with the VM. Running the
./bin/supermarket server
command spins up a VM. When you are done running the
application, do not forget to run vagrant suspend
or vagrant halt
to give
the VM a break.
You can read more about Vagrant teardown in the Vagrant docs.
[Read more about changing the Vagrant VM defaults in the wiki.] (https://github.com/opscode/supermarket/wiki/Changing-the-Vagrant-VM-Defaults)
If you get an error about Guest Additions, install the vagrant-vbguest
vagrant
plugin:
$ vagrant plugin install vagrant-vbguest
If you want to switch from Vagrant to your developing locally, you have two options:
When Vagrant runs bundle install
it installs the gems into vendor/ruby/gems
.
This is because of the Bundler config in .bundle/config
.
- If you want to continue to install gems in
vendor/ruby/gems
, delete that directory and runbundle install
. This will rebuild the gems with native dependencies on your local machine instead of the Vagrant VM. - If you want to install your gems system wide, delete the
.bundle
directory.
- Install Ruby 2.0 (latest patch) using your favorite Ruby manager
- Install Postgres (from homebrew or the app)
- Install Redis (required to run background jobs)
- Make sure both Postgres and the Redis server are running
- Install bundler
$ gem install bundler
- Install required gems:
$ bundle
- Create the database, migrate the database and seed the database:
$ bundle exec rake db:setup
- Add required Postgres extensions.
$ psql supermarket_development -c 'create extension plpgsql'
$ psql supermarket_development -c 'create extension pg_trgm'
- Start the server:
$ foreman start
Run the entire test suite (rspec, rubocop and mocha) with:
$ bundle exec rake spec:all
Acceptance tests are run with Capybara.
Run rake spec:features
to run the specs in spec/features. The default rake spec
also runs these.
When writing a feature, use require 'spec_feature_helper'
instead of
spec_helper
to require the extra configuration and libraries needed to run the
feature specs.
When writing feature specs, the Rack::Test driver is used by default. If the
Poltergeist driver is required to be used (for example, an acceptance test
that uses AJAX), add the use_poltergeist: true
metadata to the spec. See
[the remove_members_from_ccla_spec.rb spec]
(https://github.com/opscode/supermarket/blob/master/spec/features/remove_members_from_ccla_spec.rb#L17)
for an example.
Some specs run using PhantomJS, which must be installed for the test suite to pass.
The JavaScript specs are run with Karma and use the Mocha test framework and the Chai Assertion Library
The specs live in spec/javascripts. Run rake spec:javascripts
to run the
specs, and rake spec:javascripts:watch
to run them continuously and watch for
changes.
Node.js is required to run the JavaScript tests.
[Read about Supermarket's background jobs in the wiki] (https://github.com/opscode/supermarket/wiki/Background-Jobs).
[Read about Deployment instructions in the wiki.] (https://github.com/opscode/supermarket/wiki/Deployment)