From a96d45c694bd8fe7d07283d0b46725ca8e4c281b Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Thu, 17 Dec 2015 15:17:00 +0100 Subject: Add view action to artifacts controller --- app/controllers/projects/builds/artifacts_controller.rb | 4 ++++ app/models/ci/build.rb | 2 -- app/views/projects/builds/artifacts/view.html.haml | 4 ++++ config/routes.rb | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 app/views/projects/builds/artifacts/view.html.haml diff --git a/app/controllers/projects/builds/artifacts_controller.rb b/app/controllers/projects/builds/artifacts_controller.rb index fd2195d2460..bb70d801d8c 100644 --- a/app/controllers/projects/builds/artifacts_controller.rb +++ b/app/controllers/projects/builds/artifacts_controller.rb @@ -14,6 +14,10 @@ class Projects::Builds::ArtifactsController < Projects::ApplicationController send_file artifacts_file.path, disposition: 'attachment' end + def view + @metadata = build.artifacts_metadata + end + private def build diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index b928416aa11..11b707e57a0 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -336,8 +336,6 @@ module Ci project.execute_services(build_data.dup, :build_hooks) end - - private def yaml_variables diff --git a/app/views/projects/builds/artifacts/view.html.haml b/app/views/projects/builds/artifacts/view.html.haml new file mode 100644 index 00000000000..bb669ac8ba1 --- /dev/null +++ b/app/views/projects/builds/artifacts/view.html.haml @@ -0,0 +1,4 @@ +- page_title "#{@build.name} (##{@build.id})", 'Build artifacts' +- header_title project_title(@project, "Build artifacts", namespace_project_build_path(@project.namespace, @project, @build)) + += @metadata.inspect diff --git a/config/routes.rb b/config/routes.rb index f639f89189d..bf9ee416aca 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -609,9 +609,10 @@ Rails.application.routes.draw do end scope module: :builds do - resources :artifacts do + resource :artifacts, only: [] do collection do get :download + get 'view(/:path)', as: :view, to: 'artifacts#view' end end end -- cgit v1.2.1