Simplifies the setup process for developers, to make it easier to contribute to the project.
Details
A bin/setup script has been added to aid setting up a development environment on Mac or Linux.
The setup script assumes the user has bash, and nothing else.
It will perform the following steps:
Check for Ruby, and prompt the user to install the correct version if it's missing
Install Ruby dependencies, including Bundler (if needed)
Look for a .env file, and offer the user the choice of creating a valid one with a generated secret if it can't be found
Attempt to create appropriate databases and users if a database connection can't be established
Load the database schema
Seed the database, including displaying useful login information to get started
Finish by instructing the user on how to start a server (bin/start) and run the tests (bin/test)
If any of these steps fail, the user is shown the following message:
==> Setup failed. If you cannot resolve the issue, please let us know using
the link below. Be sure to include the output of this command.
https://github.com/boulder-food-rescue/food-rescue-robot/issues/new
Example
==> Installing dependencies
...snip...
==> Checking environment
==> .env file missing. Would you like to create one? [Yn] Y
--------[.env]--------
...snip...
----------------------
==> Setting up database
Connection could not be established.
Attempting to bootstrap database:
...snip...
==> Loading database schema
...snip...
==> Database seeded:
Created region "Boulder Food Rescue"
Created volunteer "volunteer@example.com" with password "password"
Created admin "volunteer@example.com" with password "password"
Created region admin volunteer@example.com with password "password"
==> Congratulations! You're good to go.
To start the app, run:
bin/start
To run the tests:
bin/test
Overview
Simplifies the setup process for developers, to make it easier to contribute to the project.
Details
A
bin/setup
script has been added to aid setting up a development environment on Mac or Linux.The setup script assumes the user has bash, and nothing else.
It will perform the following steps:
.env
file, and offer the user the choice of creating a valid one with a generated secret if it can't be foundbin/start
) and run the tests (bin/test
)If any of these steps fail, the user is shown the following message:
Example