Created
December 29, 2015 19:44
-
-
Save ipoval/75f9a97ac760196fc2cf to your computer and use it in GitHub Desktop.
RAILS SETUP
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
#!/usr/bin/env ruby | |
# bin/setup | |
require "pathname" | |
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__) # path to your application root. | |
Dir.chdir APP_ROOT do | |
# This script is a starting point to setup your application. Add necessary setup steps to this file: | |
puts "== Installing dependencies ==" | |
system "gem install bundler --conservative" | |
system "bundle check || bundle install" | |
# puts "\n== Copying sample files ==" | |
# unless File.exist?("config/database.yml") | |
# system "cp config/database.yml.sample config/database.yml" | |
# end | |
puts "\n== Preparing database ==" | |
system "bin/rake db:setup" | |
puts "\n== Removing old logs and tempfiles ==" | |
system "rm -f log/*" | |
system "rm -rf tmp/cache" | |
puts "\n== Restarting application server ==" | |
system "touch tmp/restart.txt" | |
end | |
# 1. Install dependencies. | |
# brew install postgresql # and follow instructions (or install another way) | |
# brew install nodejs | |
# brew install phantomjs # for running tests | |
# npm install -g bower # for front-end dependencies | |
# 2. Set up the application. | |
# git clone [email protected]:ipoval/my-app.git | |
# cd my-app | |
# cp config/application{.example,}.yml | |
# cp config/database{.example,}.yml # modify as needed | |
# bundle install | |
# rake db:setup | |
# rake bower:install | |
# AFTER: | |
#!/usr/bin/env ruby | |
require "pathname" | |
# path to your application root. | |
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__) | |
Dir.chdir APP_ROOT do | |
# This script is a starting point to setup your application. | |
# Add necessary setup steps to this file: | |
puts "== Installing dependencies ==" | |
system "gem install bundler --conservative" | |
system "bundle check || bundle install" | |
puts "\n== Copying sample files ==" | |
system "cp -n config/application.example.yml config/application.yml" | |
system "cp -n config/database.example.yml config/database.yml" | |
puts "\n== Preparing database ==" | |
system "bin/rake db:create" | |
system "bin/rake db:migrate" | |
puts "\n== Installing Bower ==" | |
system "npm install bower" | |
system "bin/rake bower:install" | |
end | |
README: | |
1. Install dependencies. | |
brew install postgresql # and follow instructions (or install another way) | |
brew install nodejs | |
brew install phantomjs # for running tests | |
2. Set up the application. | |
git clone [email protected]:collectiveidea/my-app.git | |
cd my-app | |
bin/setup | |
AND .travis.yml | |
bundle exec bin/setup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment