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

27 lines
660 B
Ruby
Raw Normal View History

2015-08-26 01:42:46 +00:00
module Ci
class LintsController < Ci::ApplicationController
2015-09-14 11:37:18 +00:00
before_action :authenticate_user!
2015-08-26 01:42:46 +00:00
def show
end
def create
if params[:content].blank?
@status = false
@error = "Please provide content of .gitlab-ci.yml"
else
@config_processor = Ci::GitlabCiYamlProcessor.new params[:content]
@stages = @config_processor.stages
@builds = @config_processor.builds
@status = true
end
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
@error = e.message
@status = false
2015-10-03 05:56:37 +00:00
rescue Exception
2015-08-26 01:42:46 +00:00
@error = "Undefined error"
@status = false
end
end
end