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
Léo-Paul Géneau
gitlab-ce
Commits
fb8210ad
Commit
fb8210ad
authored
Feb 27, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update step data naming
parent
65564598
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/gitlab/ci/build/response/step.rb
lib/gitlab/ci/build/response/step.rb
+10
-12
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+2
-2
No files found.
lib/api/entities.rb
View file @
fb8210ad
...
...
@@ -720,7 +720,7 @@ module API
end
class
Step
<
Grape
::
Entity
expose
:name
,
:script
,
:timeout
,
:
condition
,
:result
expose
:name
,
:script
,
:timeout
,
:
when
,
:allow_failure
end
class
Image
<
Grape
::
Entity
...
...
lib/gitlab/ci/build/response/step.rb
View file @
fb8210ad
...
...
@@ -3,21 +3,19 @@ module Gitlab
module
Build
module
Response
class
Step
CONDITION_IF_SUCCEEDED
=
'run_if_succeeded'
CONDITION_ALWAYS
=
'run_always'
CONDITION_ON_FAILURE
=
'on_failure'
CONDITION_ON_SUCCESS
=
'on_success'
CONDITION_ALWAYS
=
'always'
RESULT_FAILS_JOB
=
'fails_job'
RESULT_DOESNT_FAIL_JOB
=
'doesnt_fail_job'
attr_reader
:name
,
:script
,
:condition
,
:result
,
:timeout
attr_reader
:name
,
:script
,
:when
,
:allow_failure
,
:timeout
class
<<
self
def
from_commands
(
build
)
self
.
new
(
:script
,
build
.
commands
,
build
.
timeout
,
CONDITION_
IF_SUCCEEDED
,
RESULT_FAILS_JOB
)
CONDITION_
ON_SUCCESS
,
false
)
end
def
from_after_script
(
build
)
...
...
@@ -28,16 +26,16 @@ module Gitlab
after_script
,
build
.
timeout
,
CONDITION_ALWAYS
,
RESULT_DOESNT_FAIL_JOB
)
true
)
end
end
def
initialize
(
name
,
script
,
timeout
,
condition
=
CONDITION_IF_SUCCEEDED
,
result
=
RESULT_FAILS_JOB
)
def
initialize
(
name
,
script
,
timeout
,
when_condition
=
CONDITION_ON_SUCCESS
,
allow_failure
=
true
)
@name
=
name
@script
=
script
.
split
(
"
\n
"
)
@timeout
=
timeout
@
condition
=
condition
@
result
=
result
@
when
=
when_
condition
@
allow_failure
=
allow_failure
end
end
end
...
...
spec/requests/api/runner_spec.rb
View file @
fb8210ad
...
...
@@ -283,8 +283,8 @@ describe API::Runner do
expect
(
json_response
[
'steps'
]).
to
include
({
'name'
=>
'after_script'
,
'script'
=>
[
'ls'
,
'date'
],
'timeout'
=>
job
.
timeout
,
'
condition'
=>
Gitlab
::
Ci
::
Build
::
Response
::
Step
::
CONDITION_ALWAYS
,
'
result'
=>
Gitlab
::
Ci
::
Build
::
Response
::
Step
::
RESULT_DOESNT_FAIL_JOB
})
'
when'
=>
'always'
,
'
allow_failure'
=>
true
})
expect
(
json_response
[
'variables'
]).
to
include
({
'key'
=>
'CI_BUILD_NAME'
,
'value'
=>
'spinach'
,
'public'
=>
true
},
{
'key'
=>
'CI_BUILD_STAGE'
,
'value'
=>
'test'
,
'public'
=>
true
},
{
'key'
=>
'DB_NAME'
,
'value'
=>
'postgres'
,
'public'
=>
true
})
...
...
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