BigW Consortium Gitlab

lints_controller.rb 570 Bytes
Newer Older
1
module Ci
2
  class LintsController < ApplicationController
Valery Sizov committed
3
    before_action :authenticate_user!
4 5 6 7 8

    def show
    end

    def create
9
      @content = params[:content]
Katarzyna Kobierska committed
10
      @error = Ci::GitlabCiYamlProcessor.validation_message(@content)
Katarzyna Kobierska committed
11
      @status = @error.blank?
12

Katarzyna Kobierska committed
13
      if @error.blank?
14
        @config_processor = Ci::GitlabCiYamlProcessor.new(@content)
15 16 17
        @stages = @config_processor.stages
        @builds = @config_processor.builds
      end
18
    rescue
19
      @error = 'Undefined error'
20
      @status = false
21 22
    ensure
      render :show
23 24 25
    end
  end
end