summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/artifacts_controller.rb2
-rw-r--r--app/models/ci/build.rb8
2 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index 18677fb1e95..8a1ff383134 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -18,7 +18,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
return render_404 unless build.artifacts?
current_path = params[:path] ? "./#{params[:path]}/" : './'
- artifacts_metadata = build.artifacts_metadata(current_path)
+ artifacts_metadata = build.artifacts_metadata_for(current_path)
@path = Gitlab::StringPath.new(current_path, artifacts_metadata)
end
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index ee82fe824c5..98f9e6911f2 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -30,6 +30,7 @@
# description :string(255)
# artifacts_file :text
# gl_project_id :integer
+# artifacts_metadata :text
#
module Ci
@@ -50,6 +51,7 @@ module Ci
scope :similar, ->(build) { where(ref: build.ref, tag: build.tag, trigger_request_id: build.trigger_request_id) }
mount_uploader :artifacts_file, ArtifactUploader
+ mount_uploader :artifacts_metadata, ArtifactUploader
acts_as_taggable
@@ -344,11 +346,11 @@ module Ci
def artifacts_browser_supported?
# TODO, since carrierwave 0.10.0 we will be able to check mime type here
#
- artifacts? && artifacts_file.path.end_with?('zip')
+ artifacts? && artifacts_file.path.end_with?('zip') && artifacts_metadata.exists?
end
- def artifacts_metadata(path)
- []
+ def artifacts_metadata_for(path)
+ {}
end
private