Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-05-20 15:18:50 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-06-12 12:06:33 +0300
commit6633fbef4e6c7adaca9b1f1633640f09c3bc90d1 (patch)
tree2122953a28bc483a2573c81dc3f4765ad219c21a /app/models
parent7e5bdb1366237edc2110123fbfd053e6eb62c161 (diff)
Add CI_{PIPELINE,JOB}_URL
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb1
-rw-r--r--app/models/ci/pipeline.rb5
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 2d675726939..41446946a5e 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -611,6 +611,7 @@ module Ci
variables
.concat(pipeline.persisted_variables)
.append(key: 'CI_JOB_ID', value: id.to_s)
+ .append(key: 'CI_JOB_URL', value: Gitlab::Routing.url_helpers.project_job_url(project, self))
.append(key: 'CI_JOB_TOKEN', value: token, public: false)
.append(key: 'CI_BUILD_ID', value: id.to_s)
.append(key: 'CI_BUILD_TOKEN', value: token, public: false)
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index eecd86349e4..689e0ac0ef5 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -548,7 +548,10 @@ module Ci
def persisted_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
- variables.append(key: 'CI_PIPELINE_ID', value: id.to_s) if persisted?
+ break variables unless persisted?
+
+ variables.append(key: 'CI_PIPELINE_ID', value: id.to_s)
+ variables.append(key: 'CI_PIPELINE_URL', value: Gitlab::Routing.url_helpers.project_pipeline_url(project, self))
end
end