From 9201b3c385b2dc781f73b48c6d69dc1ca8c77521 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Fri, 31 Aug 2018 09:48:24 -0400 Subject: [PATCH] Add setup script and improve readme --- .env.sample | 1 + README.md | 14 ++++++++++++++ bin/setup | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 bin/setup diff --git a/.env.sample b/.env.sample index 5032b86..812940f 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,4 @@ +export CLARIFAI_API_KEY=[api_key] export GITHUB_KEY=[key] export GITHUB_SECRET=[secret] export GITHUB_ORG=[team_id] diff --git a/README.md b/README.md index e6c22e3..b50bcc0 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,17 @@ A simple DragonFly powered image storage application. * Ruby 2.5.1 * PostgreSQL 9+ * Imagemagick + +## Getting started + +Bootstrap the project: + +```sh +$ bin/setup +``` + +Run the server: + +```sh +$ foreman start +``` diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..33257f0 --- /dev/null +++ b/bin/setup @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +# Set up Rails app. Run this script immediately after cloning the codebase. +# https://github.com/thoughtbot/guides/tree/master/protocol + +# Exit if any subcommand fails +set -e + +# Set up Ruby dependencies via Bundler +gem list bundler --installed > /dev/null || gem install bundler +gem list foreman --installed > /dev/null || gem install foreman +bundle install + +# Set up configurable environment variables +if [ ! -f .env ]; then + cp .env.sample .env +fi + +# Set up database and add any development seed data +bundle exec rake db:setup