diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 17 | ||||
-rw-r--r-- | app/models/ci/project.rb | 3 |
2 files changed, 11 insertions, 9 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 diff --git a/app/models/ci/project.rb b/app/models/ci/project.rb index f0a8fc703b5..24f70171094 100644 --- a/app/models/ci/project.rb +++ b/app/models/ci/project.rb @@ -169,8 +169,7 @@ module Ci # using http and basic auth def repo_url_with_auth auth = "gitlab-ci-token:#{token}@" - url = http_url_to_repo + ".git" - url.sub(/^https?:\/\//) do |prefix| + http_url_to_repo.sub(/^https?:\/\//) do |prefix| prefix + auth end end |