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/models/pages_deployment.rb')
-rw-r--r--app/models/pages_deployment.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/pages_deployment.rb b/app/models/pages_deployment.rb
index 61818a63764..d67a92af6af 100644
--- a/app/models/pages_deployment.rb
+++ b/app/models/pages_deployment.rb
@@ -2,14 +2,18 @@
# PagesDeployment stores a zip archive containing GitLab Pages web-site
class PagesDeployment < ApplicationRecord
+ include EachBatch
include FileStoreMounter
+ MIGRATED_FILE_NAME = "_migrated.zip"
+
attribute :file_store, :integer, default: -> { ::Pages::DeploymentUploader.default_store }
belongs_to :project, optional: false
belongs_to :ci_build, class_name: 'Ci::Build', optional: true
scope :older_than, -> (id) { where('id < ?', id) }
+ scope :migrated_from_legacy_storage, -> { where(file: MIGRATED_FILE_NAME) }
validates :file, presence: true
validates :file_store, presence: true, inclusion: { in: ObjectStorage::SUPPORTED_STORES }
@@ -25,6 +29,10 @@ class PagesDeployment < ApplicationRecord
# this is to be adressed in https://gitlab.com/groups/gitlab-org/-/epics/589
end
+ def migrated?
+ file.filename == MIGRATED_FILE_NAME
+ end
+
private
def set_size