mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #20926 from rsanheim/fail-fast-bin-setup
add system! to fail fast in bin/setup
This commit is contained in:
commit
b260a2735e
1 changed files with 9 additions and 5 deletions
|
@ -5,13 +5,17 @@ include FileUtils
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||||
|
|
||||||
|
def system!(*args)
|
||||||
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
|
end
|
||||||
|
|
||||||
chdir APP_ROOT do
|
chdir APP_ROOT do
|
||||||
# This script is a starting point to setup your application.
|
# This script is a starting point to setup your application.
|
||||||
# Add necessary setup steps to this file.
|
# Add necessary setup steps to this file.
|
||||||
|
|
||||||
puts '== Installing dependencies =='
|
puts '== Installing dependencies =='
|
||||||
system 'gem install bundler --conservative'
|
system! 'gem install bundler --conservative'
|
||||||
system('bundle check') or system('bundle install')
|
system!('bundle check') or system!('bundle install')
|
||||||
|
|
||||||
# puts "\n== Copying sample files =="
|
# puts "\n== Copying sample files =="
|
||||||
# unless File.exist?('config/database.yml')
|
# unless File.exist?('config/database.yml')
|
||||||
|
@ -19,11 +23,11 @@ chdir APP_ROOT do
|
||||||
# end
|
# end
|
||||||
|
|
||||||
puts "\n== Preparing database =="
|
puts "\n== Preparing database =="
|
||||||
system 'ruby bin/rake db:setup'
|
system! 'ruby bin/rake db:setup'
|
||||||
|
|
||||||
puts "\n== Removing old logs and tempfiles =="
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
system 'ruby bin/rake log:clear tmp:clear'
|
system! 'ruby bin/rake log:clear tmp:clear'
|
||||||
|
|
||||||
puts "\n== Restarting application server =="
|
puts "\n== Restarting application server =="
|
||||||
system 'ruby bin/rake restart'
|
system! 'ruby bin/rake restart'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue