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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-09 00:10:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-09 00:10:30 +0300
commita0cbad8bf4239004a472b704b5eb33d56898e816 (patch)
tree9abeeb471e483c29346aa1765578f7d10711fdba /app/uploaders/packages
parent9bcb655610575956a858ae6fdb1d00deef5f6ad8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/uploaders/packages')
-rw-r--r--app/uploaders/packages/debian/distribution_release_file_uploader.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/uploaders/packages/debian/distribution_release_file_uploader.rb b/app/uploaders/packages/debian/distribution_release_file_uploader.rb
new file mode 100644
index 00000000000..9a30aac6396
--- /dev/null
+++ b/app/uploaders/packages/debian/distribution_release_file_uploader.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+class Packages::Debian::DistributionReleaseFileUploader < GitlabUploader
+ extend Workhorse::UploadPath
+ include ObjectStorage::Concern
+
+ storage_options Gitlab.config.packages
+
+ after :store, :schedule_background_upload
+
+ alias_method :upload, :model
+
+ def filename
+ 'Release'
+ end
+
+ def store_dir
+ dynamic_segment
+ end
+
+ private
+
+ def dynamic_segment
+ raise ObjectNotReadyError, 'Package model not ready' unless model.id
+
+ Gitlab::HashedPath.new("debian_#{model.class.container_type}_distribution", model.id, root_hash: model.container_id)
+ end
+end