mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 11:02:30 +01:00
19 lines
512 B
Ruby
Executable File
19 lines
512 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
oldrev, newrev = ARGV
|
|
|
|
def run(cmd)
|
|
exit($CHILD_STATUS.exitstatus) unless system "umask 002 && #{cmd}"
|
|
end
|
|
|
|
run 'foreman run bundle install --deployment --without development:test'
|
|
run 'whenever --update-crontab'
|
|
|
|
tasks = []
|
|
num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrate`.split("\0").size
|
|
tasks << 'db:migrate' if num_migrations.positive?
|
|
tasks << 'rates:load'
|
|
|
|
run "foreman run bundle exec rake #{tasks.join(' ')}"
|