2016-06-09 08:39:16 -04:00
|
|
|
# rubocop:disable all
|
2018-11-13 02:27:31 -05:00
|
|
|
class MigrateToNewShell < ActiveRecord::Migration[4.2]
|
2014-09-03 10:10:41 -04:00
|
|
|
def change
|
2015-12-07 13:06:28 -05:00
|
|
|
return if Rails.env.test?
|
|
|
|
|
2014-09-03 10:10:41 -04:00
|
|
|
gitlab_shell_path = Gitlab.config.gitlab_shell.path
|
2014-09-08 04:16:15 -04:00
|
|
|
if system("#{gitlab_shell_path}/bin/create-hooks")
|
2014-09-03 10:10:41 -04:00
|
|
|
puts 'Repositories updated with new hooks'
|
|
|
|
else
|
|
|
|
raise 'Failed to rewrite gitlab-shell hooks in repositories'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|