提交 71a5d5a0 编写于 作者: K Kamil Trzcinski

Fail builds if no .gitlab-ci.yml is found

上级 a6f2caf7
......@@ -42,6 +42,7 @@ v 8.0.0 (unreleased)
- Retrieving oauth token with LDAP credentials
- Load Application settings from running database unless env var USE_DB=false
- Added Drone CI integration (Kirill Zaitsev)
- Fail builds if no .gitlab-ci.yml is found
- Refactored service API and added automatically service docs generator (Kirill Zaitsev)
- Added web_url key project hook_attrs (Kirill Zaitsev)
- Add ability to get user information by ID of an SSH key via the API
......
......@@ -236,7 +236,7 @@ module Ci
end
def config_processor
@config_processor ||= Ci::GitlabCiYamlProcessor.new(push_data[:ci_yaml_file] || project.generated_yaml_config)
@config_processor ||= Ci::GitlabCiYamlProcessor.new(push_data[:ci_yaml_file])
rescue Ci::GitlabCiYamlProcessor::ValidationError => e
save_yaml_error(e.message)
nil
......
......@@ -50,6 +50,19 @@ module Ci
end
end
it 'fails commits without .gitlab-ci.yml' do
result = service.execute(project,
ref: 'refs/heads/0_1',
before: '00000000',
after: '31das312',
ci_yaml_file: config,
commits: [ { message: 'Message'} ]
)
expect(result).to be_persisted
expect(result.builds.any?).to be_falsey
expect(result.status).to eq('failed')
end
describe :ci_skip? do
it "skips builds creation if there is [ci skip] tag in commit message" do
commits = [{ message: "some message[ci skip]" }]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册