gitlab-org--gitlab-foss/app/controllers/ci/lints_controller.rb
Takuya Noguchi 36bf0b67e5
Remove Ci::ApplicationController
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-10 16:47:27 +02:00

26 lines
611 B
Ruby

module Ci
class LintsController < ::ApplicationController
before_action :authenticate_user!
def show
end
def create
@content = params[:content]
@error = Ci::GitlabCiYamlProcessor.validation_message(@content)
@status = @error.blank?
if @error.blank?
@config_processor = Ci::GitlabCiYamlProcessor.new(@content)
@stages = @config_processor.stages
@builds = @config_processor.builds
@jobs = @config_processor.jobs
end
rescue
@error = 'Undefined error'
@status = false
ensure
render :show
end
end
end