diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2015-10-01 15:59:39 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2015-10-01 15:59:39 +0300 |
commit | 114853063b3a1747acfe96fa8c8159f4779e291c (patch) | |
tree | e0a315b74c9d2274462fb1f97151aab5abd2a2d0 /app | |
parent | b5654eb4e686793b3562ed5bce31557ce0cc69f8 (diff) | |
parent | 0e548473397f96246f3f70548e48d41fc98ebf00 (diff) |
Merge branch 'ci-fixes' into 'master'
CI: Fix clone url and fix project token removal
- Fixes broken CI clone url on dev.gitlab.org
- Fixes regression in CI token removal
/cc @vsizov @dzaporozhets
See merge request !1481
Diffstat (limited to 'app')
-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 |