debian-mirror-gitlab/lib/gitlab/ci/pipeline/chain/seed_block.rb

28 lines
615 B
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class SeedBlock < Chain::Base
include Chain::Helpers
include Gitlab::Utils::StrongMemoize
def perform!
##
# Populate pipeline with block argument of CreatePipelineService#execute.
#
@command.seeds_block&.call(pipeline)
raise "Pipeline cannot be persisted by `seeds_block`" if pipeline.persisted?
end
def break?
pipeline.errors.any?
end
end
end
end
end
end