Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/gitlab/artifacts/migrate.rake')
-rw-r--r--lib/tasks/gitlab/artifacts/migrate.rake18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/tasks/gitlab/artifacts/migrate.rake b/lib/tasks/gitlab/artifacts/migrate.rake
index 94867e1a16a..4c312ea492b 100644
--- a/lib/tasks/gitlab/artifacts/migrate.rake
+++ b/lib/tasks/gitlab/artifacts/migrate.rake
@@ -8,30 +8,24 @@ namespace :gitlab do
namespace :artifacts do
task migrate: :environment do
logger = Logger.new(STDOUT)
- logger.info('Starting transfer of artifacts to remote storage')
- helper = Gitlab::Artifacts::MigrationHelper.new
+ helper = Gitlab::LocalAndRemoteStorageMigration::ArtifactMigrater.new(logger)
begin
- helper.migrate_to_remote_storage do |artifact|
- logger.info("Transferred artifact ID #{artifact.id} of type #{artifact.file_type} with size #{artifact.size} to object storage")
- end
- rescue => e
+ helper.migrate_to_remote_storage
+ rescue StandardError => e
logger.error(e.message)
end
end
task migrate_to_local: :environment do
logger = Logger.new(STDOUT)
- logger.info('Starting transfer of artifacts to local storage')
- helper = Gitlab::Artifacts::MigrationHelper.new
+ helper = Gitlab::LocalAndRemoteStorageMigration::ArtifactMigrater.new(logger)
begin
- helper.migrate_to_local_storage do |artifact|
- logger.info("Transferred artifact ID #{artifact.id} of type #{artifact.file_type} with size #{artifact.size} to local storage")
- end
- rescue => e
+ helper.migrate_to_local_storage
+ rescue StandardError => e
logger.error(e.message)
end
end