diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-23 10:17:07 -0500 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-23 14:18:39 -0500 |
commit | 12bd78103153fce845eed1566918083b52e814df (patch) | |
tree | 1cf329a537518503b54cde6edcc78f00a23bae65 /lib/backup | |
parent | 3c18a4f8aaf88dcea8c22995814057d1885c654c (diff) | |
download | gitlab-ce-12bd78103153fce845eed1566918083b52e814df.tar.gz |
Fix backups if registry is disabled
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/manager.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index 7d0608f09da..5a727f5be5b 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -1,5 +1,8 @@ module Backup class Manager + ARCHIVES_TO_BACKUP = %w{uploads builds artifacts lfs registry} + FOLDERS_TO_BACKUP = %w{repositories db} + def pack # Make sure there is a connection ActiveRecord::Base.connection.reconnect! @@ -157,11 +160,17 @@ module Backup end def archives_to_backup - %w{uploads builds artifacts lfs registry}.map{ |name| (name + ".tar.gz") unless skipped?(name) }.compact + (ARCHIVES_TO_BACKUP - disabled_features).map{ |name| (name + ".tar.gz") unless skipped?(name) }.compact end def folders_to_backup - %w{repositories db}.reject{ |name| skipped?(name) } + (FOLDERS_TO_BACKUP - disabled_features).reject{ |name| skipped?(name) } + end + + def disabled_features + features = [] + features << 'registry' unless Gitlab.config.registry.enabled + features end def settings |