diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-06 14:18:26 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-06 14:18:26 +0000 |
commit | ab41e9ad6e7e78c1b6dcef59fbde5f31c67c1d43 (patch) | |
tree | f8510c05a98a413f3455c3a5d97cf922c92b9f1e /lib | |
parent | b9d547b12c3731160c456f3f20366e600ab99484 (diff) | |
parent | a2d79e1f2c8186fa69a91717b3d4e71a332d8bbf (diff) | |
download | gitlab-ce-ab41e9ad6e7e78c1b6dcef59fbde5f31c67c1d43.tar.gz |
Merge branch 'feature/sm/artifacts-trace' into 'master'
CE: Trace as artifacts (FileStorage only)
Closes gitlab-ee#4180
See merge request gitlab-org/gitlab-ce!16702
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/trace.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index baf55b1fa07..f2e5124c8a8 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -52,12 +52,14 @@ module Gitlab end def exist? - current_path.present? || old_trace.present? + trace_artifact&.exists? || current_path.present? || old_trace.present? end def read stream = Gitlab::Ci::Trace::Stream.new do - if current_path + if trace_artifact + trace_artifact.open + elsif current_path File.open(current_path, "rb") elsif old_trace StringIO.new(old_trace) @@ -82,6 +84,8 @@ module Gitlab end def erase! + trace_artifact&.destroy + paths.each do |trace_path| FileUtils.rm(trace_path, force: true) end @@ -137,6 +141,10 @@ module Gitlab "#{job.id}.log" ) if job.project&.ci_id end + + def trace_artifact + job.job_artifacts_trace + end end end end |