f4e2fe31b4
so that we can quickly switch the app between using the saas extension and not. (Bundler will re-fetch the remote if the ref is not present.) Also set the bundler config to auto-install missing dependencies.
25 lines
756 B
Ruby
Executable File
25 lines
756 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
def system!(*args) system(*args, exception: true) end
|
|
|
|
puts "== Installing dependencies =="
|
|
system("gem install bundler --conservative")
|
|
system("bundle config set --local auto_install true")
|
|
system("bundle check") || system!("bundle install")
|
|
|
|
if ENV.fetch("SAAS_EXTENSION", "") != ""
|
|
load File.expand_path("../gems/fizzy-saas/bin/setup", __dir__)
|
|
end
|
|
|
|
puts "\n== Preparing database =="
|
|
if ARGV.include?("--reset")
|
|
system! "bin/rails db:drop db:create db:schema:load db:prepare"
|
|
system! "bin/rails db:fixtures:load" # load signal id fixtures before running fizzy seeds
|
|
system! "bin/rails db:seed"
|
|
else
|
|
system! "bin/rails db:prepare"
|
|
end
|
|
|
|
puts "\n== Removing old logs and tempfiles =="
|
|
system! "bin/rails log:clear tmp:clear"
|