Created
August 7, 2020 14:44
-
-
Save mweibel/a227f18b3a2a598251ec13894b88f239 to your computer and use it in GitHub Desktop.
argo artifact passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: artifact-passing-linux- | |
spec: | |
entrypoint: artifact-example | |
artifactRepositoryRef: | |
key: gcs | |
templates: | |
- name: artifact-example | |
steps: | |
- - name: generate-artifact | |
template: whalesay | |
- - name: consume-artifact | |
template: print-message | |
arguments: | |
artifacts: | |
# bind message to the hello-art artifact | |
# generated by the generate-artifact step | |
- name: message | |
from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" | |
- name: whalesay | |
container: | |
image: docker/whalesay:latest | |
command: [sh, -c] | |
args: | |
[ | |
"mkdir -p /tmp/foobar; cowsay hello world | tee /tmp/foobar/hello_world.txt", | |
] | |
outputs: | |
artifacts: | |
# generate hello-art artifact from /tmp/foobar/hello_world.txt | |
# artifacts can be directories as well as files | |
- name: hello-art | |
path: /tmp/foobar/ | |
archive: | |
none: {} | |
- name: print-message | |
inputs: | |
artifacts: | |
# unpack the message input artifact | |
# and put it at /message | |
- name: message | |
path: "/message" | |
archive: | |
none: {} | |
nodeSelector: | |
kubernetes.io/os: linux | |
container: | |
image: alpine:latest | |
command: ["sh", "-c"] | |
args: ["cat /message/hello_world.txt"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: artifact-passing-windows- | |
spec: | |
entrypoint: artifact-example | |
artifactRepositoryRef: | |
key: gcs | |
templates: | |
- name: artifact-example | |
steps: | |
- - name: generate-artifact | |
template: whalesay | |
- - name: consume-artifact | |
template: print-message | |
arguments: | |
artifacts: | |
# bind message to the hello-art artifact | |
# generated by the generate-artifact step | |
- name: message | |
from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" | |
- name: whalesay | |
container: | |
image: docker/whalesay:latest | |
command: [sh, -c] | |
args: | |
[ | |
"mkdir -p /tmp/foobar; cowsay hello world | tee /tmp/foobar/hello_world.txt", | |
] | |
outputs: | |
artifacts: | |
# generate hello-art artifact from /tmp/foobar/hello_world.txt | |
# artifacts can be directories as well as files | |
- name: hello-art | |
path: /tmp/foobar/ | |
archive: | |
none: {} | |
- name: print-message | |
inputs: | |
artifacts: | |
# unpack the message input artifact | |
# and put it at C:\message | |
- name: message | |
path: "/message" | |
archive: | |
none: {} | |
nodeSelector: | |
kubernetes.io/os: windows | |
container: | |
image: mcr.microsoft.com/windows/nanoserver:1809 | |
command: ["cmd", "/c"] | |
args: ["dir C:\\message /b /a /s"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment