Commit 27d1349f authored by Tomasz Maczukin's avatar Tomasz Maczukin

Add raw trace output for GitLab Workhorse

parent c3cc3320
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment