From e04e7181cc6be7a47b634855c77fb0c2c4e53a8b Mon Sep 17 00:00:00 2001 From: "Balasankar \"Balu\" C" Date: Fri, 5 Jul 2019 23:05:19 +0530 Subject: [PATCH] Add CI variable to provide GitLab FQDN Signed-off-by: Balasankar "Balu" C --- app/models/concerns/ci/contextable.rb | 1 + changelogs/unreleased/64161-gitlab-fqdn.yml | 5 +++++ spec/models/ci/build_spec.rb | 1 + 3 files changed, 7 insertions(+) create mode 100644 changelogs/unreleased/64161-gitlab-fqdn.yml diff --git a/app/models/concerns/ci/contextable.rb b/app/models/concerns/ci/contextable.rb index e1d5ce7f7d4..91dda803031 100644 --- a/app/models/concerns/ci/contextable.rb +++ b/app/models/concerns/ci/contextable.rb @@ -59,6 +59,7 @@ module Ci variables.append(key: 'CI', value: 'true') variables.append(key: 'GITLAB_CI', value: 'true') variables.append(key: 'GITLAB_FEATURES', value: project.licensed_features.join(',')) + variables.append(key: 'CI_SERVER_HOST', value: Gitlab.config.gitlab.host) variables.append(key: 'CI_SERVER_NAME', value: 'GitLab') variables.append(key: 'CI_SERVER_VERSION', value: Gitlab::VERSION) variables.append(key: 'CI_SERVER_VERSION_MAJOR', value: Gitlab.version_info.major.to_s) diff --git a/changelogs/unreleased/64161-gitlab-fqdn.yml b/changelogs/unreleased/64161-gitlab-fqdn.yml new file mode 100644 index 00000000000..2946be37caa --- /dev/null +++ b/changelogs/unreleased/64161-gitlab-fqdn.yml @@ -0,0 +1,5 @@ +--- +title: Add CI variable to provide GitLab HOST +merge_request: 30417 +author: +type: added diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index d98db024f73..78862de0657 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2013,6 +2013,7 @@ describe Ci::Build do { key: 'CI', value: 'true', public: true, masked: false }, { key: 'GITLAB_CI', value: 'true', public: true, masked: false }, { key: 'GITLAB_FEATURES', value: project.licensed_features.join(','), public: true, masked: false }, + { key: 'CI_SERVER_HOST', value: Gitlab.config.gitlab.host, public: true, masked: false }, { key: 'CI_SERVER_NAME', value: 'GitLab', public: true, masked: false }, { key: 'CI_SERVER_VERSION', value: Gitlab::VERSION, public: true, masked: false }, { key: 'CI_SERVER_VERSION_MAJOR', value: Gitlab.version_info.major.to_s, public: true, masked: false },