boulder-food-rescue / food-rescue-robot

A Rails App for Managing "Just in Time" Food Rescue, Developed by/for Boulder Food Rescue in Boulder, CO, USA
49 stars 56 forks source link

Simplify setup on Mac and Linux #159

Closed Aupajo closed 6 years ago

Aupajo commented 6 years ago

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:

  1. Check for Ruby, and prompt the user to install the correct version if it's missing
  2. Install Ruby dependencies, including Bundler (if needed)
  3. 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
  4. Attempt to create appropriate databases and users if a database connection can't be established
  5. Load the database schema
  6. Seed the database, including displaying useful login information to get started
  7. 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
Aupajo commented 6 years ago

If you're interested, I'd be happy to add you to the contributors list so that you can make feature branches in the repo instead of remote forks?

That'd be great! Thanks, @rylanb.

rylanb commented 6 years ago

Added!