<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Pipeline settings > 原文:[https://docs.gitlab.com/ee/ci/pipelines/settings.html](https://docs.gitlab.com/ee/ci/pipelines/settings.html) * [Git strategy](#git-strategy) * [Git shallow clone](#git-shallow-clone) * [Timeout](#timeout) * [Timeout overriding on Runner level](#timeout-overriding-on-runner-level) * [Maximum artifacts size](#maximum-artifacts-size-core-only) * [Custom CI configuration path](#custom-ci-configuration-path) * [Test coverage parsing](#test-coverage-parsing) * [Code Coverage history](#code-coverage-history) * [Removing color codes](#removing-color-codes) * [Visibility of pipelines](#visibility-of-pipelines) * [Auto-cancel pending pipelines](#auto-cancel-pending-pipelines) * [Skip outdated deployment jobs](#skip-outdated-deployment-jobs) * [Pipeline Badges](#pipeline-badges) * [Pipeline status badge](#pipeline-status-badge) * [Test coverage report badge](#test-coverage-report-badge) * [Badge styles](#badge-styles) * [Flat (default)](#flat-default) * [Flat square](#flat-square) * [Custom badge text](#custom-badge-text) * [Environment Variables](#environment-variables) # Pipeline settings[](#pipeline-settings "Permalink") 要達到管道設置,請導航至項目的**"設置">" CI / CD"** . 可以為每個項目配置以下設置. 有關概述,請觀看視頻[GitLab CI 管道,工件和環境](https://www.youtube.com/watch?v=PCKDICEe10s) . 也請觀看[面向初學者的 GitLab CI 管道教程](https://www.youtube.com/watch?v=Jav4vbUrqII) . ## Git strategy[](#git-strategy "Permalink") 使用 Git 策略,您可以選擇從作業中的 GitLab 提取存儲庫的默認方式. 有兩種選擇. 使用: * `git clone` ,速度較慢,因為它會為每個作業從頭開始克隆存儲庫,以確保本地工作副本始終是原始的. * `git fetch` ,它更快地重新使用本地工作副本(如果不存在,則回退為克隆). 默認的 Git 策略可以由`.gitlab-ci.yml`的[GIT_STRATEGY 變量](../yaml/README.html#git-strategy)覆蓋. ## Git shallow clone[](#git-shallow-clone "Permalink") [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/28919) in GitLab 12.0. **注意:**從 GitLab 12.0 開始,新創建的項目將自動具有默認的`git depth`值`50` . 克隆存儲庫時,可以限制 GitLab CI / CD 獲取的更改數量. 設置`git depth`的限制可以加快管道的執行速度. 最大允許值為`1000` . 要禁用淺表克隆并使 GitLab CI / CD 每次獲取所有分支和標簽,請將值保留為空或設置為`0` . `.gitlab-ci.yml`文件中的[`GIT_DEPTH`](../large_repositories/index.html#shallow-cloning)變量也可以[覆蓋](../large_repositories/index.html#shallow-cloning)此值. ## Timeout[](#timeout "Permalink") 超時定義了作業可以運行的最長時間(以分鐘為單位). 這可以在項目的**設置> CI / CD>常規管道設置下進行配置** . 默認值為 60 分鐘. 如果要對作業的運行時間施加硬性限制,則減少時間限制,否則增加該限制. 無論如何,如果作業超過閾值,則將其標記為失敗. ### Timeout overriding on Runner level[](#timeout-overriding-on-runner-level "Permalink") 在 GitLab 10.7 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17221) . 項目定義的超時(用戶設置的特定超時或默認的 60 分鐘超時)可以[在 Runner 級別](../runners/README.html#set-maximum-job-timeout-for-a-runner)上[覆蓋](../runners/README.html#set-maximum-job-timeout-for-a-runner) . ## Maximum artifacts size[](#maximum-artifacts-size-core-only "Permalink") 有關為項目設置最大工件大小的信息,請參見[最大工件大小](../../user/admin_area/settings/continuous_integration.html#maximum-artifacts-size-core-only) . ## Custom CI configuration path[](#custom-ci-configuration-path "Permalink") 版本歷史 * 在 GitLab 9.4 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12509) . * [支持](https://gitlab.com/gitlab-org/gitlab/-/issues/14376)在 GitLab 12.6 中引入的[外部`.gitlab-ci.yml`位置](https://gitlab.com/gitlab-org/gitlab/-/issues/14376) . 默認情況下,我們在項目的根目錄中查找`.gitlab-ci.yml`文件. 如果需要,您可以指定備用路徑和文件名,包括項目外部的位置. 要自定義路徑: 1. 轉到項目的**設置> CI / CD** . 2. 展開**常規管道**部分. 3. 在" **定制 CI 配置路徑"**字段中提供一個值. 4. Click **保存更改**. 如果 CI 配置在非默認位置存儲在資源庫中,則該路徑必須相對于根目錄. 有效路徑和文件名的示例包括: * `.gitlab-ci.yml` (default) * `.my-custom-file.yml` * `my/path/.gitlab-ci.yml` * `my/path/.my-custom-file.yml` 如果 CI 配置將托管在外部站點上,則 URL 鏈接必須以`.yml` : * `http://example.com/generate/ci/config.yml` 如果 CI 配置將托管在 GitLab 中的其他項目中,則該路徑必須相對于另一個項目中的根目錄,并在最后添加組和項目名稱: * `.gitlab-ci.yml@mygroup/another-project` * `my/path/.my-custom-file.yml@mygroup/another-project` 將配置文件托管在單獨的項目中,可以更嚴格地控??制配置文件. 例如: * 創建一個公共項目來承載配置文件. * 僅向被允許編輯文件的用戶授予對項目的寫權限. 其他用戶和項目將能夠訪問配置文件而無需對其進行編輯. ## Test coverage parsing[](#test-coverage-parsing "Permalink") 如果您在代碼中使用測試覆蓋率,則 GitLab 可以使用正則表達式將其輸出捕獲到作業日志中. 在管道設置中,搜索"測試 coverage 解析"部分. [![Pipelines settings test coverage](https://img.kancloud.cn/a4/00/a4006caf921a004d25aa76e72213ee84_330x75.png)](img/pipelines_settings_test_coverage.png) 如果要禁用它或輸入 Ruby 正則表達式,請保留空白. 您可以使用[https://rubular.com](https://rubular.com)來測試您的正則表達式. 正則表達式返回在輸出中找到的**最后一個**匹配項. 如果管道成功,則覆蓋范圍將顯示在合并請求窗口小部件和作業表中. [![MR widget coverage](https://img.kancloud.cn/f0/70/f070dfe9ad5aac9c288fc5fbf23a7997_852x132.png)](img/pipelines_test_coverage_mr_widget.png) [![Build status coverage](https://img.kancloud.cn/63/da/63da92d3f61b9e1aab0048977ba882a4_862x121.png)](img/pipelines_test_coverage_build.png) 可以在管道設置頁面中找到一些針對多種語言的已知覆蓋工具的示例. ### Code Coverage history[](#code-coverage-history "Permalink") Version history * [引入](https://gitlab.com/gitlab-org/gitlab/-/issues/209121)了在 GitLab 12.10 中下載`.csv` . * GitLab 13.1 中[引入的圖](https://gitlab.com/gitlab-org/gitlab/-/issues/33743) . 如果您想查看項目代碼覆蓋率隨時間的變化,則可以查看圖形或下載包含此數據的 CSV 文件. 從您的項目中: 1. 去 **單擊項目分析>存儲庫,**以查看圖表上方下拉列表中列出的每個作業的歷史數據. 2. 如果您想要該數據的 CSV 文件,請點擊**下載原始數據(.csv)** [![Code coverage graph of a project over time](https://img.kancloud.cn/ae/b5/aeb59d2e907af1caad23beeacfe64158_2976x880.png)](img/code_coverage_graph_v13_1.png) ### Removing color codes[](#removing-color-codes "Permalink") 某些使用 ANSI 顏色代碼輸出的測試 coverage 工具無法通過正則表達式正確解析,并且會導致 coverage 解析失敗. 如果 Coverage 工具沒有提供禁用輸出中顏色代碼的選項,則可以通過一個小的單行腳本通過管道傳遞 Coverage 工具的輸出,該腳本將去除顏色代碼. 例如: ``` lein cloverage | perl -pe 's/\e\[?.*?[\@-~]//g' ``` ## Visibility of pipelines[](#visibility-of-pipelines "Permalink") Pipeline visibility is determined by: * 您當前的[用戶訪問級別](../../user/permissions.html) . * 項目**設置> CI / CD>常規管道**下的**公共管道**項目設置. **注意:**如果項目可見性設置為" **私有"** ,則" [**公共管道"**設置將無效](../enable_or_disable_ci.html#per-project-user-setting) . 這也決定了這些相關功能的可見性: * 作業輸出日志 * 工作文物 * The [pipeline security dashboard](../../user/application_security/security_dashboard/index.html#pipeline-security) **注意:**當前, [訪客用戶和非項目成員尚看不到](https://gitlab.com/gitlab-org/gitlab/-/issues/25649)作業日志和工件. 如果啟用了**公共管道** (默認): * 對于**公共**項目,任何人都可以查看管道和相關功能. * 對于**內部**項目,任何登錄的用戶都可以查看管道和相關功能. * 對于**私有**項目,任何項目成員(訪客或更高級別)都可以查看管道和相關功能. 如果禁用**公共管道** : * 對于**公共**項目,任何人都可以查看管道,但是只有成員(報告者或更高級別)可以訪問相關功能. * 對于**內部**項目,任何登錄的用戶都可以查看管道. 但是,只有成員(記者或更高級別)可以訪問與工作相關的功能. * 對于**私有**項目,只有項目成員(報告者或更高版本)才能查看管道或訪問相關功能. ## Auto-cancel pending pipelines[](#auto-cancel-pending-pipelines "Permalink") 在 GitLab 9.1 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/9362) . 如果您希望每次創建新管道時(例如在 Git 推送之后或從 UI 手動創建)每次自動取消分支上所有未決的非 HEAD 管道,都可以在項目設置中啟用此功能: 1. 去 **設置> CI / CD** . 2. Expand **通用管道**. 3. 選中**自動取消冗余的未決管道**復選框. 4. Click **保存更改**. 請注意,只有可[中斷](../yaml/README.html#interruptible)設置為`true`作業才會被取消. ## Skip outdated deployment jobs[](#skip-outdated-deployment-jobs "Permalink") 在 GitLab 12.9 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/25276) . 您的項目可能有多個并發部署作業,這些作業計劃在同一時間范圍內運行. 這可能導致舊的部署作業在新的作業之后運行,而這可能不是您想要的. 為了避免這種情況: 1. 去 **設置> CI / CD** . 2. Expand **通用管道**. 3. 選中**跳過過期的部署作業**復選框. 4. Click **保存更改**. 掛起的部署作業將被跳過. 有關更多信息,請參閱[部署安全](../environments/deployment_safety.html) . ## Pipeline Badges[](#pipeline-badges "Permalink") 在管道設置頁面中,您可以找到項目的管道狀態和測試覆蓋率標志. 最新成功的管道將用于讀取管道狀態和測試覆蓋率值. 訪問項目中的管道設置頁面,以查看指向徽章的確切鏈接,以及將徽章圖像嵌入 HTML 或 Markdown 頁面的方法. [![Pipelines badges](https://img.kancloud.cn/e5/99/e599963ac848250eac853af101f59172_964x523.png)](img/pipelines_settings_badges.png) ### Pipeline status badge[](#pipeline-status-badge "Permalink") 根據您的工作狀態,徽章可以具有以下值: * pending * running * passed * failed * skipped * canceled * unknown 您可以使用以下鏈接訪問管道狀態標志圖像: ``` https://example.gitlab.com/<namespace>/<project>/badges/<branch>/pipeline.svg ``` ### Test coverage report badge[](#test-coverage-report-badge "Permalink") GitLab 使定義[覆蓋率報告](#test-coverage-parsing)的正則表達式成為可能,每個作業日志都將與之匹配. 這意味著管道中的每個作業都可以定義測試覆蓋率百分比值. 可以使用以下鏈接訪問測試覆蓋率徽章: ``` https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg ``` 如果要從特定作業獲取覆蓋率報告,可以將`job=coverage_job_name`參數添加到 URL. 例如,以下 Markdown 代碼會將`coverage`作業的測試覆蓋率報告標志嵌入到`README.md` : ``` ![coverage](https://gitlab.com/gitlab-org/gitlab/badges/master/coverage.svg?job=coverage) ``` ### Badge styles[](#badge-styles "Permalink") 通過向 URL 添加`style=style_name`參數,可以以不同的樣式呈現管道標志. 當前有兩種樣式: #### Flat (default)[](#flat-default "Permalink") ``` https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat ``` [![Badge flat style](https://img.kancloud.cn/06/4f/064faeabfa632bc3666d02e680294f2f.png)](https://gitlab.com/gitlab-org/gitlab/badges/master/coverage.svg?job=coverage&style=flat) #### Flat square[](#flat-square "Permalink") 在 GitLab 11.8 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/30120) . ``` https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat-square ``` [![Badge flat square style](https://img.kancloud.cn/af/c0/afc0136c17cc4adfc31c6401d7905cd5.png)](https://gitlab.com/gitlab-org/gitlab/badges/master/coverage.svg?job=coverage&style=flat-square) ### Custom badge text[](#custom-badge-text "Permalink") 在 GitLab 13.1 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/17555) . 徽章的文本可以自定義. 這有助于區分在同一管道中運行的多個 Coverage 作業. 通過將`key_text=custom_text`和`key_width=custom_key_width`參數添加到 URL 來定制徽章文本和寬度: ``` https://gitlab.com/gitlab-org/gitlab/badges/master/coverage.svg?job=karma&key_text=Frontend+Coverage&key_width=100 ``` [![Badge with custom text and width](https://img.kancloud.cn/6c/35/6c35596212ec118c93e00bf59cff613f.png)](https://gitlab.com/gitlab-org/gitlab/badges/master/coverage.svg?job=karma&key_text=Frontend+Coverage&key_width=100) ## Environment Variables[](#environment-variables "Permalink") 可以在環境中設置[環境變量](../variables/README.html#gitlab-cicd-environment-variables)以供跑步者使用.
                  <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>

                              哎呀哎呀视频在线观看