Add raw trace output for GitLab Workhorse
This commit is contained in:
parent
c3cc332080
commit
27d1349f2b
|
@ -1,7 +1,7 @@
|
|||
class Projects::BuildsController < Projects::ApplicationController
|
||||
before_action :build, except: [:index, :cancel_all]
|
||||
before_action :authorize_read_build!, except: [:cancel, :cancel_all, :retry]
|
||||
before_action :authorize_update_build!, except: [:index, :show, :status]
|
||||
before_action :authorize_update_build!, except: [:index, :show, :status, :raw_trace]
|
||||
layout 'project'
|
||||
|
||||
def index
|
||||
|
@ -62,6 +62,14 @@ class Projects::BuildsController < Projects::ApplicationController
|
|||
notice: "Build has been sucessfully erased!"
|
||||
end
|
||||
|
||||
def raw
|
||||
if @build.has_trace?
|
||||
render json: { trace_file: @build.path_to_trace }
|
||||
else
|
||||
render json: {}, status: 404
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def build
|
||||
|
|
|
@ -127,6 +127,9 @@
|
|||
data: { confirm: 'Are you sure you want to erase this build?' } do
|
||||
= icon('eraser')
|
||||
Erase
|
||||
- if @build.has_trace?
|
||||
= link_to 'Raw', raw_namespace_project_build_path(@project.namespace, @project, @build),
|
||||
class: 'btn btn-sm btn-success', target: '_blank'
|
||||
|
||||
.clearfix
|
||||
- if @build.duration
|
||||
|
|
|
@ -669,6 +669,7 @@ Rails.application.routes.draw do
|
|||
post :cancel
|
||||
post :retry
|
||||
post :erase
|
||||
get :raw, format: false
|
||||
end
|
||||
|
||||
resource :artifacts, only: [] do
|
||||
|
|
Loading…
Reference in New Issue