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
Tatuya Kamada
gitlab-ce
Commits
e25f26e5
Commit
e25f26e5
authored
Feb 16, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename API::Ci to API::Runner
parent
22c983d7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
lib/api/api.rb
lib/api/api.rb
+1
-1
lib/api/helpers/runner.rb
lib/api/helpers/runner.rb
+1
-1
lib/api/runner.rb
lib/api/runner.rb
+4
-4
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+1
-1
No files found.
lib/api/api.rb
View file @
e25f26e5
...
@@ -52,7 +52,6 @@ module API
...
@@ -52,7 +52,6 @@ module API
mount
::
API
::
Branches
mount
::
API
::
Branches
mount
::
API
::
BroadcastMessages
mount
::
API
::
BroadcastMessages
mount
::
API
::
Builds
mount
::
API
::
Builds
mount
::
API
::
Ci
mount
::
API
::
Commits
mount
::
API
::
Commits
mount
::
API
::
CommitStatuses
mount
::
API
::
CommitStatuses
mount
::
API
::
DeployKeys
mount
::
API
::
DeployKeys
...
@@ -77,6 +76,7 @@ module API
...
@@ -77,6 +76,7 @@ module API
mount
::
API
::
Projects
mount
::
API
::
Projects
mount
::
API
::
ProjectSnippets
mount
::
API
::
ProjectSnippets
mount
::
API
::
Repositories
mount
::
API
::
Repositories
mount
::
API
::
Runner
mount
::
API
::
Runners
mount
::
API
::
Runners
mount
::
API
::
Services
mount
::
API
::
Services
mount
::
API
::
Session
mount
::
API
::
Session
...
...
lib/api/helpers/
ci
.rb
→
lib/api/helpers/
runner
.rb
View file @
e25f26e5
module
API
module
API
module
Helpers
module
Helpers
module
Ci
module
Runner
def
runner_registration_token_valid?
def
runner_registration_token_valid?
ActiveSupport
::
SecurityUtils
.
variable_size_secure_compare
(
params
[
:token
],
ActiveSupport
::
SecurityUtils
.
variable_size_secure_compare
(
params
[
:token
],
current_application_settings
.
runners_registration_token
)
current_application_settings
.
runners_registration_token
)
...
...
lib/api/
ci
.rb
→
lib/api/
runner
.rb
View file @
e25f26e5
module
API
module
API
class
Ci
<
Grape
::
API
class
Runner
<
Grape
::
API
helpers
::
API
::
Helpers
::
Ci
helpers
::
API
::
Helpers
::
Runner
resource
:runners
do
resource
:runners
do
desc
'Registers a new Runner'
do
desc
'Registers a new Runner'
do
...
@@ -21,7 +21,7 @@ module API
...
@@ -21,7 +21,7 @@ module API
runner
=
runner
=
if
runner_registration_token_valid?
if
runner_registration_token_valid?
# Create shared runner. Requires admin access
# Create shared runner. Requires admin access
::
Ci
::
Runner
.
create
(
attributes
.
merge
(
is_shared:
true
))
Ci
::
Runner
.
create
(
attributes
.
merge
(
is_shared:
true
))
elsif
project
=
Project
.
find_by
(
runners_token:
params
[
:token
])
elsif
project
=
Project
.
find_by
(
runners_token:
params
[
:token
])
# Create a specific runner for project.
# Create a specific runner for project.
project
.
runners
.
create
(
attributes
)
project
.
runners
.
create
(
attributes
)
...
@@ -45,7 +45,7 @@ module API
...
@@ -45,7 +45,7 @@ module API
end
end
delete
'/'
do
delete
'/'
do
authenticate_runner!
authenticate_runner!
::
Ci
::
Runner
.
find_by_token
(
params
[
:token
]).
destroy
Ci
::
Runner
.
find_by_token
(
params
[
:token
]).
destroy
end
end
end
end
end
end
...
...
spec/requests/api/
ci
_spec.rb
→
spec/requests/api/
runner
_spec.rb
View file @
e25f26e5
require
'spec_helper'
require
'spec_helper'
describe
API
::
Ci
do
describe
API
::
Runner
do
include
ApiHelpers
include
ApiHelpers
include
StubGitlabCalls
include
StubGitlabCalls
...
...
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