trabajo-afectivo/bin/setup

30 lines
809 B
Text
Raw Normal View History

2015-09-25 14:37:55 +00:00
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
2018-04-12 14:57:37 +00:00
APP_ROOT = Pathname.new File.expand_path('..', __dir__)
2015-09-25 14:37:55 +00:00
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
2015-09-26 06:57:07 +00:00
puts '== Installing dependencies =='
system 'gem install bundler --conservative'
system 'bundle check || bundle install --jobs 8'
2015-09-25 14:37:55 +00:00
# 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 =="
2015-09-26 06:57:07 +00:00
system 'bin/rake db:setup'
2015-09-25 14:37:55 +00:00
puts "\n== Removing old logs and tempfiles =="
2015-09-26 06:57:07 +00:00
system 'rm -f log/*'
system 'rm -rf tmp/cache'
2015-09-25 14:37:55 +00:00
puts "\n== Restarting application server =="
2015-09-26 06:57:07 +00:00
system 'touch tmp/restart.txt'
2015-09-25 14:37:55 +00:00
end