debian-mirror-gitlab/app/uploaders/legacy_artifact_uploader.rb

21 lines
451 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
class LegacyArtifactUploader < GitlabUploader
extend Workhorse::UploadPath
2018-05-09 12:01:36 +05:30
include ObjectStorage::Concern
ObjectNotReadyError = Class.new(StandardError)
2018-03-17 18:26:18 +05:30
storage_options Gitlab.config.artifacts
def store_dir
dynamic_segment
end
private
def dynamic_segment
2018-05-09 12:01:36 +05:30
raise ObjectNotReadyError, 'Build is not ready' unless model.id
2018-03-17 18:26:18 +05:30
File.join(model.created_at.utc.strftime('%Y_%m'), model.project_id.to_s, model.id.to_s)
end
end