1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/bin/update

34 lines
774 B
Plaintext
Raw Normal View History

#!/usr/bin/env ruby
2019-04-27 12:02:25 +00:00
# frozen_string_literal: true
require 'fileutils'
2019-04-27 12:02:25 +00:00
APP_ROOT = File.expand_path('..', __dir__).freeze
def system!(*args)
2019-04-27 12:02:25 +00:00
system(*args) or abort "\n== Command #{args} failed =="
end
2019-04-27 12:02:25 +00:00
FileUtils.chdir APP_ROOT do
puts '== Update RubyGems =='
system! 'gem update --system'
puts '== Update Bundler =='
system! "gem install bundler -v '~> 2.0'"
2019-04-27 12:02:25 +00:00
puts '== Installing gems =='
system 'bundle check' or system! 'bundle install'
2019-04-27 12:02:25 +00:00
puts '== Install JavaScript dependencies =='
system! 'bin/rake yarn:install'
2019-04-27 12:02:25 +00:00
puts '== Updating database =='
system! 'bin/rails db:migrate'
2019-04-27 12:02:25 +00:00
puts '== Removing old logs and tempfiles =='
system! 'bin/rails log:clear tmp:clear'
2019-04-27 12:02:25 +00:00
puts '== Restarting application server =='
system! 'bin/rails restart'
end