Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d6b18d39
Commit
d6b18d39
authored
Apr 03, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
9b7a0533
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
app/controllers/projects/jobs_controller.rb
app/controllers/projects/jobs_controller.rb
+21
-11
lib/gitlab/ci/trace/stream.rb
lib/gitlab/ci/trace/stream.rb
+1
-1
No files found.
app/controllers/projects/jobs_controller.rb
View file @
d6b18d39
...
@@ -119,17 +119,19 @@ class Projects::JobsController < Projects::ApplicationController
...
@@ -119,17 +119,19 @@ class Projects::JobsController < Projects::ApplicationController
end
end
def
raw
def
raw
build
.
trace
.
read
do
|
stream
|
if
trace_artifact_file
if
trace_artifact_file
send_upload
(
trace_artifact_file
,
send_upload
(
trace_artifact_file
,
send_params:
raw_send_params
,
send_params:
{
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
},
redirect_params:
raw_redirect_params
)
redirect_params:
{
query:
{
'response-content-type'
=>
'text/plain; charset=utf-8'
,
'response-content-disposition'
=>
'inline'
}
}
)
else
elsif
stream
.
file?
build
.
trace
.
read
do
|
stream
|
send_file
stream
.
path
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
if
stream
.
file?
elsif
build
.
old_trace
send_file
stream
.
path
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
send_data
stream
.
path
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
,
filename:
'job.log'
elsif
build
.
old_trace
else
send_data
stream
.
raw
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
,
filename:
'job.log'
render_404
else
render_404
end
end
end
end
end
end
end
...
@@ -144,6 +146,14 @@ class Projects::JobsController < Projects::ApplicationController
...
@@ -144,6 +146,14 @@ class Projects::JobsController < Projects::ApplicationController
return
access_denied!
unless
can?
(
current_user
,
:erase_build
,
build
)
return
access_denied!
unless
can?
(
current_user
,
:erase_build
,
build
)
end
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
def
trace_artifact_file
@trace_artifact_file
||=
build
.
job_artifacts_trace
&
.
file
@trace_artifact_file
||=
build
.
job_artifacts_trace
&
.
file
end
end
...
...
lib/gitlab/ci/trace/stream.rb
View file @
d6b18d39
...
@@ -22,7 +22,7 @@ module Gitlab
...
@@ -22,7 +22,7 @@ module Gitlab
end
end
def
file?
def
file?
self
.
path
.
present?
if
self
.
respond_to
(
:path
)
self
.
path
.
present?
if
respond_to?
(
:path
)
end
end
def
limit
(
last_bytes
=
LIMIT_SIZE
)
def
limit
(
last_bytes
=
LIMIT_SIZE
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment