summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-06-21 20:22:26 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-06-21 20:22:26 +0800
commit98b60ee29ba99ec28f4c4782a76f52d675eaf083 (patch)
tree559ac3fe247f43356dce7db6f23d932dff16d49e /app/models
parent0d3631acc16b5046ef295bf09204a565cb8580ea (diff)
downloadgitlab-ce-98b60ee29ba99ec28f4c4782a76f52d675eaf083.tar.gz
Expand with all the variables so that things like
CI_ENVIRONMENT_SLUG is also available. It won't be recursive because we're not putting this value in the variables.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 4454057e418..a300536532b 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -471,9 +471,9 @@ module Ci
variables = persisted_environment.predefined_variables
- # Here we're passing unexpanded environment_url for runner to expand,
- # and we need to make sure that CI_ENVIRONMENT_NAME and
- # CI_ENVIRONMENT_SLUG so on are available for the URL be expanded.
+ # Here we're passing unexpanded environment_url for runner to expand,
+ # and we need to make sure that CI_ENVIRONMENT_NAME and
+ # CI_ENVIRONMENT_SLUG so on are available for the URL be expanded.
variables << { key: 'CI_ENVIRONMENT_URL', value: environment_url, public: true } if environment_url
variables
@@ -498,11 +498,7 @@ module Ci
end
def environment_url
- return @environment_url if defined?(@environment_url)
-
- @environment_url =
- options&.dig(:environment, :url) ||
- persisted_environment&.external_url
+ options&.dig(:environment, :url) || persisted_environment&.external_url
end
def build_attributes_from_config