import "choerodon-ui/pro/lib/icon/style";
import _Icon from "choerodon-ui/pro/lib/icon";
import React from 'react';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { Choerodon } from '@choerodon/boot';
import { A_KEY_INSTALLATION, ADD_CHART, CRETE_PV, DEPLOY_RUNNER } from "./Constant";
import "./index.less";
export default function GitlabRunner() {
  var prefixCls = 'c7ncd-pipelineManage-runner';
  var options = {
    format: 'text/plain'
  };

  var handleCopy = function handleCopy() {
    Choerodon.prompt('复制成功');
  };

  return /*#__PURE__*/React.createElement("div", {
    className: "".concat(prefixCls)
  }, /*#__PURE__*/React.createElement("p", null, "Gitlab Runner\uFF0C\u7528\u4E8E\u4EE3\u7801\u63D0\u4EA4\u540E\u81EA\u52A8\u8FDB\u884C\u4EE3\u7801\u6D4B\u8BD5\u3001\u6784\u5EFA\u670D\u52A1\u7684\u955C\u50CF\u53CA\u751F\u6210helm chart\u5E76\u5C06\u7ED3\u679C\u53D1\u56DE\u7ED9Choerodon\u3002 \u5B83\u4E0EGitLab CI\u4E00\u8D77\u4F7F\u7528\uFF0CGitlab CI\u662FGitlab\u4E2D\u5305\u542B\u7684\u5F00\u6E90\u6301\u7EED\u96C6\u6210\u670D\u52A1\uFF0C\u7528\u4E8E\u534F\u8C03\u4F5C\u4E1A\u3002"), /*#__PURE__*/React.createElement("blockquote", {
    className: "warning"
  }, "\u6CE8\u610F\uFF1A\u82E5\u5728\u5B89\u88C5Choerodon\u7CFB\u7EDF\u65F6\uFF0C\u5DF2\u7ECF\u6210\u529F\u90E8\u7F72\u548C\u914D\u7F6E\u8FC7GitLab Runner\u3002\u4FBF\u4E0D\u7528\u91CD\u590D\u8FDB\u884C\u4EE5\u4E0B\u64CD\u4F5C\u3002"), /*#__PURE__*/React.createElement("h3", null, "\u9884\u5907\u77E5\u8BC6"), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", {
    className: "block-span"
  }, "\u5982\u679C\u4F60\u8FD8\u4E0D\u77E5\u9053Gitlab Runner\u662F\u505A\u4EC0\u4E48\u7684\uFF0C\u8BF7\u53C2\u8003\u4E0B\u9762\u94FE\u63A5\u8FDB\u884C\u5B66\u4E60\uFF1A"), /*#__PURE__*/React.createElement("a", {
    href: "https://docs.gitlab.com/runner/",
    target: "_blank",
    rel: "nofollow me noopener noreferrer"
  }, "https://docs.gitlab.com/runner/")), /*#__PURE__*/React.createElement("h3", null, "\u65B9\u5F0F\u4E00\uFF1A\u4E00\u952E\u5B89\u88C5Runner"), /*#__PURE__*/React.createElement("p", null, "\u5982\u4F60\u4F7F\u7528\u4E00\u952E\u90E8\u7F72\u5B89\u88C5\u7684\u732A\u9F7F\u9C7C\uFF0C\u5728\u540C\u4E00\u96C6\u7FA4\u4E2D\u53EF\u4EE5\u4F7F\u7528\u4E0B\u9762\u547D\u4EE4\u4E00\u952E\u90E8\u7F72Gitlab-Runner"), /*#__PURE__*/React.createElement("blockquote", {
    className: "code"
  }, A_KEY_INSTALLATION, /*#__PURE__*/React.createElement(CopyToClipboard, {
    text: A_KEY_INSTALLATION,
    onCopy: handleCopy,
    options: options
  }, /*#__PURE__*/React.createElement(_Icon, {
    type: "library_books",
    className: "copy-button"
  }))), /*#__PURE__*/React.createElement("h3", null, "\u65B9\u5F0F\u4E8C\uFF1A\u624B\u52A8\u5B89\u88C5Runner"), /*#__PURE__*/React.createElement("h4", null, "Step1\uFF1A\u83B7\u53D6Runner\u6CE8\u518CToken"), /*#__PURE__*/React.createElement("blockquote", null, 'Note：此教程注册的Runner属性为共享，若需注册私有Runner或者无法进入Gitlab管理界面，注册Token请在Git项目仓库 Settings > CI/CD > Runners settings 菜单中获取。'), /*#__PURE__*/React.createElement("div", {
    className: "image-1"
  }), /*#__PURE__*/React.createElement("h4", null, "Step2\uFF1A\u6DFB\u52A0choerodon chart\u4ED3\u5E93"), /*#__PURE__*/React.createElement("pre", {
    className: "code"
  }, ADD_CHART, /*#__PURE__*/React.createElement(CopyToClipboard, {
    text: ADD_CHART,
    onCopy: handleCopy,
    options: options
  }, /*#__PURE__*/React.createElement(_Icon, {
    type: "library_books",
    className: "copy-button"
  }))), /*#__PURE__*/React.createElement("h4", null, "Step3\uFF1A\u90E8\u7F72Runner"), /*#__PURE__*/React.createElement("blockquote", null, "Note\uFF1A\u542F\u7528\u6301\u4E45\u5316\u5B58\u50A8\u8BF7\u6267\u884C\u63D0\u524D\u521B\u5EFA\u6240\u5BF9\u5E94\u7684\u7269\u7406\u76EE\u5F55\uFF0CPV\u548CPVC\u53EF\u4F7F\u7528\u4EE5\u4E0B\u8BED\u53E5\u8FDB\u884C\u521B\u5EFA\uFF1B\u53EF\u5728\u90E8\u7F72\u547D\u4EE4\u4E2D\u6DFB\u52A0--debug --dry-run\u53C2\u6570\uFF0C\u8FDB\u884C\u6E32\u67D3\u9884\u89C8\u4E0D\u8FDB\u884C\u90E8\u7F72\u3002"), /*#__PURE__*/React.createElement("p", null, "- \u521B\u5EFA\u7F13\u5B58\u6240\u9700PV\u548CPVC"), /*#__PURE__*/React.createElement("pre", {
    className: "code"
  }, CRETE_PV, /*#__PURE__*/React.createElement(CopyToClipboard, {
    text: CRETE_PV,
    onCopy: handleCopy,
    options: options
  }, /*#__PURE__*/React.createElement(_Icon, {
    type: "library_books",
    className: "copy-button"
  }))), /*#__PURE__*/React.createElement("p", null, "- \u90E8\u7F72Runner"), /*#__PURE__*/React.createElement("blockquote", null, "Note\uFF1A\u8BF7\u786E\u8BA4\u4F60\u6240\u642D\u5EFA\u7684K8S\u96C6\u7FA4\u662F\u5426\u5DF2\u5F00\u542FRBAC\u6388\u6743\uFF08\u6309\u7167\u672C\u7AD9Kubernetes\u90E8\u7F72\u6559\u7A0B\u90E8\u7F72\u7684\u96C6\u7FA4\u9ED8\u8BA4\u662F\u5F00\u542F RBAC\u6388\u6743\u7684\uFF09\uFF0C\u82E5\u672A\u5F00\u542F\uFF0C\u8BF7\u5220\u9664\u4E0B\u9762\u6267\u884C\u547D\u4EE4\u4E2D\u7684--set rbac.create=true\u8BBE\u7F6E\u540E\u6267\u884C\u3002"), /*#__PURE__*/React.createElement("pre", {
    className: "code"
  }, DEPLOY_RUNNER, /*#__PURE__*/React.createElement(CopyToClipboard, {
    text: DEPLOY_RUNNER,
    onCopy: handleCopy,
    options: options
  }, /*#__PURE__*/React.createElement(_Icon, {
    type: "library_books",
    className: "copy-button"
  }))), /*#__PURE__*/React.createElement("p", null, "- \u53C2\u6570"), /*#__PURE__*/React.createElement("p", null, "1. ", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "env.environment.*"), "\u4E3ACI\u65F6Pod\u7684\u73AF\u5883\u53D8\u91CF\u952E\u503C\u5BF9\uFF0C", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "*"), "\u5C31\u662F\u73AF\u5883\u53D8\u91CF\u540D\uFF0C\u7B49\u53F7\u540E\u9762\u7684\u4E3A\u8BE5\u53D8\u91CF\u7684\u503C\uFF0C\u8FD9\u91CC\u4F8B\u5B50\u4E2D\u6DFB\u52A0\u8FD9\u51E0\u4E2A\u73AF\u5883\u53D8\u91CF\u5EFA\u8BAE\u914D\u7F6E\uFF0C\u4F7F\u7528Choerodon\u7BA1\u7406\u7684\u9879\u76EE\u8FDB\u884CCI\u65F6\u4F1A\u7528\u5230\u5B83\u4EEC\uFF0C\u82E5\u8FD8\u9700\u5176\u4ED6\u73AF\u5883\u53D8\u91CF\u8BF7\u81EA\u5B9A\u4E49\u3002"), /*#__PURE__*/React.createElement("p", null, "2. ", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "env.persistence.*"), "\u4E3ACI\u65F6Pod\u7684\u6302\u8F7DPVC\u4E0EPod\u5185\u76EE\u5F55\u7684\u952E\u503C\u5BF9\uFF0C", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "*"), "\u5C31\u662FPVC\u7684\u540D\u79F0\uFF0C\u7B49\u53F7\u540E\u9762\u7684\u503C\u4E3A\u8981\u6302\u8F7D\u5230Pod\u7684\u54EA\u4E2A\u76EE\u5F55\uFF0C\u8FD9\u91CC\u6CE8\u610F\u4E00\u70B9\u7528\u5F15\u53F7\u5F15\u8D77\u6765\u3002 \u672C\u4F8B\u4E2D\u6211\u4EEC\u65B0\u5EFA\u4E86\u4E24\u4E2APVC\u5373", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "runner-maven-pvc"), "\u3001", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "runner-cache-pvc"), "\u5206\u522B\u6302\u8F7D\u5230", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "/root/.m2"), "\u548C", /*#__PURE__*/React.createElement("span", {
    className: "code_block"
  }, "/cache"), "\u76EE\u5F55\u4E2D\u3002"), /*#__PURE__*/React.createElement("div", {
    className: "gitlab-runner-table"
  }, /*#__PURE__*/React.createElement("table", {
    border: "1"
  }, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "\u53C2\u6570"), /*#__PURE__*/React.createElement("td", null, "\u542B\u4E49")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "rbac.create"), /*#__PURE__*/React.createElement("td", null, "\u521B\u5EFAsa\u53CA\u6388\u6743")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "env.concurrent"), /*#__PURE__*/React.createElement("td", null, "\u53EF\u4EE5\u540C\u65F6\u8FDB\u884C\u7684CI\u6570\u91CF")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "env.gitlabUrl"), /*#__PURE__*/React.createElement("td", null, "Gitlab\u5730\u5740")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "env.runnerRegistrationToken"), /*#__PURE__*/React.createElement("td", null, "Runner\u6CE8\u518CToken")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "env.environment.CHOERODON_URL"), /*#__PURE__*/React.createElement("td", null, "Choerodon API\u5730\u5740")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "env.persistence.runner-maven-pvc"), /*#__PURE__*/React.createElement("td", null, "\u6301\u4E45\u5316\u6570\u636E\uFF0C\u6B64\u5904\u7684", /*#__PURE__*/React.createElement("code", null, "runner-maven-pvc"), "\u4E3APVC\u540D\u79F0,\u503C\u8981\u6302\u8F7D\u5230Pod\u7684", /*#__PURE__*/React.createElement("code", null, "/root/.m2"), "\u76EE\u5F55")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "env.persistence.runner-cache-pvc"), /*#__PURE__*/React.createElement("td", null, "\u6301\u4E45\u5316\u6570\u636E\uFF0C\u6B64\u5904\u7684", /*#__PURE__*/React.createElement("span", null, "runner-cache-pvc"), "\u4E3APVC\u540D\u79F0,\u503C\u8981\u6302\u8F7D\u5230Pod\u7684", /*#__PURE__*/React.createElement("code", null, "/cache"), "\u76EE\u5F55")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, "enabled_mount_host_docker_sock"), /*#__PURE__*/React.createElement("td", null, "\u662F\u5426\u5C06", /*#__PURE__*/React.createElement("code", null, "dockers.sock"), "\u8282\u70B9\u6587\u4EF6\u6302\u5728\u5230Pod\u4E2D\uFF0C\u4EE5\u4FBFbuild docker\u955C\u50CF")))), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, "- \u66F4\u591ARunner\u8BBE\u7F6E\u8BF7\u53C2\u8003 "), /*#__PURE__*/React.createElement("a", {
    href: "https://docs.gitlab.com/runner/",
    target: "_blank",
    rel: "nofollow me noopener noreferrer"
  }, "https://docs.gitlab.com/runner/")));
}