Merge branch '2130-undefined-method-unique_ips_limit_enabled-after-update-to-9-0' into 'master'

Move call to pg-upgrade until after the migrations have been run

See merge request !1429
This commit is contained in:
DJ Mountney 2017-03-27 20:46:08 +00:00
parent 54ee4888e1
commit 8cf38d436d
1 changed files with 9 additions and 9 deletions

View File

@ -44,15 +44,6 @@ add_command 'upgrade', 'Run migrations after a package upgrade', 1 do |cmd_name|
exit! 0
end
unless progress_message('Ensuring PostgreSQL is updated') do
command = %W(#{base_path}/bin/gitlab-ctl pg-upgrade -w)
status = run_command(command.join(' '))
status.success?
end
log 'Error ensuring PostgreSQL is updated. Please check the logs'
exit! 1
end
log 'Shutting down all GitLab services except those needed for migrations'
get_all_services.each do |sv_name|
run_sv_command_for_service('stop', sv_name)
@ -101,6 +92,15 @@ add_command 'upgrade', 'Run migrations after a package upgrade', 1 do |cmd_name|
log 'Reconfiguring GitLab to apply migrations'
reconfigure(false) # sending 'false' means "don't quit afterwards"
unless progress_message('Ensuring PostgreSQL is updated') do
command = %W(#{base_path}/bin/gitlab-ctl pg-upgrade -w)
status = run_command(command.join(' '))
status.success?
end
log 'Error ensuring PostgreSQL is updated. Please check the logs'
exit! 1
end
log 'Restarting previously running GitLab services'
get_all_services.each do |sv_name|
if /^run: #{sv_name}:/.match(service_statuses)