2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Pipeline
|
|
|
|
module Chain
|
|
|
|
module Validate
|
|
|
|
class Config < Chain::Base
|
|
|
|
include Chain::Helpers
|
|
|
|
|
|
|
|
def perform!
|
|
|
|
unless @pipeline.config_processor
|
|
|
|
unless @pipeline.ci_yaml_file
|
|
|
|
return error("Missing #{@pipeline.ci_yaml_file_path} file")
|
|
|
|
end
|
|
|
|
|
|
|
|
if @command.save_incompleted && @pipeline.has_yaml_errors?
|
|
|
|
@pipeline.drop!(:config_error)
|
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
error(@pipeline.yaml_errors)
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def break?
|
|
|
|
@pipeline.errors.any? || @pipeline.persisted?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|