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:
Diffstat (limited to 'app/uploaders/pages/deployment_uploader.rb')
-rw-r--r--app/uploaders/pages/deployment_uploader.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/uploaders/pages/deployment_uploader.rb b/app/uploaders/pages/deployment_uploader.rb
new file mode 100644
index 00000000000..4fe1a548a05
--- /dev/null
+++ b/app/uploaders/pages/deployment_uploader.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Pages
+ class DeploymentUploader < GitlabUploader
+ include ObjectStorage::Concern
+
+ storage_options Gitlab.config.pages
+
+ alias_method :upload, :model
+
+ private
+
+ def dynamic_segment
+ Gitlab::HashedPath.new('pages_deployments', model.id, root_hash: model.project_id)
+ end
+
+ # @hashed is chosen to avoid conflict with namespace name because we use the same directory for storage
+ # @ is not valid character for namespace
+ def base_dir
+ "@hashed"
+ end
+ end
+end