debian-mirror-gitlab/lib/tasks/gitlab/uploads/migrate.rake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
1 KiB
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
namespace :gitlab do
namespace :uploads do
2022-10-11 01:57:18 +05:30
desc "GitLab | Uploads | Migrate all uploaded files to object storage"
task 'migrate:all' => :migrate
2018-12-05 23:21:45 +05:30
# The following is the actual rake task that migrates uploads of specified
# category to object storage
desc 'GitLab | Uploads | Migrate the uploaded files of specified type to object storage'
2019-12-21 20:55:43 +05:30
task :migrate, [:uploader_class, :model_class, :mounted_as] => :environment do |_t, args|
2021-09-04 01:27:46 +05:30
Gitlab::Uploads::MigrationHelper.new(args, Logger.new($stdout)).migrate_to_remote_storage
2018-05-09 12:01:36 +05:30
end
2022-10-11 01:57:18 +05:30
desc "GitLab | Uploads | Migrate all uploaded files to local storage"
task 'migrate_to_local:all' => :migrate_to_local
2018-05-09 12:01:36 +05:30
2019-12-21 20:55:43 +05:30
desc 'GitLab | Uploads | Migrate the uploaded files of specified type to local storage'
task :migrate_to_local, [:uploader_class, :model_class, :mounted_as] => :environment do |_t, args|
2021-09-04 01:27:46 +05:30
Gitlab::Uploads::MigrationHelper.new(args, Logger.new($stdout)).migrate_to_local_storage
2018-05-09 12:01:36 +05:30
end
end
end