Class: Backup::Repositories
- Extended by:
- Gitlab::Utils::Override
- Defined in:
- lib/backup/repositories.rb
Overview
Backup and restores repositories by querying the database
Instance Method Summary collapse
- #dump(destination_path, backup_id) ⇒ Object
-
#initialize(progress, strategy:, storages: [], paths: [], skip_paths: []) ⇒ Repositories
constructor
A new instance of Repositories.
- #restore(destination_path) ⇒ Object
Methods included from Gitlab::Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods inherited from Task
#post_restore_warning, #pre_restore_warning
Constructor Details
#initialize(progress, strategy:, storages: [], paths: [], skip_paths: []) ⇒ Repositories
Returns a new instance of Repositories.
15 16 17 18 19 20 21 22 |
# File 'lib/backup/repositories.rb', line 15 def initialize(progress, strategy:, storages: [], paths: [], skip_paths: []) super(progress) @strategy = strategy @storages = storages @paths = paths @skip_paths = skip_paths end |
Instance Method Details
#dump(destination_path, backup_id) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/backup/repositories.rb', line 25 def dump(destination_path, backup_id) strategy.start(:create, destination_path, backup_id: backup_id) enqueue_consecutive ensure strategy.finish! end |
#restore(destination_path) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/backup/repositories.rb', line 34 def restore(destination_path) strategy.start(:restore, destination_path, remove_all_repositories: remove_all_repositories) enqueue_consecutive ensure strategy.finish! cleanup_snippets_without_repositories restore_object_pools end |