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
4ccf734e
Commit
4ccf734e
authored
Oct 04, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show group runners on runners page
parent
eba1a05f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
1 deletion
+68
-1
app/controllers/projects/settings/ci_cd_controller.rb
app/controllers/projects/settings/ci_cd_controller.rb
+4
-0
app/views/projects/runners/_group_runners.html.haml
app/views/projects/runners/_group_runners.html.haml
+19
-0
app/views/projects/runners/_index.html.haml
app/views/projects/runners/_index.html.haml
+4
-0
app/views/projects/runners/_runner.html.haml
app/views/projects/runners/_runner.html.haml
+1
-1
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+40
-0
No files found.
app/controllers/projects/settings/ci_cd_controller.rb
View file @
4ccf734e
...
...
@@ -67,10 +67,14 @@ module Projects
def
define_runners_variables
@project_runners
=
@project
.
runners
.
ordered
@assignable_runners
=
current_user
.
ci_authorized_runners
.
assignable_for
(
project
).
ordered
.
page
(
params
[
:page
]).
per
(
20
)
@shared_runners
=
::
Ci
::
Runner
.
shared
.
active
@shared_runners_count
=
@shared_runners
.
count
(
:all
)
@group_runners
=
::
Ci
::
Runner
.
belonging_to_group
(
@project
.
id
)
end
def
define_secret_variables
...
...
app/views/projects/runners/_group_runners.html.haml
0 → 100644
View file @
4ccf734e
%h3
Group Runners
.bs-callout.bs-callout-warning
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
This project does not belong to a group and can therefore not make use of group Runners.
-
elsif
@group_runners
.
empty?
This group does not provide any group Runners yet.
=
render
partial:
'ci/runner/how_to_setup_runner'
,
locals:
{
registration_token:
@project
.
group
.
runners_token
,
type:
'group'
}
-
else
%h4
.underlined-title
Available group Runners :
#{
@group_runners
.
count
}
%ul
.bordered-list
=
render
partial:
'projects/runners/runner'
,
collection:
@group_runners
,
as: :runner
app/views/projects/runners/_index.html.haml
View file @
4ccf734e
...
...
@@ -23,3 +23,7 @@
=
render
'projects/runners/specific_runners'
.col-sm-6
=
render
'projects/runners/shared_runners'
.row
.col-sm-6
.col-sm-6
=
render
'projects/runners/group_runners'
app/views/projects/runners/_runner.html.haml
View file @
4ccf734e
...
...
@@ -26,7 +26,7 @@
-
else
-
runner_project
=
@project
.
runner_projects
.
find_by
(
runner_id:
runner
)
=
link_to
'Disable for this project'
,
project_runner_project_path
(
@project
,
runner_project
),
data:
{
confirm:
"Are you sure?"
},
method: :delete
,
class:
'btn btn-danger btn-sm'
-
elsif
runner
.
specific
?
-
elsif
runner
.
project
?
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@project
.
runner_projects
.
new
]
do
|
f
|
=
f
.
hidden_field
:runner_id
,
value:
runner
.
id
=
f
.
submit
'Enable for this project'
,
class:
'btn btn-sm'
...
...
spec/features/runners_spec.rb
View file @
4ccf734e
...
...
@@ -181,4 +181,44 @@ feature 'Runners' do
expect
(
page
.
find
(
'.shared-runners-description'
)).
to
have_content
(
'Disable shared Runners'
)
end
end
context
'group runners'
do
background
do
project
.
add_master
(
user
)
end
context
'project without a group'
do
given
(
:project
)
{
create
:project
}
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'This project does not belong to a group and can therefore not make use of group Runners.'
end
end
context
'project with a group but no group runner'
do
given
(
:group
)
{
create
:group
}
given
(
:project
)
{
create
:project
,
group:
group
}
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'This group does not provide any group Runners yet.'
end
end
context
'project with a group and a group runner'
do
given
(
:group
)
{
create
:group
}
given
(
:project
)
{
create
:project
,
group:
group
}
given!
(
:ci_runner
)
{
create
:ci_runner
,
groups:
[
group
],
description:
'group-runner'
}
scenario
'group runners are available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'Available group Runners : 1'
expect
(
page
).
to
have_content
'group-runner'
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