diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-01 12:43:06 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-01 12:43:06 +0300 |
commit | 0e548473397f96246f3f70548e48d41fc98ebf00 (patch) | |
tree | 85f5c2d5ed02d7d02cec2c0354fd3dd63b7c0d15 /app | |
parent | 9d8257238ee1a28d90958e6f8f43921b172f14a1 (diff) |
Fix: CI token removal regression from build trace
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/build.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index cda4fdd4982..19f957eb965 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -143,12 +143,6 @@ module Ci html ||= '' end - def trace - if project && read_attribute(:trace).present? - read_attribute(:trace).gsub(project.token, 'xxxxxx') - end - end - def started? !pending? && !canceled? && started_at end @@ -223,7 +217,7 @@ module Ci end end - def trace + def raw_trace if File.exist?(path_to_trace) File.read(path_to_trace) else @@ -232,6 +226,15 @@ module Ci end end + def trace + trace = raw_trace + if project && trace.present? + trace.gsub(project.token, 'xxxxxx') + else + trace + end + end + def trace=(trace) unless Dir.exists? dir_to_trace FileUtils.mkdir_p dir_to_trace |