Skip to content

Add exit status when backup fail

What does this MR do and why?

If Backup::DatabaseBackupError or Backup::FileBackupError is raised, set the exit code to 1

Related to #411497 (closed) and !124572 (comment 1521031152)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
bundle exec rake gitlab:backup:create exit status 0 on database error bundle exec rake gitlab:backup:create exit status 1 on database

How to set up and validate locally

  1. Corrupt gems/gitlab-backup-cli/lib/gitlab/backup/cli/utils/pg_dump.rb with broken args for example add more - to --clean
  2. run bundle exec rake gitlab:backup:create SKIP=uploads,builds,artifacts,lfs,terraform_state,registry,pages,repositories,packages
  3. echo $status should get 1
Edited by Phawin Khongkhasawan

Merge request reports