diff options
-rw-r--r-- | app/controllers/lints_controller.rb | 2 | ||||
-rw-r--r-- | lib/gitlab_ci_yaml_processor.rb | 2 | ||||
-rw-r--r-- | spec/features/lint_spec.rb | 3 | ||||
-rw-r--r-- | spec/lib/gitlab_ci_yaml_processor_spec.rb | 6 |
4 files changed, 5 insertions, 8 deletions
diff --git a/app/controllers/lints_controller.rb b/app/controllers/lints_controller.rb index 1a9cd92..2752954 100644 --- a/app/controllers/lints_controller.rb +++ b/app/controllers/lints_controller.rb @@ -17,4 +17,4 @@ class LintsController < ApplicationController @error = "Undefined error" @status = false end -end
\ No newline at end of file +end diff --git a/lib/gitlab_ci_yaml_processor.rb b/lib/gitlab_ci_yaml_processor.rb index 216fb90..32f7938 100644 --- a/lib/gitlab_ci_yaml_processor.rb +++ b/lib/gitlab_ci_yaml_processor.rb @@ -35,7 +35,7 @@ class GitlabCiYamlProcessor def create_commit_for_tag?(ref) normalized_jobs.any?{|job| job[:tags] == true} || - normalized_deploy_jobs.any?{|job| job[:refs].empty? || refs_matches?(job[:refs], ref)} + normalized_deploy_jobs.any?{|job| job[:refs].blank? || refs_matches?(job[:refs].split(",").map(&:strip), ref)} end def deploy_builds_for_ref(ref) diff --git a/spec/features/lint_spec.rb b/spec/features/lint_spec.rb index 8f030d8..9e68d9e 100644 --- a/spec/features/lint_spec.rb +++ b/spec/features/lint_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' describe "Lint" do it "Yaml parsing", js: true do - content = File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) visit lint_path fill_in "content", with: content @@ -14,7 +13,5 @@ describe "Lint" do page.should have_content("Deploy Job - cap deploy") page.should have_content("Deploy Job - Deploy to staging") end - end - end diff --git a/spec/lib/gitlab_ci_yaml_processor_spec.rb b/spec/lib/gitlab_ci_yaml_processor_spec.rb index 2ce140c..22d0d6b 100644 --- a/spec/lib/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/gitlab_ci_yaml_processor_spec.rb @@ -68,7 +68,7 @@ describe GitlabCiYamlProcessor do commands: "\nls", name: "ls", deploy: true, - refs: [], + refs: "", tag_list: "" } end @@ -85,7 +85,7 @@ describe GitlabCiYamlProcessor do commands: "pwd\nls", name: "ls", deploy: true, - refs: [], + refs: "", tag_list: "" } end @@ -102,7 +102,7 @@ describe GitlabCiYamlProcessor do commands: "pwd\nls", name: "Rspec", deploy: true, - refs: ["master", "deploy"], + refs: "master,deploy", tag_list: "" } end |