-
-
Save jasonroelofs/0c4c5e91995186db9b24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "" | |
echo " Application Bootstrap " | |
echo "" | |
# Check for Ruby | |
if test ! $(which ruby) | |
then | |
echo "Error: Please install Ruby 2.2 or later" | |
exit 1 | |
else | |
echo " ✔ Ruby found :: $(ruby -v)" | |
fi | |
# Install any external system-wide dependencies we may need | |
if test $(which brew) | |
then | |
brew list cmake > /dev/null | |
if [ $? -gt 0 ] | |
then | |
echo " Installing cmake using homebrew..." | |
brew install cmake | |
else | |
echo " ✔ cmake found in homebrew" | |
fi | |
fi | |
# Copy over config sample files | |
if [ ! -f config/database.yml ] | |
then | |
cp config/database.yml.example config/database.yml | |
echo " ✔ config/database.yml copied" | |
else | |
echo " ✔ config/database.yml found" | |
fi | |
if [ ! -f config/secrets.yml ] | |
then | |
cp config/secrets.yml.example config/secrets.yml | |
echo " ✔ config/secrets.yml copied" | |
else | |
echo " ✔ config/secrets.yml found" | |
fi | |
# Set up any other structures required for local development | |
if [ ! -d tmp/repositories ] | |
then | |
mkdir -p tmp/repositories | |
echo " ✔ tmp/repositories directory created" | |
else | |
echo " ✔ tmp/repositories found" | |
fi | |
# Local dependencies! | |
bundle install | |
echo " ✔ Gems installed" | |
# Create databases | |
bundle exec rake db:create:all | |
echo " ✔ Databases created" | |
echo "" | |
echo " The Application is Ready!" | |
echo " Verify your setup by running the tests with \`bundle exec rake\`" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment