Skip to content

Commit

Permalink
New ./bin/setup
Browse files Browse the repository at this point in the history
  • Loading branch information
etdsoft committed Oct 22, 2014
1 parent 524e137 commit def0937
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 --local"

puts "\n== Copying sample files =="
unless File.exist?("config/database.yml")
system "cp config/database.yml.template 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 "mkdir -p tmp/"
system "touch tmp/restart.txt"
end

0 comments on commit def0937

Please sign in to comment.