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
|
2021-10-23 10:38:28 -04:00
|
|
|
# This script is a way to set up or update your development environment automatically.
|
|
|
|
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
2019-10-09 22:25:20 -04:00
|
|
|
# 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
|