Class: Gitlab::Ci::Build::Context::Global
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/build/context/global.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(pipeline, yaml_variables:, logger:) ⇒ Global
constructor
A new instance of Global.
- #variables ⇒ Object
Methods inherited from Base
#project, #sha, #variables_hash, #variables_hash_expanded, #variables_sorted_and_expanded
Constructor Details
#initialize(pipeline, yaml_variables:, logger:) ⇒ Global
Returns a new instance of Global.
10 11 12 13 14 |
# File 'lib/gitlab/ci/build/context/global.rb', line 10 def initialize(pipeline, yaml_variables:, logger:) super(pipeline, logger: logger) @yaml_variables = yaml_variables.to_a end |
Instance Method Details
#variables ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/gitlab/ci/build/context/global.rb', line 16 def variables strong_memoize(:variables) do # This is a temporary piece of technical debt to allow us access # to the CI variables to evaluate workflow:rules # with the result. We should refactor away the extra Build.new, # but be able to get CI Variables directly from the Seed::Build. stub_build.scoped_variables.reject { |var| var[:key] =~ /\ACI_(JOB|BUILD)/ } end end |