forked from pdevine/yoyobrawlah
-
Notifications
You must be signed in to change notification settings - Fork 6
/
pipekit.yaml
46 lines (44 loc) · 1.03 KB
/
pipekit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: dag-diamond-coinflip-
spec:
entrypoint: diamond
templates:
- name: diamond
dag:
tasks:
- name: A
template: coinflip
- name: B
dependencies: [A]
template: coinflip
- name: C
dependencies: [A]
template: coinflip
- name: D
dependencies: [B, C]
template: coinflip
- name: coinflip
steps:
- - name: flip-coin
template: flip-coin
- - name: heads
template: heads
when: "{{steps.flip-coin.outputs.result}} == heads"
- name: tails
template: coinflip
when: "{{steps.flip-coin.outputs.result}} == tails"
- name: flip-coin
script:
image: python:alpine3.6
command: [python]
source: |
import random
result = "heads" if random.randint(0,1) == 0 else "tails"
print(result)
- name: heads
container:
image: alpine:3.6
command: [sh, -c]
args: ["echo \"it was heads\""]