Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/ci/lints_controller.rb')
-rw-r--r--app/controllers/ci/lints_controller.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/controllers/ci/lints_controller.rb b/app/controllers/ci/lints_controller.rb
new file mode 100644
index 00000000000..62c2ba86e86
--- /dev/null
+++ b/app/controllers/ci/lints_controller.rb
@@ -0,0 +1,26 @@
+module Ci
+ class LintsController < Ci::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 = 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
+ rescue Exception => e
+ @error = "Undefined error"
+ @status = false
+ end
+ end
+end