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
801e4271
Commit
801e4271
authored
Feb 23, 2018
by
Kamil Trzciński
Committed by
Shinya Maeda
Feb 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minimal fix for artifacts service
parent
58a312f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
app/services/ci/create_trace_artifact_service.rb
app/services/ci/create_trace_artifact_service.rb
+26
-5
No files found.
app/services/ci/create_trace_artifact_service.rb
View file @
801e4271
...
@@ -4,13 +4,34 @@ module Ci
...
@@ -4,13 +4,34 @@ module Ci
return
if
job
.
job_artifacts_trace
return
if
job
.
job_artifacts_trace
job
.
trace
.
read
do
|
stream
|
job
.
trace
.
read
do
|
stream
|
if
stream
.
file?
return
unless
stream
.
file?
temp_file!
(
JobArtifactUploader
.
workhorse_upload_path
)
do
|
temp_path
|
FileUtils
.
cp
(
stream
.
path
,
temp_path
)
create_job_trace!
(
temp_path
)
FileUtils
.
rm
(
stream
.
path
)
end
end
end
private
def
create_job_trace!
(
path
)
job
.
create_job_artifacts_trace!
(
job
.
create_job_artifacts_trace!
(
project:
job
.
project
,
project:
job
.
project
,
file_type: :trace
,
file_type: :trace
,
file:
stream
)
file:
UploadedFile
.
new
(
path
,
'build.log'
,
'application/octet-stream'
)
end
)
end
end
def
temp_file!
(
temp_dir
)
FileUtils
.
mkdir_p
(
temp_dir
)
temp_file
=
Tempfile
.
new
(
'file'
,
temp_dir
)
temp_file
&
.
close
yield
(
temp_file
.
path
)
ensure
temp_file
&
.
close
temp_file
&
.
unlink
end
end
end
end
end
end
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