Commit 43b492ec authored by Kamil Trzciński's avatar Kamil Trzciński Committed by Grzegorz Bizon

Extract class responsible for building a pipeline / EE

See merge request gitlab-org/gitlab-ee!3602

Conflicts:
	app/services/ci/create_pipeline_service.rb
parent 954105e8
......@@ -11,25 +11,7 @@ module Ci
Gitlab::Ci::Pipeline::Chain::Create,
EE::Gitlab::Ci::Pipeline::Chain::Limit::Activity].freeze
<<<<<<< HEAD
def execute(source, ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, mirror_update: false, &block)
@pipeline = Ci::Pipeline.new(
source: source,
project: project,
ref: ref,
sha: sha,
before_sha: before_sha,
tag: tag_exists?,
trigger_requests: Array(trigger_request),
user: current_user,
pipeline_schedule: schedule,
protected: project.protected_for?(ref)
)
# VALIDATE mirror_update!
command = OpenStruct.new(ignore_skip_ci: ignore_skip_ci,
=======
def execute(source, ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, &block)
@pipeline = Ci::Pipeline.new
command = OpenStruct.new(source: source,
......@@ -40,7 +22,6 @@ module Ci
trigger_request: trigger_request,
schedule: schedule,
ignore_skip_ci: ignore_skip_ci,
>>>>>>> upstream/master
save_incompleted: save_on_errors,
allow_mirror_update: mirror_update,
seeds_block: block,
......
......@@ -5,20 +5,19 @@ module Gitlab
class Sequence
def initialize(pipeline, command, sequence)
@pipeline = pipeline
@command = command
@sequence = sequence
@completed = []
@sequence = sequence.map do |chain|
chain.new(pipeline, command)
end
end
def build!
@sequence.each do |step|
step.perform!
@sequence.each do |chain|
step = chain.new(@pipeline, @command)
step.perform!
break if step.break?
@completed << step
@completed.push(step)
end
@pipeline.tap do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment