Sha256: c8a519aaa6c10a5a3eef67eab95afb5bc9d48380350d2221fbb793a4874c8b15

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 Bytes

Contents

#!/usr/bin/env ruby
include FileUtils

require 'pathname'
require 'fileutils'

APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

def system!(*args)
  system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
  puts '== Installing dependencies =='
  system! 'gem install bundler --conservative'
  system('bundle check') || system!('bundle install')

  puts "\n== Copying sample files =="
  unless File.exist?('config/application.yml')
    system 'cp config/application.example.yml config/application.yml'
  end

  puts "\n== Preparing database =="
  system! 'bin/rails 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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
underlay-1.52.1 templates/bin_setup
underlay-1.50.1 templates/bin_setup