Class: Gitlab::Ci::Pipeline::Seed::Pipeline
- Inherits:
-
Object
- Object
- Gitlab::Ci::Pipeline::Seed::Pipeline
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/pipeline/seed/pipeline.rb
Instance Method Summary collapse
- #deployments_count ⇒ Object
- #errors ⇒ Object
-
#initialize(context, stages_attributes) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #root_variables ⇒ Object
- #size ⇒ Object
- #stages ⇒ Object
Constructor Details
#initialize(context, stages_attributes) ⇒ Pipeline
Returns a new instance of Pipeline.
10 11 12 13 |
# File 'lib/gitlab/ci/pipeline/seed/pipeline.rb', line 10 def initialize(context, stages_attributes) @context = context @stages_attributes = stages_attributes end |
Instance Method Details
#deployments_count ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/gitlab/ci/pipeline/seed/pipeline.rb', line 27 def deployments_count stage_seeds.sum do |stage_seed| stage_seed.seeds.count do |build_seed| build_seed.attributes[:environment].present? end end end |
#errors ⇒ Object
15 16 17 |
# File 'lib/gitlab/ci/pipeline/seed/pipeline.rb', line 15 def errors stage_seeds.flat_map(&:errors).compact.presence end |
#root_variables ⇒ Object
35 36 37 |
# File 'lib/gitlab/ci/pipeline/seed/pipeline.rb', line 35 def root_variables @context.root_variables end |
#size ⇒ Object
23 24 25 |
# File 'lib/gitlab/ci/pipeline/seed/pipeline.rb', line 23 def size stage_seeds.sum(&:size) end |
#stages ⇒ Object
19 20 21 |
# File 'lib/gitlab/ci/pipeline/seed/pipeline.rb', line 19 def stages stage_seeds.map(&:to_resource) end |