Return non-zero exist code for failed gitlab:backup:create task
Overview
The backup task was modified in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11962 to skip on corrupt repositories. When the rake task completes it will finish with a 0
exit code even if repositories have failed to be backed up. This impacts a customers existing monitoring of the backup task (checking for the exist code)
Solution
Set a flag (var) within repostiory.rb
, set the flag to true when progress_warn
is triggered. Check the flag once the Project.find_each(batch_size: 1000)
loop has finished if true then raise
an error.
Links
Edited by Chris