Commit 3f66d3bd authored by Shinya Maeda's avatar Shinya Maeda Committed by Shinya Maeda

Add coordinator url to admin area runner page

Use partial and shring same UI

Swap two. Like the project runner section.

Fix tests
parent 1540cc43
......@@ -2,26 +2,6 @@
= render "admin/dashboard/head"
%div{ class: container_class }
%p.prepend-top-default
%span
To register a new Runner you should enter the following registration
token.
With this token the Runner will request a unique Runner token and use
that for future communication.
%br
Registration token is
%code#runners-token= current_application_settings.runners_registration_token
.bs-callout.clearfix
.pull-left
%p
You can reset runners registration token by pressing a button below.
.prepend-top-10
= button_to "Reset runners registration token", reset_runners_token_admin_application_settings_path,
method: :put, class: 'btn btn-default',
data: { confirm: 'Are you sure you want to reset registration token?' }
.bs-callout
%p
A 'Runner' is a process which runs a job.
......@@ -46,6 +26,17 @@
%span.label.label-danger paused
\- Runner will not receive any new jobs
.bs-callout.clearfix
.pull-left
%p
You can reset runners registration token by pressing a button below.
.prepend-top-10
= button_to "Reset runners registration token", reset_runners_token_admin_application_settings_path,
method: :put, class: 'btn btn-default',
data: { confirm: 'Are you sure you want to reset registration token?' }
= render partial: 'ci/runner/how_to_setup_runner', locals: {registration_token: current_application_settings.runners_registration_token, type: 'shared'}
.append-bottom-20.clearfix
.pull-left
= form_tag admin_runners_path, id: 'runners-search', class: 'form-inline', method: :get do
......
.bs-callout.help-callout
%h4 How to setup a #{type} Runner for a new project
%ol
%li
Install a Runner compatible with GitLab CI
(checkout the #{link_to 'GitLab Runner section', 'https://about.gitlab.com/gitlab-ci/#gitlab-runner', target: '_blank'} for information on how to install it).
%li
Specify the following URL during the Runner setup:
%code= root_url(only_path: false)
%li
Use the following registration token during setup:
%code= registration_token
%li
Start the Runner!
%h3 Specific Runners
.bs-callout.help-callout
%h4 How to setup a specific Runner for a new project
%ol
%li
Install a Runner compatible with GitLab CI
(checkout the #{link_to 'GitLab Runner section', 'https://about.gitlab.com/gitlab-ci/#gitlab-runner', target: '_blank'} for information on how to install it).
%li
Specify the following URL during the Runner setup:
%code= root_url(only_path: false)
%li
Use the following registration token during setup:
%code= @project.runners_token
%li
Start the Runner!
= render partial: 'ci/runner/how_to_setup_runner', locals: {registration_token: @project.runners_token, type: 'specific'}
- if @project_runners.any?
%h4.underlined-title Runners activated for this project
......
......@@ -19,7 +19,7 @@ describe "Admin Runners" do
end
it 'has all necessary texts' do
expect(page).to have_text "To register a new Runner"
expect(page).to have_text "How to setup"
expect(page).to have_text "Runners with last contact more than a minute ago: 1"
end
......@@ -163,12 +163,11 @@ describe "Admin Runners" do
end
it 'has a registration token' do
expect(page).to have_content("Registration token is #{token}")
expect(page).to have_selector('#runners-token', text: token)
expect(page.find('.help-callout li:nth-of-type(3)')).to have_content(token)
end
describe 'reload registration token' do
let(:page_token) { find('#runners-token').text }
let(:page_token) { find('.help-callout li:nth-of-type(3) code').text }
before do
click_button 'Reset runners registration token'
......
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