Class: Ci::LintsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ci/lints_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

railtie_helpers_paths

Methods inherited from ApplicationController

#redirect_back_or_default

Methods included from PageLayoutHelper

#blank_container, #container_class, #fluid_layout, #header_title, #nav, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_title, #sidebar

Methods included from GitlabRoutingHelper

#activity_project_path, #edit_project_path, #edit_project_url, #issue_path, #issue_url, #merge_request_path, #merge_request_url, #milestone_path, #project_builds_path, #project_commits_path, #project_files_path, #project_path, #project_pipelines_path, #project_snippet_url, #project_url, #runner_path, #runners_path, #toggle_subscription_path

Methods included from Gitlab::GonHelper

#add_gon_variables

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Instance Method Details

#createObject


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/ci/lints_controller.rb', line 8

def create
  @content = params[:content]

  if @content.blank?
    @status = false
    @error = "Please provide content of .gitlab-ci.yml"
  else
    @config_processor = Ci::GitlabCiYamlProcessor.new(@content)
    @stages = @config_processor.stages
    @builds = @config_processor.builds
    @status = true
  end
rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e
  @error = e.message
  @status = false
rescue
  @error = 'Undefined error'
  @status = false
ensure
  render :show
end

#showObject


5
6
# File 'app/controllers/ci/lints_controller.rb', line 5

def show
end