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: ssh
3 name: default
4
5 server:
6 host: 1.2.3.4
7 user: root
8 password:
9 from_secret: password
10
11 steps:
12 - name: backend
13 commands:
14 - go build
15 - go test
16
17 - name: frontend
18 commands:
19 - npm install
20 - npm test
21
22 - name: publish
23 commands:
24 - docker build -t hello-world .
25 - docker push hello-world
26 depends_on:
27 - frontend
28 - 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?