<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之旅 廣告
                # Pipeline Architecture > 原文:[https://docs.gitlab.com/ee/ci/pipelines/pipeline_architectures.html](https://docs.gitlab.com/ee/ci/pipelines/pipeline_architectures.html) * [Basic Pipelines](#basic-pipelines) * [Directed Acyclic Graph Pipelines](#directed-acyclic-graph-pipelines) * [Child / Parent Pipelines](#child--parent-pipelines) # Pipeline Architecture[](#pipeline-architecture "Permalink") 管道是 GitLab 中 CI / CD 的基本構建塊. 本頁記錄了一些與它們有關的重要概念. 構造管道的主要方法有三種,每種都有自己的優勢. 如果需要,可以混合使用以下方法: * [基本](#basic-pipelines) :適用于簡單的項目,其中所有配置都在一個易于查找的位置. * [有向無環圖](#directed-acyclic-graph-pipelines) :適用于需要有效執行的大型,復雜項目. * [子級/父級管道](#child--parent-pipelines) :適用于具有大量獨立定義組件的 monorepos 和項目. 有關下面使用的任何關鍵字的更多詳細信息,請查看我們的[CI YAML 參考](../yaml/README.html)以獲取詳細信息. ## Basic Pipelines[](#basic-pipelines "Permalink") 這是 GitLab 中最簡單的管道. 它會在構建階段同時運行所有內容,一旦所有這些操作完成,它將以相同的方式在測試階段運行所有內容,依此類推. 它不是最有效的,并且如果您有很多步驟,它可能會變得非常復雜,但更易于維護: 圖 LR 子圖部署階段部署-> deploy_a 部署-> deploy_b 結束子圖測試階段測試-> test_a 測試-> test_b 結束子圖構建階段構建-> build_a 構建-> build_b 結束 build_a -.->測試 build_b -.->測試 test_a -.->部署 test_b -.->部署 匹配該圖的示例基本`/.gitlab-ci.yml`管道配置: ``` stages: - build - test - deploy image: alpine build_a: stage: build script: - echo "This job builds something." build_b: stage: build script: - echo "This job builds something else." test_a: stage: test script: - echo "This job tests something. It will only run when all jobs in the" - echo "build stage are complete." test_b: stage: test script: - echo "This job tests something else. It will only run when all jobs in the" - echo "build stage are complete too. It will start at about the same time as test_a." deploy_a: stage: deploy script: - echo "This job deploys something. It will only run when all jobs in the" - echo "test stage complete." deploy_b: stage: deploy script: - echo "This job deploys something else. It will only run when all jobs in the" - echo "test stage complete. It will start at about the same time as deploy_a." ``` ## Directed Acyclic Graph Pipelines[](#directed-acyclic-graph-pipelines "Permalink") 如果效率對您很重要,并且您希望所有內容盡快運行,則可以使用有向無[環圖(DAG)](../directed_acyclic_graph/index.html) . 使用[`needs`關鍵字](../yaml/README.html#needs)定義作業之間的依賴關系. 當 GitLab 知道您的工作之間的關系時,它可以盡快運行所有內容,甚至在可能的情況下跳入后續階段. 在下面的示例中,如果`build_a`和`test_a`的速度比`build_b`和`test_b` ,則即使`build_b`仍在運行,GitLab 也會啟動`deploy_a` . 使用 DAG build_a-> test_a-> deploy_a build_b-> test_b-> deploy_b 結束的圖 LR 子圖管道 匹配該圖的示例 DAG `/.gitlab-ci.yml`配置: ``` stages: - build - test - deploy image: alpine build_a: stage: build script: - echo "This job builds something quickly." build_b: stage: build script: - echo "This job builds something else slowly." test_a: stage: test needs: [build_a] script: - echo "This test job will start as soon as build_a finishes." - echo "It will not wait for build_b, or other jobs in the build stage, to finish." test_b: stage: test needs: [build_b] script: - echo "This test job will start as soon as build_b finishes." - echo "It will not wait for other jobs in the build stage to finish." deploy_a: stage: deploy needs: [test_a] script: - echo "Since build_a and test_a run quickly, this deploy job can run much earlier." - echo "It does not need to wait for build_b or test_b." deploy_b: stage: deploy needs: [test_b] script: - echo "Since build_b and test_b run slowly, this deploy job will run much later." ``` ## Child / Parent Pipelines[](#child--parent-pipelines "Permalink") 在上面的示例中,很明顯,我們可以獨立構建兩種類型的東西. 這是通過[`trigger`關鍵字](../yaml/README.html#trigger)使用" [子/父管道"](../parent_child_pipelines.html)的理想情況. 它將配置分成多個文件,使事情變得非常簡單. 您還可以將其與: * [`rules`關鍵字](../yaml/README.html#rules) :例如,僅在對該區域進行更改時才觸發子管道. * [`include`關鍵字](../yaml/README.html#include) :引入常見行為,確保您不會重復自己. * 子[管道](#directed-acyclic-graph-pipelines)內部的[DAG 管道](#directed-acyclic-graph-pipelines) ,實現了兩者的好處. graph LR subgraph Parent pipeline trigger_a -.-> build_a trigger_b -.-> build_b subgraph child pipeline B build_b --> test_b --> deploy_b end subgraph child pipeline A build_a --> test_a --> deploy_a end end 匹配該圖的父管道的示例`/.gitlab-ci.yml`配置: ``` stages: - triggers trigger_a: stage: triggers trigger: include: a/.gitlab-ci.yml rules: - changes: - a/* trigger_b: stage: triggers trigger: include: b/.gitlab-ci.yml rules: - changes: - b/* ``` 例如孩子`a`管道配置,位于`/a/.gitlab-ci.yml` ,利用的 DAG `needs:`關鍵字: ``` stages: - build - test - deploy image: alpine build_a: stage: build script: - echo "This job builds something." test_a: stage: test needs: [build_a] script: - echo "This job tests something." deploy_a: stage: deploy needs: [test_a] script: - echo "This job deploys something." ``` 子`b`管道配置示例位于`/b/.gitlab-ci.yml` ,利用 DAG `needs:`關鍵字: ``` stages: - build - test - deploy image: alpine build_b: stage: build script: - echo "This job builds something else." test_b: stage: test needs: [build_b] script: - echo "This job tests something else." deploy_b: stage: deploy needs: [test_b] script: - echo "This job deploys something else." ``` 也可以將作業設置為在觸發子管道之前或之后運行,例如,如果您具有通用的設置步驟或最后進行統一部署.
                  <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>

                              哎呀哎呀视频在线观看