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
Boxiang Sun
gitlab-ce
Commits
d23b91b0
Commit
d23b91b0
authored
Jun 10, 2016
by
Kamil Trzcinski
Committed by
Phil Hughes
Jun 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve after review
parent
93080b65
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+1
-1
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+2
-2
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+2
-1
No files found.
doc/ci/yaml/README.md
View file @
d23b91b0
...
...
@@ -670,7 +670,7 @@ failure.
**Example configurations**
To upload artifacts only when build fails
To upload artifacts only when build fails
.
```
yaml
job
:
...
...
lib/ci/gitlab_ci_yaml_processor.rb
View file @
d23b91b0
...
...
@@ -208,7 +208,7 @@ module Ci
raise
ValidationError
,
"
#{
name
}
job: allow_failure parameter should be an boolean"
end
if
job
[
:when
]
&&
!
job
[
:when
].
in?
(
%w
(on_success on_failure always)
)
if
job
[
:when
]
&&
!
job
[
:when
].
in?
(
%w
[on_success on_failure always]
)
raise
ValidationError
,
"
#{
name
}
job: when parameter should be on_success, on_failure or always"
end
end
...
...
@@ -279,7 +279,7 @@ module Ci
raise
ValidationError
,
"
#{
name
}
job: artifacts:paths parameter should be an array of strings"
end
if
job
[
:artifacts
][
:when
]
&&
!
job
[
:artifacts
][
:when
].
in?
(
%w
(on_success on_failure always)
)
if
job
[
:artifacts
][
:when
]
&&
!
job
[
:artifacts
][
:when
].
in?
(
%w
[on_success on_failure always]
)
raise
ValidationError
,
"
#{
name
}
job: artifacts:when parameter should be on_success, on_failure or always"
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
d23b91b0
...
...
@@ -608,7 +608,7 @@ module Ci
})
end
%w
(on_success on_failure always)
.
each
do
|
when_state
|
%w
[on_success on_failure always]
.
each
do
|
when_state
|
it
"returns artifacts for when
#{
when_state
}
defined"
do
config
=
YAML
.
dump
({
rspec:
{
...
...
@@ -618,6 +618,7 @@ module Ci
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
builds
=
config_processor
.
builds_for_stage_and_ref
(
"test"
,
"master"
)
expect
(
builds
.
size
).
to
eq
(
1
)
expect
(
builds
.
first
[
:options
][
:artifacts
][
:when
]).
to
eq
(
when_state
)
...
...
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