![arial font mermaid arial font mermaid](https://ae01.alicdn.com/kf/HTB1AV68OXXXXXXOaXXXq6xXFXXXM/punk-princess-mermaid-arial-For-Samsung-Galaxy-J1-J2-J3-J5-J7-2016-Core-2-S.jpg)
The rules keyword: For example, have the child pipelines triggered only.Into multiple files, keeping things very simple. This is an ideal case for using Child / Parent Pipelines) via In the examples above, it's clear we've got two types of things that could be built independently. graph LR subgraph Pipeline using DAG build_a -> test_a -> deploy_a build_b -> test_b -> deploy_b endĮxample DAG /.gitlab-ci.yml configuration matching the diagram: 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 Test_b, GitLab will start deploy_a even if build_b is still running. In the example below, if build_a and test_a are much faster than build_b and When GitLab knows the relationships between your jobs, it can run everythingĪs fast as possible, and even skips into subsequent stages when possible. Needs keyword to define dependency relationships between You can use Directed Acylic Graphs (DAG). If efficiency is important to you and you want everything to run as quickly as possible, It will start at about the same time as deploy_a." Directed Acyclic Graph Pipelines It will only run when all jobs in the" - echo "test stage complete. 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 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 "build stage are complete too. 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's not the most efficient, and if you have lots of steps it can grow quite complex, but it'sĮasier to maintain: graph LR subgraph deploy stage deploy -> deploy_a deploy -> deploy_b end subgraph test stage test -> test_a test -> test_b end subgraph build stage build -> build_a build -> build_b end build_a -.-> test build_b -.-> test test_a -.-> deploy test_b -.-> deployĮxample basic /.gitlab-ci.yml pipeline configuration matching the diagram: 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 run everything in the build stage concurrently,Īnd once all of those finish, it will run everything in the test stage the same way, and so on. Child/Parent Pipelines: Good for monorepos and projects with lots of independently defined components.Īny of the keywords used below, check out our CI YAML reference for details.Directed Acylic Graph: Good for large, complex projects that need efficient execution.Basic: Good for straightforward projects where all the configuration is in one easy to find place.These methods can be mixed and matched if needed: There are three main ways to structure your pipelines, each with their
![arial font mermaid arial font mermaid](https://www.jbcookiecutters.com/wp-content/uploads/2018/10/JB_Mermaid-Number-Four-266-A331-Cookie-Cutter-Set-scaled.jpg)
Some of the important concepts related to them. Pipelines are the fundamental building blocks for CI/CD in GitLab.