Commit dc975525 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Merge branch 'ci-commit-as-pipeline' into with-pipeline-view

parents 21136baa 5117412e
...@@ -138,7 +138,10 @@ module Ci ...@@ -138,7 +138,10 @@ module Ci
def config_processor def config_processor
return nil unless ci_yaml_file return nil unless ci_yaml_file
@config_processor ||= Ci::GitlabCiYamlProcessor.new(ci_yaml_file, project.path_with_namespace) return @config_processor if defined?(@config_processor)
@config_processor ||= begin
Ci::GitlabCiYamlProcessor.new(ci_yaml_file, project.path_with_namespace)
rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e
save_yaml_error(e.message) save_yaml_error(e.message)
nil nil
...@@ -146,17 +149,19 @@ module Ci ...@@ -146,17 +149,19 @@ module Ci
save_yaml_error("Undefined error") save_yaml_error("Undefined error")
nil nil
end end
end
def ci_yaml_file def ci_yaml_file
return nil if defined?(@ci_yaml_file) return @ci_yaml_file if defined?(@ci_yaml_file)
@ci_yaml_file ||= begin @ci_yaml_file ||= begin
blob = project.repository.blob_at(sha, '.gitlab-ci.yml') blob = project.repository.blob_at(sha, '.gitlab-ci.yml')
blob.load_all_data!(project.repository) blob.load_all_data!(project.repository)
blob.data blob.data
end
rescue rescue
nil nil
end end
end
def skip_ci? def skip_ci?
git_commit_message =~ /(\[ci skip\])/ if git_commit_message git_commit_message =~ /(\[ci skip\])/ if git_commit_message
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment