Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
71a5d5a0
Commit
71a5d5a0
authored
Sep 18, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail builds if no .gitlab-ci.yml is found
parent
a6f2caf7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
CHANGELOG
CHANGELOG
+1
-0
app/models/ci/commit.rb
app/models/ci/commit.rb
+1
-1
spec/services/ci/create_commit_service_spec.rb
spec/services/ci/create_commit_service_spec.rb
+13
-0
No files found.
CHANGELOG
View file @
71a5d5a0
...
@@ -42,6 +42,7 @@ v 8.0.0 (unreleased)
...
@@ -42,6 +42,7 @@ v 8.0.0 (unreleased)
- Retrieving oauth token with LDAP credentials
- Retrieving oauth token with LDAP credentials
- Load Application settings from running database unless env var USE_DB=false
- Load Application settings from running database unless env var USE_DB=false
- Added Drone CI integration (Kirill Zaitsev)
- 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)
- Refactored service API and added automatically service docs generator (Kirill Zaitsev)
- Added web_url key project hook_attrs (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
- Add ability to get user information by ID of an SSH key via the API
...
...
app/models/ci/commit.rb
View file @
71a5d5a0
...
@@ -236,7 +236,7 @@ module Ci
...
@@ -236,7 +236,7 @@ module Ci
end
end
def
config_processor
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
rescue
Ci
::
GitlabCiYamlProcessor
::
ValidationError
=>
e
save_yaml_error
(
e
.
message
)
save_yaml_error
(
e
.
message
)
nil
nil
...
...
spec/services/ci/create_commit_service_spec.rb
View file @
71a5d5a0
...
@@ -50,6 +50,19 @@ module Ci
...
@@ -50,6 +50,19 @@ module Ci
end
end
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
describe
:ci_skip?
do
it
"skips builds creation if there is [ci skip] tag in commit message"
do
it
"skips builds creation if there is [ci skip] tag in commit message"
do
commits
=
[{
message:
"some message[ci skip]"
}]
commits
=
[{
message:
"some message[ci skip]"
}]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment