forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexit-handler-with-artifacts.yaml
46 lines (44 loc) · 1.19 KB
/
exit-handler-with-artifacts.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: exit-handler-with-artifacts-
labels:
workflows.argoproj.io/test: "true"
annotations:
workflows.argoproj.io/description: |
onExitTemplate enables workflow to pass the arguments (parameters/Artifacts) to exit handler template.
workflows.argoproj.io/version: '>= 3.1.0'
spec:
entrypoint: main
templates:
- name: main
steps:
- - name: step-1
template: output
hooks:
exit:
template: exit
arguments:
artifacts:
- name: message
from: "{{steps.step-1.outputs.artifacts.result}}"
- name: output
script:
image: python:alpine3.6
command: [ python ]
source: |
with open("result.txt", "w") as f:
f.write("Welcome")
outputs:
artifacts:
- name: result
path: /result.txt
- name: exit
inputs:
artifacts:
- name: message
path: /tmp/message
container:
image: python:alpine3.6
command: [sh, -c]
args: ["cat /tmp/message"]