summaryrefslogtreecommitdiff
path: root/app/controllers/lints_controller.rb
blob: 9d5f445a735e62d8057c43a3349cda993843d6f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class LintsController < ApplicationController
  before_filter :authenticate_user!

  def show
  end

  def create
    if params[:content].blank?
      @status = false
      @error = "Please provide content of .gitlab-ci.yml"
    else
      @config_processor = GitlabCiYamlProcessor.new params[:content]
      @builds = @config_processor.builds
      @deploy_builds = @config_processor.deploy_builds
      @status = true
    end
  rescue GitlabCiYamlProcessor::ValidationError => e
    @error = e.message
    @status = false
  rescue Exception => e
    @error = "Undefined error"
    @status = false
  end
end