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
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
...
@@ -720,7 +720,7 @@ module API
end
end
class
Step
<
Grape
::
Entity
class
Step
<
Grape
::
Entity
expose
:name
,
:script
,
:timeout
,
:
condition
,
:result
expose
:name
,
:script
,
:timeout
,
:
when
,
:allow_failure
end
end
class
Image
<
Grape
::
Entity
class
Image
<
Grape
::
Entity
...
...
lib/gitlab/ci/build/response/step.rb
View file @
fb8210ad
...
@@ -3,21 +3,19 @@ module Gitlab
...
@@ -3,21 +3,19 @@ module Gitlab
module
Build
module
Build
module
Response
module
Response
class
Step
class
Step
CONDITION_IF_SUCCEEDED
=
'run_if_succeeded'
CONDITION_ON_FAILURE
=
'on_failure'
CONDITION_ALWAYS
=
'run_always'
CONDITION_ON_SUCCESS
=
'on_success'
CONDITION_ALWAYS
=
'always'
RESULT_FAILS_JOB
=
'fails_job'
attr_reader
:name
,
:script
,
:when
,
:allow_failure
,
:timeout
RESULT_DOESNT_FAIL_JOB
=
'doesnt_fail_job'
attr_reader
:name
,
:script
,
:condition
,
:result
,
:timeout
class
<<
self
class
<<
self
def
from_commands
(
build
)
def
from_commands
(
build
)
self
.
new
(
:script
,
self
.
new
(
:script
,
build
.
commands
,
build
.
commands
,
build
.
timeout
,
build
.
timeout
,
CONDITION_
IF_SUCCEEDED
,
CONDITION_
ON_SUCCESS
,
RESULT_FAILS_JOB
)
false
)
end
end
def
from_after_script
(
build
)
def
from_after_script
(
build
)
...
@@ -28,16 +26,16 @@ module Gitlab
...
@@ -28,16 +26,16 @@ module Gitlab
after_script
,
after_script
,
build
.
timeout
,
build
.
timeout
,
CONDITION_ALWAYS
,
CONDITION_ALWAYS
,
RESULT_DOESNT_FAIL_JOB
)
true
)
end
end
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
@name
=
name
@script
=
script
.
split
(
"
\n
"
)
@script
=
script
.
split
(
"
\n
"
)
@timeout
=
timeout
@timeout
=
timeout
@
condition
=
condition
@
when
=
when_
condition
@
result
=
result
@
allow_failure
=
allow_failure
end
end
end
end
end
end
...
...
spec/requests/api/runner_spec.rb
View file @
fb8210ad
...
@@ -283,8 +283,8 @@ describe API::Runner do
...
@@ -283,8 +283,8 @@ describe API::Runner do
expect
(
json_response
[
'steps'
]).
to
include
({
'name'
=>
'after_script'
,
expect
(
json_response
[
'steps'
]).
to
include
({
'name'
=>
'after_script'
,
'script'
=>
[
'ls'
,
'date'
],
'script'
=>
[
'ls'
,
'date'
],
'timeout'
=>
job
.
timeout
,
'timeout'
=>
job
.
timeout
,
'
condition'
=>
Gitlab
::
Ci
::
Build
::
Response
::
Step
::
CONDITION_ALWAYS
,
'
when'
=>
'always'
,
'
result'
=>
Gitlab
::
Ci
::
Build
::
Response
::
Step
::
RESULT_DOESNT_FAIL_JOB
})
'
allow_failure'
=>
true
})
expect
(
json_response
[
'variables'
]).
to
include
({
'key'
=>
'CI_BUILD_NAME'
,
'value'
=>
'spinach'
,
'public'
=>
true
},
expect
(
json_response
[
'variables'
]).
to
include
({
'key'
=>
'CI_BUILD_NAME'
,
'value'
=>
'spinach'
,
'public'
=>
true
},
{
'key'
=>
'CI_BUILD_STAGE'
,
'value'
=>
'test'
,
'public'
=>
true
},
{
'key'
=>
'CI_BUILD_STAGE'
,
'value'
=>
'test'
,
'public'
=>
true
},
{
'key'
=>
'DB_NAME'
,
'value'
=>
'postgres'
,
'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