Commit e9924687 authored by Shinya Maeda's avatar Shinya Maeda

ini

parent 81002745
...@@ -5,7 +5,7 @@ module Ci ...@@ -5,7 +5,7 @@ module Ci
RUNNER_QUEUE_EXPIRY_TIME = 60.minutes RUNNER_QUEUE_EXPIRY_TIME = 60.minutes
ONLINE_CONTACT_TIMEOUT = 1.hour ONLINE_CONTACT_TIMEOUT = 1.hour
AVAILABLE_SCOPES = %w[specific shared active paused online].freeze AVAILABLE_SCOPES = %w[specific shared active paused online].freeze
FORM_EDITABLE = %i[description tag_list active run_untagged locked].freeze FORM_EDITABLE = %i[description tag_list active run_untagged locked protected].freeze
has_many :builds has_many :builds
has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
.checkbox .checkbox
= f.check_box :active = f.check_box :active
%span.light Paused Runners don't accept new jobs %span.light Paused Runners don't accept new jobs
.form-group
= label :protected, "Protected", class: 'control-label'
.col-sm-10
.checkbox
= f.check_box :protected
%span.light This runner will only run on pipelines trigged on protected branches
.form-group .form-group
= label :run_untagged, 'Run untagged jobs', class: 'control-label' = label :run_untagged, 'Run untagged jobs', class: 'control-label'
.col-sm-10 .col-sm-10
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
%tr %tr
%td Active %td Active
%td= @runner.active? ? 'Yes' : 'No' %td= @runner.active? ? 'Yes' : 'No'
%tr
%td Protected
%td= @runner.protected? ? 'Yes' : 'No'
%tr %tr
%td Can run untagged jobs %td Can run untagged jobs
%td= @runner.run_untagged? ? 'Yes' : 'No' %td= @runner.run_untagged? ? 'Yes' : 'No'
......
class AddProtectedToCiRunners < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default(:ci_runners, :protected, :boolean, default: false)
end
def down
remove_column(:ci_runners, :protected)
end
end
...@@ -371,6 +371,7 @@ ActiveRecord::Schema.define(version: 20170824162758) do ...@@ -371,6 +371,7 @@ ActiveRecord::Schema.define(version: 20170824162758) do
t.string "architecture" t.string "architecture"
t.boolean "run_untagged", default: true, null: false t.boolean "run_untagged", default: true, null: false
t.boolean "locked", default: false, null: false t.boolean "locked", default: false, null: false
t.boolean "protected", default: false, null: false
end end
add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment