summaryrefslogtreecommitdiff
path: root/app/controllers/projects/jobs_controller.rb
diff options
context:
space:
mode:
authorMicaël Bergeron <mbergeron@gitlab.com>2018-03-01 16:30:31 -0500
committerMicaël Bergeron <mbergeron@gitlab.com>2018-03-01 16:30:31 -0500
commit0d458b96e8349a50877ebd55932bf806e93caa21 (patch)
tree8a95f619a28606c7653beb524ace295d3c254c20 /app/controllers/projects/jobs_controller.rb
parent0e732fa466c4d1c48163472b268dded18cc39407 (diff)
downloadgitlab-ce-0d458b96e8349a50877ebd55932bf806e93caa21.tar.gz
remove geo specific code
Diffstat (limited to 'app/controllers/projects/jobs_controller.rb')
-rw-r--r--app/controllers/projects/jobs_controller.rb32
1 files changed, 24 insertions, 8 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index 8041bdbb0bd..abf4be6250b 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -1,6 +1,4 @@
class Projects::JobsController < Projects::ApplicationController
- prepend EE::Projects::JobsController
-
before_action :build, except: [:index, :cancel_all]
before_action :authorize_read_build!,
@@ -119,11 +117,17 @@ class Projects::JobsController < Projects::ApplicationController
end
def raw
- build.trace.read do |stream|
- if stream.file?
- send_file stream.path, type: 'text/plain; charset=utf-8', disposition: 'inline'
- else
- render_404
+ if trace_artifact_file
+ send_upload(trace_artifact_file,
+ send_params: raw_send_params,
+ redirect_params: raw_redirect_params)
+ else
+ build.trace.read do |stream|
+ if stream.file?
+ send_file stream.path, type: 'text/plain; charset=utf-8', disposition: 'inline'
+ else
+ render_404
+ end
end
end
end
@@ -138,9 +142,21 @@ class Projects::JobsController < Projects::ApplicationController
return access_denied! unless can?(current_user, :erase_build, build)
end
+ def raw_send_params
+ { type: 'text/plain; charset=utf-8', disposition: 'inline' }
+ end
+
+ def raw_redirect_params
+ { query: { 'response-content-type' => 'text/plain; charset=utf-8', 'response-content-disposition' => 'inline' } }
+ end
+
+ def trace_artifact_file
+ @trace_artifact_file ||= build.job_artifacts_trace&.file
+ end
+
def build
@build ||= project.builds.find(params[:id])
- .present(current_user: current_user)
+ .present(current_user: current_user)
end
def build_path(build)