diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-02 15:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-02 15:09:15 +0300 |
commit | d10ab00450821139b9b933269454e42ce6e16798 (patch) | |
tree | 199046376ee4cc236c1166e47c2271136f0f8427 /lib/gitlab/ci/pipeline/seed | |
parent | afcacea9362b7990b80696c2e63c2a9100f92ab5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/pipeline/seed')
-rw-r--r-- | lib/gitlab/ci/pipeline/seed/build.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/ci/pipeline/seed/build.rb b/lib/gitlab/ci/pipeline/seed/build.rb index b95a23d2263..722ef1d658e 100644 --- a/lib/gitlab/ci/pipeline/seed/build.rb +++ b/lib/gitlab/ci/pipeline/seed/build.rb @@ -18,6 +18,8 @@ module Gitlab @previous_stages = previous_stages @needs_attributes = dig(:needs_attributes) @resource_group_key = attributes.delete(:resource_group_key) + @job_variables = @seed_attributes.delete(:job_variables) + @root_variables_inheritance = @seed_attributes.delete(:root_variables_inheritance) { true } @using_rules = attributes.key?(:rules) @using_only = attributes.key?(:only) @@ -31,6 +33,8 @@ module Gitlab .new(attributes.delete(:rules), default_when: 'on_success') @cache = Gitlab::Ci::Build::Cache .new(attributes.delete(:cache), @pipeline) + + recalculate_yaml_variables! end def name @@ -207,6 +211,14 @@ module Gitlab { options: { allow_failure_criteria: nil } } end + + def recalculate_yaml_variables! + return unless ::Feature.enabled?(:ci_workflow_rules_variables, default_enabled: :yaml) + + @seed_attributes[:yaml_variables] = Gitlab::Ci::Variables::Helpers.inherit_yaml_variables( + from: @context.root_variables, to: @job_variables, inheritance: @root_variables_inheritance + ) + end end end end |