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:
Diffstat (limited to 'lib/gitlab/ci/variables/builder/pipeline.rb')
-rw-r--r--lib/gitlab/ci/variables/builder/pipeline.rb27
1 files changed, 1 insertions, 26 deletions
diff --git a/lib/gitlab/ci/variables/builder/pipeline.rb b/lib/gitlab/ci/variables/builder/pipeline.rb
index 1e7a18d70b0..c3b0cb856ba 100644
--- a/lib/gitlab/ci/variables/builder/pipeline.rb
+++ b/lib/gitlab/ci/variables/builder/pipeline.rb
@@ -40,7 +40,7 @@ module Gitlab
attr_reader :pipeline
- def predefined_commit_variables # rubocop:disable Metrics/AbcSize - Remove this rubocop:disable when FF `ci_remove_legacy_predefined_variables` is removed.
+ def predefined_commit_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
next variables unless pipeline.sha.present?
@@ -56,24 +56,10 @@ module Gitlab
variables.append(key: 'CI_COMMIT_REF_PROTECTED', value: (!!pipeline.protected_ref?).to_s)
variables.append(key: 'CI_COMMIT_TIMESTAMP', value: pipeline.git_commit_timestamp.to_s)
variables.append(key: 'CI_COMMIT_AUTHOR', value: pipeline.git_author_full_text.to_s)
-
- if Feature.disabled?(:ci_remove_legacy_predefined_variables, pipeline.project)
- variables.concat(legacy_predefined_commit_variables)
- end
end
end
strong_memoize_attr :predefined_commit_variables
- def legacy_predefined_commit_variables
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- variables.append(key: 'CI_BUILD_REF', value: pipeline.sha)
- variables.append(key: 'CI_BUILD_BEFORE_SHA', value: pipeline.before_sha)
- variables.append(key: 'CI_BUILD_REF_NAME', value: pipeline.source_ref)
- variables.append(key: 'CI_BUILD_REF_SLUG', value: pipeline.source_ref_slug)
- end
- end
- strong_memoize_attr :legacy_predefined_commit_variables
-
def predefined_commit_tag_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
git_tag = pipeline.project.repository.find_tag(pipeline.ref)
@@ -82,21 +68,10 @@ module Gitlab
variables.append(key: 'CI_COMMIT_TAG', value: pipeline.ref)
variables.append(key: 'CI_COMMIT_TAG_MESSAGE', value: git_tag.message)
-
- if Feature.disabled?(:ci_remove_legacy_predefined_variables, pipeline.project)
- variables.concat(legacy_predefined_commit_tag_variables)
- end
end
end
strong_memoize_attr :predefined_commit_tag_variables
- def legacy_predefined_commit_tag_variables
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- variables.append(key: 'CI_BUILD_TAG', value: pipeline.ref)
- end
- end
- strong_memoize_attr :legacy_predefined_commit_tag_variables
-
def predefined_merge_request_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.append(key: 'CI_MERGE_REQUEST_EVENT_TYPE', value: pipeline.merge_request_event_type.to_s)