mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 12:17:30 +02:00
bin/setup.deps for installing dependencies before running setup rework bin/setup for initial setup improved db:seed
32 lines
851 B
Ruby
Executable file
32 lines
851 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
require 'pathname'
|
|
require 'fileutils'
|
|
|
|
# path to your application root.
|
|
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
|
|
|
|
def system!(*args)
|
|
system(*args) || abort("\n== Command #{args} failed ==")
|
|
end
|
|
|
|
Dir.chdir APP_ROOT do
|
|
|
|
puts '== Installing dependencies with bundler =='
|
|
system! 'gem install bundler --conservative'
|
|
system('bundle check') || system!('bundle install')
|
|
|
|
puts "\n== Copying sample development database config files =="
|
|
unless File.exist?('config/database.yml')
|
|
system! 'cp config/database-example-development.yml config/database.yml'
|
|
end
|
|
|
|
puts "\n== Preparing database =="
|
|
system! 'bin/rake db:setup'
|
|
|
|
puts "\n== Removing old logs and tempfiles =="
|
|
system! 'bin/rails log:clear tmp:clear'
|
|
|
|
puts "\n== Restarting application server =="
|
|
system! 'bin/rails restart'
|
|
end
|