2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
desc 'GitLab | Artifacts | Migrate files for artifacts to comply with new storage format'
|
2018-05-09 12:01:36 +05:30
|
|
|
namespace :gitlab do
|
2023-04-23 21:23:45 +05:30
|
|
|
require 'logger'
|
|
|
|
require 'resolv-replace'
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
namespace :artifacts do
|
|
|
|
task migrate: :environment do
|
2021-09-04 01:27:46 +05:30
|
|
|
logger = Logger.new($stdout)
|
2018-05-09 12:01:36 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
helper = Gitlab::LocalAndRemoteStorageMigration::ArtifactMigrater.new(logger)
|
2018-05-09 12:01:36 +05:30
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
begin
|
2021-06-08 01:23:25 +05:30
|
|
|
helper.migrate_to_remote_storage
|
|
|
|
rescue StandardError => e
|
2019-12-21 20:55:43 +05:30
|
|
|
logger.error(e.message)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
task migrate_to_local: :environment do
|
2021-09-04 01:27:46 +05:30
|
|
|
logger = Logger.new($stdout)
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
helper = Gitlab::LocalAndRemoteStorageMigration::ArtifactMigrater.new(logger)
|
2019-07-07 11:18:12 +05:30
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
begin
|
2021-06-08 01:23:25 +05:30
|
|
|
helper.migrate_to_local_storage
|
|
|
|
rescue StandardError => e
|
2019-12-21 20:55:43 +05:30
|
|
|
logger.error(e.message)
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|