2019-12-26 22:10:19 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Pipeline
|
|
|
|
module Chain
|
|
|
|
module Config
|
|
|
|
class Process < Chain::Base
|
|
|
|
include Chain::Helpers
|
|
|
|
|
|
|
|
def perform!
|
|
|
|
raise ArgumentError, 'missing config content' unless @command.config_content
|
|
|
|
|
|
|
|
@command.config_processor = ::Gitlab::Ci::YamlProcessor.new(
|
|
|
|
@command.config_content, {
|
|
|
|
project: project,
|
|
|
|
sha: @pipeline.sha,
|
2020-04-08 14:13:33 +05:30
|
|
|
user: current_user,
|
|
|
|
parent_pipeline: parent_pipeline
|
2019-12-26 22:10:19 +05:30
|
|
|
}
|
|
|
|
)
|
|
|
|
rescue Gitlab::Ci::YamlProcessor::ValidationError => ex
|
|
|
|
error(ex.message, config_error: true)
|
|
|
|
rescue => ex
|
2020-01-01 13:55:28 +05:30
|
|
|
Gitlab::ErrorTracking.track_exception(ex,
|
2019-12-26 22:10:19 +05:30
|
|
|
project_id: project.id,
|
|
|
|
sha: @pipeline.sha
|
2020-01-01 13:55:28 +05:30
|
|
|
)
|
2019-12-26 22:10:19 +05:30
|
|
|
|
|
|
|
error("Undefined error (#{Labkit::Correlation::CorrelationId.current_id})",
|
|
|
|
config_error: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
def break?
|
|
|
|
@pipeline.errors.any? || @pipeline.persisted?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|