8a417f5ae8
Similar to #33218, build artifacts were being uploaded into a CarrierWave temporary directory in the Rails root directory before moved to their final destination, which could cause a copy across filesystems. This merge request refactors the work in !11866 so that any uploader can just override `work_dir` to change the default implementation. Closes #33274
19 lines
361 B
Ruby
19 lines
361 B
Ruby
class LfsObjectUploader < GitlabUploader
|
|
storage :file
|
|
|
|
def store_dir
|
|
"#{Gitlab.config.lfs.storage_path}/#{model.oid[0, 2]}/#{model.oid[2, 2]}"
|
|
end
|
|
|
|
def cache_dir
|
|
"#{Gitlab.config.lfs.storage_path}/tmp/cache"
|
|
end
|
|
|
|
def filename
|
|
model.oid[4..-1]
|
|
end
|
|
|
|
def work_dir
|
|
File.join(Gitlab.config.lfs.storage_path, 'tmp', 'work')
|
|
end
|
|
end
|