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
1
Merge Requests
1
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
nexedi
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.
...
@@ -670,7 +670,7 @@ failure.
**Example configurations**
**Example configurations**
To upload artifacts only when build fails
To upload artifacts only when build fails
.
```
yaml
```
yaml
job
:
job
:
...
...
lib/ci/gitlab_ci_yaml_processor.rb
View file @
d23b91b0
...
@@ -208,7 +208,7 @@ module Ci
...
@@ -208,7 +208,7 @@ module Ci
raise
ValidationError
,
"
#{
name
}
job: allow_failure parameter should be an boolean"
raise
ValidationError
,
"
#{
name
}
job: allow_failure parameter should be an boolean"
end
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"
raise
ValidationError
,
"
#{
name
}
job: when parameter should be on_success, on_failure or always"
end
end
end
end
...
@@ -279,7 +279,7 @@ module Ci
...
@@ -279,7 +279,7 @@ module Ci
raise
ValidationError
,
"
#{
name
}
job: artifacts:paths parameter should be an array of strings"
raise
ValidationError
,
"
#{
name
}
job: artifacts:paths parameter should be an array of strings"
end
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"
raise
ValidationError
,
"
#{
name
}
job: artifacts:when parameter should be on_success, on_failure or always"
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
d23b91b0
...
@@ -608,7 +608,7 @@ module Ci
...
@@ -608,7 +608,7 @@ module Ci
})
})
end
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
it
"returns artifacts for when
#{
when_state
}
defined"
do
config
=
YAML
.
dump
({
config
=
YAML
.
dump
({
rspec:
{
rspec:
{
...
@@ -618,6 +618,7 @@ module Ci
...
@@ -618,6 +618,7 @@ module Ci
})
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
builds
=
config_processor
.
builds_for_stage_and_ref
(
"test"
,
"master"
)
builds
=
config_processor
.
builds_for_stage_and_ref
(
"test"
,
"master"
)
expect
(
builds
.
size
).
to
eq
(
1
)
expect
(
builds
.
size
).
to
eq
(
1
)
expect
(
builds
.
first
[
:options
][
:artifacts
][
:when
]).
to
eq
(
when_state
)
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