forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal-outputs.yaml
70 lines (65 loc) · 2.1 KB
/
global-outputs.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: global-outputs-
spec:
entrypoint: generate-globals
onExit: consume-globals
templates:
- name: generate-globals
steps:
- - name: generate
template: global-output
- - name: consume-globals
template: consume-globals
# Template which produces a global parameter and artifact
- name: global-output
container:
image: alpine:3.7
command: [sh, -c]
args: ["sleep 1; echo -n hello world > /tmp/hello_world.txt"]
outputs:
parameters:
# export a global parameter. The parameter will be programatically available in the completed
# workflow object under: workflow.outputs.parameters
- name: hello-param
valueFrom:
path: /tmp/hello_world.txt
globalName: my-global-param
# export a global artifact. The artifact will be programatically available in the completed
# workflow object under: workflow.outputs.artifacts
artifacts:
- name: hello-art
path: /tmp/hello_world.txt
globalName: my-global-art
# Once exported, global outputs are referenceable in later parts of the workflow.
# In this example, the consume-globals template is invoked after the generate-globals step, as
# well as in the onExit handler, and can reference the globals, my-global-param and my-global-art.
- name: consume-globals
steps:
- - name: consume-global-param
template: consume-global-param
- name: consume-global-art
template: consume-global-art
arguments:
artifacts:
- name: art
from: "{{workflow.outputs.artifacts.my-global-art}}"
- name: consume-global-param
inputs:
parameters:
- name: param
value: "{{workflow.outputs.parameters.my-global-param}}"
container:
image: alpine:3.7
command: [sh, -c]
args: ["echo {{inputs.parameters.param}}"]
- name: consume-global-art
inputs:
artifacts:
- name: art
path: /art
container:
image: alpine:3.7
command: [sh, -c]
args: ["cat /art"]