<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 CI/CD for external repositories > 原文:[https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/](https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/) * [Pipelines for external pull requests](#pipelines-for-external-pull-requests) * [How it works](#how-it-works) * [Additional predefined variables](#additional-predefined-variables) * [Limitations](#limitations) # GitLab CI/CD for external repositories[](#gitlab-cicd-for-external-repositories-premium "Permalink") [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4642) in [GitLab Premium](https://about.gitlab.com/pricing/) 10.6. GitLab CI / CD 可用于: * [GitHub](github_integration.html). * [Bitbucket Cloud](bitbucket_integration.html). * 任何其他 Git 服務器. 無需將整個項目移至 GitLab,您可以連接外部存儲庫以獲得 GitLab CI / CD 的好處. 連接外部存儲庫將建立[存儲庫鏡像](../../user/project/repository/repository_mirroring.html)并創建一個輕型項目,其中禁用了問題,合并請求,Wiki 和代碼片段. 這些功能[可以稍后重新啟用](../../user/project/settings/index.html#sharing-and-permissions) . 要連接到外部存儲庫: 1. 在您的 GitLab 儀表板上,點擊**新建項目** . 2. 切換到**CI / CD 的外部回購**標簽. 3. Choose **GitHub** or **通過 URL 回購**. 4. 后續步驟類似于[導入流程](../../user/project/import/index.html) . [![CI/CD for external repository project creation](https://img.kancloud.cn/e5/4e/e54e603344e5bed32111edea7a193f70_2560x650.png)](img/ci_cd_for_external_repo.png) ## Pipelines for external pull requests[](#pipelines-for-external-pull-requests "Permalink") [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/65139) in GitLab Premium 12.3. 當將 GitLab CI / CD 與[GitHub 上](github_integration.html)的[外部存儲庫一起使用時](github_integration.html) ,可以在 Pull Request 上下文中運行管道. 當您將更改推送到 GitHub 中的遠程分支時,GitLab CI / CD 可以為該分支運行管道. 但是,當您打開或更新該分支的"拉取請求"時,您可能需要: * 運行額外的工作. * 不運行特定作業. 例如: ``` always-run: script: echo 'this should always run' on-pull-requests: script: echo 'this should run on pull requests' only: - external_pull_requests except-pull-requests: script: echo 'this should not run on pull requests' except: - external_pull_requests ``` ### How it works[](#how-it-works "Permalink") 從 GitHub 導入存儲庫時,GitLab 會訂閱 webhooks 的`push`和`pull_request`事件. 收到`pull_request`事件后,將存儲請求請求數據并將其保留為參考. 如果剛剛創建了 Pull Request,則 GitLab 會立即為外部 Pull Request 創建管道. 如果將更改推送到"拉取請求"所引用的分支,并且"拉取請求"仍處于打開狀態,則會創建用于外部拉取請求的管道. **注意:**在這種情況下,GitLab CI / CD 將創建 2 條管道. 一種用于分支推送,另一種用于外部拉取請求. 關閉"拉取請求"后,即使將新的更改推送到同一分支,也不會為外部拉取請求創建任何管道. ### Additional predefined variables[](#additional-predefined-variables "Permalink") 通過將管道用于外部拉取請求,GitLab 將其他[預定義變量](../variables/predefined_variables.html)公開給管道作業. 變量名稱以`CI_EXTERNAL_PULL_REQUEST_`為前綴. ### Limitations[](#limitations "Permalink") 此功能當前不支持來自派生存儲庫的拉取請求. 來自 fork 存儲庫的任何 Pull Requests 將被忽略. [閱讀更多](https://gitlab.com/gitlab-org/gitlab/-/issues/5667) . 鑒于 GitLab 將創建 2 條管道,如果將更改推送到引用了打開的 Pull Request 的遠程分支,則兩者都將通過 GitHub 集成促進 Pull Request 的狀態. 如果要只在外部請求請求上而不是在分支上運行管道,則可以添加以下內容, `except: [branches]`到作業規范. [閱讀更多](https://gitlab.com/gitlab-org/gitlab/-/issues/24089#workaround) .
                  <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>

                              哎呀哎呀视频在线观看