Sha256: 4878b9661f5bfbb690db255576ad1149a0f50f1f67b7723a5e63c7b6f1b70b90
Contents?: true
Size: 975 Bytes
Versions: 11
Compression:
Stored size: 975 Bytes
Contents
require "forwardable" module Buildkite module Builder class PipelineCollection extend Forwardable attr_reader :pipelines def_delegator :@pipelines, :count def_delegator :@pipelines, :each def initialize(artifacts) @artifacts = artifacts @pipelines = [] end def add(pipeline) unless pipeline.is_a?(Buildkite::Builder::Extensions::SubPipelines::Pipeline) raise "`#{pipeline}` must be a Buildkite::Builder::Extensions::SubPipelines::Pipeline" end pipelines << pipeline end def to_definition # Instead of generates pipeline.yml, subpipelines save generated file to artifacts pipelines.each do |pipeline| file = Pathname.new(pipeline.pipeline_yml) file.dirname.mkpath file.write(YAML.dump(Pipelines::Helpers.sanitize(pipeline.to_h))) @artifacts << file end nil end end end end
Version data entries
11 entries across 11 versions & 1 rubygems