diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-23 09:10:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-23 09:10:45 +0000 |
commit | cd40f83527ac4ed4751b4b7849f0416996589d18 (patch) | |
tree | 201a36d826fc98f14ee1a7a1dc806b32f51cac00 /lib/tasks | |
parent | d5f3372f10b9fefc8cf831515152eee7ae908f69 (diff) | |
download | gitlab-ce-cd40f83527ac4ed4751b4b7849f0416996589d18.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/packages/composer.rake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/packages/composer.rake b/lib/tasks/gitlab/packages/composer.rake new file mode 100644 index 00000000000..c9bccfe9384 --- /dev/null +++ b/lib/tasks/gitlab/packages/composer.rake @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require 'logger' + +desc "GitLab | Packages | Build composer cache" +namespace :gitlab do + namespace :packages do + task build_composer_cache: :environment do + logger = Logger.new(STDOUT) + logger.info('Starting to build composer cache files') + + ::Packages::Package.composer.find_in_batches do |packages| + packages.group_by { |pkg| [pkg.project_id, pkg.name] }.each do |(project_id, name), packages| + logger.info("Building cache for #{project_id} -> #{name}") + Gitlab::Composer::Cache.new(project: packages.first.project, name: name).execute + end + end + end + end +end |