Skip to content
Snippets Groups Projects
Commit 21998e17 authored by Ian Baum's avatar Ian Baum Committed by DJ Mountney
Browse files

Exit non-zero during upgrade if reconfigure fails

* Due to a change in behavior of the Omnibus::Ctl.reconfigure function,
we no longer exited non-zero if reconfigure failed during a package
upgrade. This will return the behavior of exiting with the
corresponding exit code at the time of the error
parent cb0b7ae5
No related branches found
No related tags found
No related merge requests found
---
title: Exit non-zero during upgrade if reconfigure fails
merge_request: 4591
author:
type: fixed
Loading
Loading
@@ -15,6 +15,8 @@
# limitations under the License.
#
 
require 'rainbow/ext/string'
require "#{base_path}/embedded/service/omnibus-ctl/lib/gitlab_ctl"
 
# For testing purposes, if the first path cannot be found load the second
Loading
Loading
@@ -118,7 +120,17 @@ add_command 'upgrade', 'Run migrations after a package upgrade', 1 do |cmd_name|
run_command("rm -rf #{local_mode_cache_path}")
 
log 'Reconfigure GitLab to apply migrations'
reconfigure(false) # sending 'false' mans "don't quit afterwards"
results = reconfigure
if results != 0
message = <<~EOF
===
There was an error running gitlab-ctl reconfigure. Please check the output above for more
details.
===
EOF
warn(message.color(:red))
::Kernel.exit results
end
 
log 'Restarting previously running GitLab services'
get_all_services.each do |sv_name|
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment