debian-mirror-gitlab/app/controllers/ci/lints_controller.rb

27 lines
611 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
module Ci
2016-11-03 12:29:30 +05:30
class LintsController < ::ApplicationController
2015-09-25 12:07:36 +05:30
before_action :authenticate_user!
def show
end
def create
@content = params[:content]
2016-09-29 09:46:39 +05:30
@error = Ci::GitlabCiYamlProcessor.validation_message(@content)
@status = @error.blank?
2016-09-29 09:46:39 +05:30
if @error.blank?
@config_processor = Ci::GitlabCiYamlProcessor.new(@content)
2015-09-25 12:07:36 +05:30
@stages = @config_processor.stages
@builds = @config_processor.builds
2016-11-03 12:29:30 +05:30
@jobs = @config_processor.jobs
2015-09-25 12:07:36 +05:30
end
2015-11-26 14:37:03 +05:30
rescue
@error = 'Undefined error'
2015-09-25 12:07:36 +05:30
@status = false
ensure
render :show
2015-09-25 12:07:36 +05:30
end
end
end