21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-29 15:30:49 +02:00
chexpire/bin/update

31 lines
785 B
Plaintext
Raw Normal View History

2018-05-23 10:32:04 +02:00
#!/usr/bin/env ruby
require 'fileutils'
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
2019-03-02 20:10:46 +01:00
FileUtils.chdir APP_ROOT do
2018-05-23 10:32:04 +02:00
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
2019-03-02 20:10:46 +01:00
# Install JavaScript dependencies
2018-05-23 10:32:04 +02:00
# system('bin/yarn')
puts "\n== Updating database =="
2019-03-02 20:10:46 +01:00
system! 'rails db:migrate'
2018-05-23 10:32:04 +02:00
puts "\n== Removing old logs and tempfiles =="
2019-03-02 20:10:46 +01:00
system! 'rails log:clear tmp:clear'
2018-05-23 10:32:04 +02:00
puts "\n== Restarting application server =="
2019-03-02 20:10:46 +01:00
system! 'rails restart'
2018-05-23 10:32:04 +02:00
end