Sha256: 17eb8728f52ccb99f147f64a5a26932962a6eba35b926007d2644074c7a663cb
Contents?: true
Size: 1.14 KB
Versions: 21
Compression:
Stored size: 1.14 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require "fileutils" # path to your application root. APP_ROOT = File.expand_path("..", __dir__) def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end FileUtils.chdir APP_ROOT do # 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. # Add necessary setup steps to this file. puts "== Installing dependencies ==" cmd = "gem install bundler --conservative" puts "Executing #{cmd}" system! cmd system("bundle check") || system!("bundle install") puts "\n== Executing yarn ==" system!("bin/yarn") puts "\n== Creating config/database.yml file ==" if !ENV["DOCKER_ENV"] system! "rm -f config/database.yml" system! "cp config/database.yml.postgresql config/database.yml" end puts "\n== Executing rake setup ==" system! "bundle exec rake setup" puts "\n== Removing logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" puts "\n== Restarting application server ==" system! "bundle exec rails restart" end
Version data entries
21 entries across 21 versions & 1 rubygems