summaryrefslogtreecommitdiff
path: root/lib/api/runner.rb
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-09-12 11:34:34 +0200
committerAlexis Reigel <alexis.reigel.ext@siemens.com>2018-04-23 09:21:43 +0200
commitb55c3a7bc4c23618860916738702b5d62820c351 (patch)
tree6669d8a859abbffe49f750e5294d28dd85adc6f8 /lib/api/runner.rb
parent7fbdd17cbcd19086694f575884191a6d137838dc (diff)
downloadgitlab-ce-b55c3a7bc4c23618860916738702b5d62820c351.tar.gz
support group runners in existing API endpoints
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r--lib/api/runner.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index 4d4fbe50f9f..49d9b0b1b4f 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -25,8 +25,11 @@ module API
# Create shared runner. Requires admin access
Ci::Runner.create(attributes.merge(is_shared: true))
elsif project = Project.find_by(runners_token: params[:token])
- # Create a specific runner for project.
+ # Create a specific runner for the project
project.runners.create(attributes)
+ elsif group = Group.find_by(runners_token: params[:token])
+ # Create a specific runner for the group
+ group.runners.create(attributes)
end
break forbidden! unless runner