debian-mirror-gitlab/lib/tasks/gitlab/artifacts/migrate.rake
2021-06-08 01:23:25 +05:30

33 lines
808 B
Ruby

# frozen_string_literal: true
require 'logger'
require 'resolv-replace'
desc 'GitLab | Artifacts | Migrate files for artifacts to comply with new storage format'
namespace :gitlab do
namespace :artifacts do
task migrate: :environment do
logger = Logger.new(STDOUT)
helper = Gitlab::LocalAndRemoteStorageMigration::ArtifactMigrater.new(logger)
begin
helper.migrate_to_remote_storage
rescue StandardError => e
logger.error(e.message)
end
end
task migrate_to_local: :environment do
logger = Logger.new(STDOUT)
helper = Gitlab::LocalAndRemoteStorageMigration::ArtifactMigrater.new(logger)
begin
helper.migrate_to_local_storage
rescue StandardError => e
logger.error(e.message)
end
end
end
end