<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # GitLab ChatOps > 原文:[https://docs.gitlab.com/ee/ci/chatops/README.html](https://docs.gitlab.com/ee/ci/chatops/README.html) * [How GitLab ChatOps works](#how-gitlab-chatops-works) * [Best practices for ChatOps CI jobs](#best-practices-for-chatops-ci-jobs) * [Controlling the ChatOps reply](#controlling-the-chatops-reply) * [GitLab ChatOps examples](#gitlab-chatops-examples) * [GitLab ChatOps icon](#gitlab-chatops-icon) # GitLab ChatOps[](#gitlab-chatops "Permalink") 版本歷史 * 在[GitLab Ultimate](https://about.gitlab.com/pricing/) 10.6 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4466) . * 在 11.9 中[移至](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/24780) [GitLab Core](https://about.gitlab.com/pricing/) . GitLab ChatOps 提供了一種通過 Slack 等聊天服務與 CI / CD 作業進行交互的方法. 許多組織的討論,協作和故障排除都是在聊天服務中進行的. 擁有一種方法來運行 CI / CD 作業并將輸出回傳到渠道,可以極大地增強團隊的工作流程. ## How GitLab ChatOps works[](#how-gitlab-chatops-works "Permalink") GitLab ChatOps 是基于[GitLab CI / CD](../README.html)和[Slack Slash Commands](../../user/project/integrations/slack_slash_commands.html)構建的. ChatOps 使用以下參數為[斜杠命令](../../integration/slash_commands.html)提供`run`操作: * 要執行的`<job name>` . * The `<job arguments>`. ChatOps 將以下[CI / CD 變量](../variables/README.html#predefined-environment-variables)傳遞給作業: * `CHAT_INPUT`包含任何其他參數. * `CHAT_CHANNEL`設置為觸發該動作的通道的名稱. 當執行時,ChatOps 查找指定的作業名稱,并嘗試將其與[`.gitlab-ci.yml`](../yaml/README.html)的相應作業匹配. 如果在`master`上找到匹配的作業,則計劃僅包含該作業的管道. 作業完成后: * 如果作業在*不到 30 分鐘內完成* ,則 ChatOps 會將作業的輸出發送到 Slack. * 如果作業在*30 分鐘內完成* ,則該作業必須使用[Slack API](https://api.slack.com/)將數據發送到通道. 要使用`run`命令,您必須具有[Developer 訪問權限或更高權限](../../user/permissions.html#project-members-permissions) . 如果不能從聊天中觸發某項工作,則可以將其設置為下列`except: [chat]` . ## Best practices for ChatOps CI jobs[](#best-practices-for-chatops-ci-jobs "Permalink") 由于 ChatOps 是基于 GitLab CI / CD 構建的,因此該作業具有可用的所有相同功能. 創建 ChatOps 作業時,請考慮以下最佳做法: * GitLab 強烈建議您`only: [chat]`設置`only: [chat]`以便該作業不會作為標準 CI 管道的一部分運行. * 如果作業設置為以下`when: manual` ,則 ChatOps 將創建管道,但是作業等待啟動. * ChatOps 為訪問控制提供了有限的支持. 如果觸發斜杠命令的用戶在項目中具有" [開發人員"訪問權限或更高權限](../../user/permissions.html#project-members-permissions) ,則作業將運行. 作業本身可以使用現有的[CI / CD 變量(](../variables/README.html#predefined-environment-variables)例如`GITLAB_USER_ID`來執行其他權限驗證,但是可以[覆蓋](../variables/README.html#priority-of-environment-variables)這些變量. ### Controlling the ChatOps reply[](#controlling-the-chatops-reply "Permalink") 單個命令的作業輸出將作為答復發送到通道. 例如,以下任務的聊天回復是頻道中的`Hello World` : ``` hello-world: stage: chatops only: [chat] script: - echo "Hello World" ``` 包含多個命令(或`before_script` )的作業將在聊天回復中返回其他內容. 在這些情況下,命令和它們的輸出都包括在內,并且命令以 ANSI 顏色代碼包裝. To selectively reply with the output of one command, its output must be bounded by the `chat_reply` section. For example, the following job lists the files in the current directory: ``` ls: stage: chatops only: [chat] script: - echo "This command will not be shown." - echo -e "section_start:$( date +%s ):chat_reply\r\033[0K\n$( ls -la )\nsection_end:$( date +%s ):chat_reply\r\033[0K" ``` ## GitLab ChatOps examples[](#gitlab-chatops-examples "Permalink") GitLab.com 團隊創建了一個[常見 ChatOps 腳本](https://gitlab.com/gitlab-com/chatops)的存儲庫,它們用于與我們的 GitLab 生產實例進行交互. 其他 GitLab 實例的管理員可能會發現它們很有用. 它們可以作為您可以編寫以與自己的應用程序進行交互的 ChatOps 腳本的靈感. ## GitLab ChatOps icon[](#gitlab-chatops-icon "Permalink") [官方的 GitLab ChatOps 圖標](img/gitlab-chatops-icon.png)可以下載. 您可以在此處找到并下載官方的 GitLab ChatOps 圖標. [![GitLab ChatOps bot icon](https://img.kancloud.cn/7b/60/7b60a293a2acf2d8fe90578f65e41547_164x144.png)](img/gitlab-chatops-icon-small.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看