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:
authorLin Jen-Shin <godfat@godfat.org>2017-06-21 13:25:27 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-06-21 13:25:27 +0300
commitdf095d7df66aad3e51df5bd07ecdd4758391ced4 (patch)
tree854139ce885f76f1bf887df0b6a078787b93d994
parent1a193d042a8bff1e5cfefd103baa8286d8a4c9b5 (diff)
Add comments to explain some culprit; Add changelog
-rw-r--r--app/models/ci/build.rb11
-rw-r--r--changelogs/unreleased/34008-fix-CI_ENVIRONMENT_URL-2.yml4
2 files changed, 13 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 3acdfb46d39..9e38a916a2e 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -192,7 +192,7 @@ module Ci
slugified.gsub(/[^a-z0-9]/, '-')[0..62]
end
- # Variables whose value does not depend on other variables
+ # Variables whose value does not depend on environment
def simple_variables
variables = predefined_variables
variables += project.predefined_variables
@@ -207,7 +207,8 @@ module Ci
variables
end
- # All variables, including those dependent on other variables
+ # All variables, including those dependent on environment, which could
+ # contain unexpanded variables.
def variables
simple_variables.concat(persisted_environment_variables)
end
@@ -482,6 +483,12 @@ module Ci
variables = persisted_environment.predefined_variables
if url = environment_url
+ # Note that CI_ENVIRONMENT_URL should be the last variable, because
+ # here we're passing unexpanded environment_url for runner to expand,
+ # and the runner would expand in order. In order to make sure that
+ # CI_ENVIRONMENT_URL has everything available, such as variables
+ # from Environment#predefined_variables, we need to make sure it's
+ # the last variable.
variables << { key: 'CI_ENVIRONMENT_URL', value: url, public: true }
end
diff --git a/changelogs/unreleased/34008-fix-CI_ENVIRONMENT_URL-2.yml b/changelogs/unreleased/34008-fix-CI_ENVIRONMENT_URL-2.yml
new file mode 100644
index 00000000000..7f4d6e3bc67
--- /dev/null
+++ b/changelogs/unreleased/34008-fix-CI_ENVIRONMENT_URL-2.yml
@@ -0,0 +1,4 @@
+---
+title: Fix passing CI_ENVIRONMENT_NAME and CI_ENVIRONMENT_SLUG for CI_ENVIRONMENT_URL
+merge_request: 12344
+author: