2019-10-09 22:25:20 -04:00
|
|
|
#!/usr/bin/env ruby
|
2020-02-19 07:52:46 -05:00
|
|
|
require "fileutils"
|
2019-10-09 22:25:20 -04:00
|
|
|
|
|
|
|
# path to your application root.
|
2020-02-19 07:52:46 -05:00
|
|
|
APP_ROOT = File.expand_path("..", __dir__)
|
2019-10-09 22:25:20 -04:00
|
|
|
|
|
|
|
def system!(*args)
|
|
|
|
system(*args) || abort("\n== Command #{args} failed ==")
|
|
|
|
end
|
|
|
|
|
|
|
|
FileUtils.chdir APP_ROOT do
|
|
|
|
# This script is a way to setup or update your development environment automatically.
|
|
|
|
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
|
|
|
# Add necessary setup steps to this file.
|
|
|
|
|
2020-02-19 07:52:46 -05:00
|
|
|
puts "== Installing dependencies =="
|
|
|
|
system! "gem install bundler --conservative"
|
|
|
|
system("bundle check") || system!("bundle install")
|
2019-10-09 22:25:20 -04:00
|
|
|
|
|
|
|
puts "\n== Removing old logs and tempfiles =="
|
2020-02-19 07:52:46 -05:00
|
|
|
system! "bin/rails log:clear tmp:clear"
|
2019-10-09 22:25:20 -04:00
|
|
|
|
|
|
|
puts "\n== Restarting application server =="
|
2020-02-19 07:52:46 -05:00
|
|
|
system! "bin/rails restart"
|
2019-10-09 22:25:20 -04:00
|
|
|
end
|