summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/runner/components/runner_manual_setup_help.vue
blob: 4755977b05174e55a01835dabefe6201dbc06ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<script>
import { GlLink, GlSprintf, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import RunnerInstructions from '~/vue_shared/components/runner_instructions/runner_instructions.vue';

export default {
  components: {
    GlLink,
    GlSprintf,
    ClipboardButton,
    RunnerInstructions,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  inject: {
    runnerInstallHelpPage: {
      default: null,
    },
  },
  props: {
    registrationToken: {
      type: String,
      required: true,
    },
    typeName: {
      type: String,
      required: false,
      default: __('shared'),
    },
  },
  computed: {
    rootUrl() {
      return gon.gitlab_url || '';
    },
  },
};
</script>

<template>
  <div class="bs-callout">
    <h5 data-testid="runner-help-title">
      <gl-sprintf :message="__('Set up a %{type} runner manually')">
        <template #type>
          {{ typeName }}
        </template>
      </gl-sprintf>
    </h5>

    <ol>
      <li>
        <gl-link :href="runnerInstallHelpPage" data-testid="runner-help-link" target="_blank">
          {{ __("Install GitLab Runner and ensure it's running.") }}
        </gl-link>
      </li>
      <li>
        {{ __('Register the runner with this URL:') }}
        <br />

        <code data-testid="coordinator-url">{{ rootUrl }}</code>
        <clipboard-button :title="__('Copy URL')" :text="rootUrl" />
      </li>
      <li>
        {{ __('And this registration token:') }}
        <br />

        <code data-testid="registration-token">{{ registrationToken }}</code>
        <clipboard-button :title="__('Copy token')" :text="registrationToken" />
      </li>
    </ol>

    <!-- TODO Implement reset token functionality -->
    <runner-instructions />
  </div>
</template>