Parallelism

Updated 2 years ago by Admin

Pipeline steps are executed sequentially by default. You can optionally describe your build steps as a directed acyclic graph. In the below example we fan-out to execute the first two steps in parallel, and then once complete, we fan-in to execute the final step:

1  kind: pipeline
2 type: exec
3 name: default
4
5 steps:
6 - name: backend
7 commands:
8 - go build
9 - go test
10
11 - name: frontend
12 commands:
13 - npm install
14 - npm test
15
16 - name: publish
17 commands:
18 - docker build -t hello-world .
19 - docker push hello-world
20 depends_on:
21 - frontend
22 - backend

The above example is quite simple, however, you can use this syntax to create very complex execution flows.

Note that when you define the dependency graph you must configure dependencies for all pipeline steps.
Note that you can use conditional steps in your dependency graph. The scheduler automatically corrects the dependency graph for skipped steps.


How did we do?