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:
authorGrzegorz Bizon | off until 20th June <grzegorz@gitlab.com>2018-06-12 15:17:50 +0300
committerGrzegorz Bizon | off until 20th June <grzegorz@gitlab.com>2018-06-12 15:17:50 +0300
commit77247771c96307c2d68cae0cc7da576b2cee109c (patch)
tree1aa8571bf80c6d697efb3f138a94185470e784ae /app/models
parentda874de4e7a929e61d478805dc0dff83f1a5c641 (diff)
parent6633fbef4e6c7adaca9b1f1633640f09c3bc90d1 (diff)
Merge branch 'expose-ci-url' into 'master'
Add CI_{PIPELINE,JOB}_URL See merge request gitlab-org/gitlab-ce!19618
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 0878356e87a..f430f18ca9a 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -549,7 +549,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