diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-04-16 23:32:18 +0200 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-04-19 23:17:49 +0200 |
commit | 27d1349f2b2a909565073ef144acc51295313f50 (patch) | |
tree | b8dccf84b88bb5731c3980a9add60ab2284601e5 | |
parent | c3cc3320805af4f86a1304ace787ec56102e2204 (diff) | |
download | gitlab-ce-27d1349f2b2a909565073ef144acc51295313f50.tar.gz |
Add raw trace output for GitLab Workhorse
-rw-r--r-- | app/controllers/projects/builds_controller.rb | 10 | ||||
-rw-r--r-- | app/views/projects/builds/show.html.haml | 3 | ||||
-rw-r--r-- | config/routes.rb | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index f159e169f6d..c45e9809a83 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -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 diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index aa8827b5ac8..bacfa594ba0 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -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 diff --git a/config/routes.rb b/config/routes.rb index b9f30ede524..bc48728470f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -669,6 +669,7 @@ Rails.application.routes.draw do post :cancel post :retry post :erase + get :raw, format: false end resource :artifacts, only: [] do |