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
Jérome Perrin
gitlab-ce
Commits
7584d03a
Commit
7584d03a
authored
Oct 05, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow disabling/enabling group runners per project
parent
d8675bd4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
0 deletions
+31
-0
app/controllers/projects/runners_controller.rb
app/controllers/projects/runners_controller.rb
+6
-0
app/views/projects/runners/_group_runners.html.haml
app/views/projects/runners/_group_runners.html.haml
+10
-0
config/routes/project.rb
config/routes/project.rb
+1
-0
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+14
-0
No files found.
app/controllers/projects/runners_controller.rb
View file @
7584d03a
...
...
@@ -52,6 +52,12 @@ class Projects::RunnersController < Projects::ApplicationController
redirect_to
project_settings_ci_cd_path
(
@project
)
end
def
toggle_group_runners
project
.
toggle!
(
:group_runners_enabled
)
redirect_to
project_settings_ci_cd_path
(
@project
)
end
protected
def
set_runner
...
...
app/views/projects/runners/_group_runners.html.haml
View file @
7584d03a
...
...
@@ -4,6 +4,16 @@
GitLab Group Runners can execute code for all the projects in this group.
They can be managed using the
#{
link_to
'Runners API'
,
help_page_path
(
'api/runners.md'
)
}
.
-
if
@project
.
group
%hr
-
if
@project
.
group_runners_enabled?
=
link_to
toggle_group_runners_project_runners_path
(
@project
),
class:
'btn btn-warning'
,
method: :post
do
Disable group Runners
-
else
=
link_to
toggle_group_runners_project_runners_path
(
@project
),
class:
'btn btn-success'
,
method: :post
do
Enable group Runners
for this project
-
if
!
@project
.
group
This project does not belong to a group and can therefore not make use of group Runners.
...
...
config/routes/project.rb
View file @
7584d03a
...
...
@@ -410,6 +410,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
collection
do
post
:toggle_shared_runners
post
:toggle_group_runners
end
end
...
...
spec/features/runners_spec.rb
View file @
7584d03a
...
...
@@ -219,6 +219,20 @@ feature 'Runners' do
expect
(
page
).
to
have_content
'Available group Runners : 1'
expect
(
page
).
to
have_content
'group-runner'
end
scenario
'group runners may be disabled for a project'
do
visit
runners_path
(
project
)
click_on
'Disable group Runners'
expect
(
page
).
to
have_content
'Enable group Runners'
expect
(
project
.
reload
.
group_runners_enabled
).
to
be
false
click_on
'Enable group Runners'
expect
(
page
).
to
have_content
'Disable group Runners'
expect
(
project
.
reload
.
group_runners_enabled
).
to
be
true
end
end
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