gitlab-org--gitlab-foss/app/controllers/ci/lints_controller.rb

27 lines
611 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
module Ci
class LintsController < ::ApplicationController
2015-09-14 07:37:18 -04:00
before_action :authenticate_user!
2015-08-25 21:42:46 -04:00
def show
end
def create
@content = params[:content]
2016-08-29 09:07:19 -04:00
@error = Ci::GitlabCiYamlProcessor.validation_message(@content)
2016-08-30 09:38:36 -04:00
@status = @error.blank?
2016-08-30 09:38:36 -04:00
if @error.blank?
@config_processor = Ci::GitlabCiYamlProcessor.new(@content)
2015-08-25 21:42:46 -04:00
@stages = @config_processor.stages
@builds = @config_processor.builds
2016-09-20 09:19:55 -04:00
@jobs = @config_processor.jobs
2015-08-25 21:42:46 -04:00
end
rescue
@error = 'Undefined error'
2015-08-25 21:42:46 -04:00
@status = false
ensure
render :show
2015-08-25 21:42:46 -04:00
end
end
end