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
1bbf2c2c
Commit
1bbf2c2c
authored
Feb 28, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop offenses
parent
f7d35234
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
lib/api/helpers/runner.rb
lib/api/helpers/runner.rb
+2
-2
lib/api/runner.rb
lib/api/runner.rb
+7
-9
lib/gitlab/ci/build/response/step.rb
lib/gitlab/ci/build/response/step.rb
+3
-3
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+5
-3
No files found.
lib/api/helpers/runner.rb
View file @
1bbf2c2c
module
API
module
Helpers
module
Runner
JOB_TOKEN_HEADER
=
'HTTP_JOB_TOKEN'
JOB_TOKEN_HEADER
=
'HTTP_JOB_TOKEN'
.
freeze
JOB_TOKEN_PARAM
=
:token
UPDATE_RUNNER_EVERY
=
10
*
60
...
...
@@ -42,7 +42,7 @@ module API
end
def
job_not_found!
if
headers
[
'User-Agent'
].
to_s
.
match
(
/gitlab(-ci-multi)?-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /
)
if
headers
[
'User-Agent'
].
to_s
=~
/gitlab(-ci-multi)?-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /
no_content!
else
not_found!
...
...
lib/api/runner.rb
View file @
1bbf2c2c
...
...
@@ -94,7 +94,7 @@ module API
end
params
do
requires
:token
,
type:
String
,
desc:
%q(Runners's authentication token)
requires
:id
,
type:
Fixnum
,
desc:
%q(Job's ID)
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:trace
,
type:
String
,
desc:
%q(Job's full trace)
optional
:state
,
type:
String
,
desc:
%q(Job's status: success, failed)
end
...
...
@@ -122,7 +122,7 @@ module API
[
416
,
'Range not satisfiable'
]]
end
params
do
requires
:id
,
type:
Fixnum
,
desc:
%q(Job's ID)
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:token
,
type:
String
,
desc:
%q(Job's authentication token)
end
patch
'/:id/trace'
do
...
...
@@ -152,9 +152,9 @@ module API
[
413
,
'File too large'
]]
end
params
do
requires
:id
,
type:
Fixnum
,
desc:
%q(Job's ID)
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:token
,
type:
String
,
desc:
%q(Job's authentication token)
optional
:filesize
,
type:
Fixnum
,
desc:
%q(AR
tifacts filesize)
optional
:filesize
,
type:
Integer
,
desc:
%q(Ar
tifacts filesize)
end
post
'/:id/artifacts/authorize'
do
not_allowed!
unless
Gitlab
.
config
.
artifacts
.
enabled
...
...
@@ -183,7 +183,7 @@ module API
[
413
,
'File too large'
]]
end
params
do
requires
:id
,
type:
Fixnum
,
desc:
%q(Job's ID)
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:token
,
type:
String
,
desc:
%q(Job's authentication token)
optional
:expire_in
,
type:
String
,
desc:
%q(Specify when artifacts should expire)
optional
'file'
,
type:
File
,
desc:
%q(Artifact's file)
...
...
@@ -211,9 +211,7 @@ module API
job
.
artifacts_file
=
artifacts
job
.
artifacts_metadata
=
metadata
job
.
artifacts_expire_in
=
params
[
'expire_in'
]
||
Gitlab
::
CurrentSettings
.
current_application_settings
.
default_artifacts_expire_in
Gitlab
::
CurrentSettings
.
current_application_settings
.
default_artifacts_expire_in
if
job
.
save
present
job
,
with:
Entities
::
JobRequest
::
Response
...
...
@@ -228,7 +226,7 @@ module API
[
404
,
'Artifact not found'
]]
end
params
do
requires
:id
,
type:
Fixnum
,
desc:
%q(Job's ID)
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:token
,
type:
String
,
desc:
%q(Job's authentication token)
end
get
'/:id/artifacts'
do
...
...
lib/gitlab/ci/build/response/step.rb
View file @
1bbf2c2c
...
...
@@ -3,9 +3,9 @@ module Gitlab
module
Build
module
Response
class
Step
CONDITION_ON_FAILURE
=
'on_failure'
CONDITION_ON_SUCCESS
=
'on_success'
CONDITION_ALWAYS
=
'always'
CONDITION_ON_FAILURE
=
'on_failure'
.
freeze
CONDITION_ON_SUCCESS
=
'on_success'
.
freeze
CONDITION_ALWAYS
=
'always'
.
freeze
attr_reader
:name
,
:script
,
:when
,
:allow_failure
,
:timeout
...
...
spec/requests/api/runner_spec.rb
View file @
1bbf2c2c
...
...
@@ -281,7 +281,7 @@ describe API::Runner do
expect
(
json_response
[
'image'
]).
to
include
({
'name'
=>
'ruby:2.1'
})
expect
(
json_response
[
'services'
]).
to
include
({
'name'
=>
'postgres'
})
expect
(
json_response
[
'steps'
]).
to
include
({
'name'
=>
'after_script'
,
'script'
=>
[
'ls'
,
'date'
]
,
'script'
=>
%w(ls date)
,
'timeout'
=>
job
.
timeout
,
'when'
=>
'always'
,
'allow_failure'
=>
true
})
...
...
@@ -889,9 +889,11 @@ describe API::Runner do
end
def
upload_artifacts
(
file
,
headers
=
{},
accelerated
=
true
)
params
=
accelerated
?
{
'file.path'
=>
file
.
path
,
'file.name'
=>
file
.
original_filename
}
:
params
=
if
accelerated
{
'file.path'
=>
file
.
path
,
'file.name'
=>
file
.
original_filename
}
else
{
'file'
=>
file
}
end
post
api
(
"/jobs/
#{
job
.
id
}
/artifacts"
),
params
,
headers
end
end
...
...
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