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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
2aa57071
Commit
2aa57071
authored
May 05, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend runner config options for untagged jobs
parent
a8a205cd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
35 deletions
+51
-35
app/models/ci/runner.rb
app/models/ci/runner.rb
+1
-1
app/views/admin/runners/show.html.haml
app/views/admin/runners/show.html.haml
+0
-2
app/views/projects/runners/_runner.html.haml
app/views/projects/runners/_runner.html.haml
+1
-1
app/views/projects/runners/show.html.haml
app/views/projects/runners/show.html.haml
+20
-31
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+29
-0
No files found.
app/models/ci/runner.rb
View file @
2aa57071
...
@@ -4,7 +4,7 @@ module Ci
...
@@ -4,7 +4,7 @@ module Ci
LAST_CONTACT_TIME
=
5
.
minutes
.
ago
LAST_CONTACT_TIME
=
5
.
minutes
.
ago
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
FORM_EDITABLE
=
%i[description tag_list active]
FORM_EDITABLE
=
%i[description tag_list active
run_untagged
]
has_many
:builds
,
class_name:
'Ci::Build'
has_many
:builds
,
class_name:
'Ci::Build'
has_many
:runner_projects
,
dependent: :destroy
,
class_name:
'Ci::RunnerProject'
has_many
:runner_projects
,
dependent: :destroy
,
class_name:
'Ci::RunnerProject'
...
...
app/views/admin/runners/show.html.haml
View file @
2aa57071
...
@@ -9,8 +9,6 @@
...
@@ -9,8 +9,6 @@
%span
.runner-state.runner-state-specific
%span
.runner-state.runner-state-specific
Specific
Specific
-
if
@runner
.
shared?
-
if
@runner
.
shared?
.bs-callout.bs-callout-success
.bs-callout.bs-callout-success
%h4
This runner will process builds from ALL UNASSIGNED projects
%h4
This runner will process builds from ALL UNASSIGNED projects
...
...
app/views/projects/runners/_runner.html.haml
View file @
2aa57071
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
-
if
@runners
.
include?
(
runner
)
-
if
@runners
.
include?
(
runner
)
=
link_to
runner
.
short_sha
,
runner_path
(
runner
)
=
link_to
runner
.
short_sha
,
runner_path
(
runner
)
%small
%small
=
link_to
edit_namespace_project_runner_path
(
@project
.
namespace
,
@project
,
runner
)
do
=
link_to
edit_namespace_project_runner_path
(
@project
.
namespace
,
@project
,
runner
)
do
%i
.fa.fa-edit.btn
%i
.fa.fa-edit.btn
-
else
-
else
=
runner
.
short_sha
=
runner
.
short_sha
...
...
app/views/projects/runners/show.html.haml
View file @
2aa57071
...
@@ -17,50 +17,39 @@
...
@@ -17,50 +17,39 @@
%th
Property Name
%th
Property Name
%th
Value
%th
Value
%tr
%tr
%td
%td
Active
Tags
%td
=
@runner
.
active?
?
'Yes'
:
'No'
%tr
%td
Can run untagged jobs
%td
=
@runner
.
run_untagged?
?
'Yes'
:
'No'
%tr
%td
Tags
%td
%td
-
@runner
.
tag_list
.
each
do
|
tag
|
-
@runner
.
tag_list
.
each
do
|
tag
|
%span
.label.label-primary
%span
.label.label-primary
=
tag
=
tag
%tr
%tr
%td
%td
Name
Name
%td
=
@runner
.
name
%td
=
@runner
.
name
%tr
%tr
%td
%td
Version
Version
%td
=
@runner
.
version
%td
=
@runner
.
version
%tr
%tr
%td
%td
Revision
Revision
%td
=
@runner
.
revision
%td
=
@runner
.
revision
%tr
%tr
%td
%td
Platform
Platform
%td
=
@runner
.
platform
%td
=
@runner
.
platform
%tr
%tr
%td
%td
Architecture
Architecture
%td
=
@runner
.
architecture
%td
=
@runner
.
architecture
%tr
%tr
%td
%td
Description
Description
%td
=
@runner
.
description
%td
=
@runner
.
description
%tr
%tr
%td
%td
Last contact
Last contact
%td
%td
-
if
@runner
.
contacted_at
-
if
@runner
.
contacted_at
#{
time_ago_in_words
(
@runner
.
contacted_at
)
}
ago
#{
time_ago_in_words
(
@runner
.
contacted_at
)
}
ago
-
else
-
else
Never
Never
spec/features/runners_spec.rb
View file @
2aa57071
...
@@ -110,4 +110,33 @@ describe "Runners" do
...
@@ -110,4 +110,33 @@ describe "Runners" do
expect
(
page
).
to
have_content
(
@specific_runner
.
platform
)
expect
(
page
).
to
have_content
(
@specific_runner
.
platform
)
end
end
end
end
feature
'configuring runners ability to picking untagged jobs'
do
given
(
:project
)
{
create
(
:empty_project
)
}
given
(
:runner
)
{
create
(
:ci_runner
)
}
background
do
project
.
team
<<
[
user
,
:master
]
project
.
runners
<<
runner
end
scenario
'user checks default configuration'
do
visit
namespace_project_runner_path
(
project
.
namespace
,
project
,
runner
)
expect
(
page
).
to
have_content
'Can run untagged jobs Yes'
end
scenario
'user want to prevent runner from running untagged job'
do
visit
runners_path
(
project
)
page
.
within
(
'.activated-specific-runners'
)
do
first
(
'small > a'
).
click
end
uncheck
'runner_run_untagged'
click_button
'Save changes'
expect
(
page
).
to
have_content
'Can run untagged jobs No'
expect
(
runner
.
reload
.
run_untagged?
).
to
eq
false
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