Skip to content

Commit

Permalink
Add example yamls for proposal for scripting steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen committed Oct 30, 2017
1 parent c782e2e commit a896f03
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
18 changes: 18 additions & 0 deletions examples/input-artifact-http.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1
kind: Workflow
metadata:
generateName: argo-wf-
spec:
entrypoint: http-artifact-example
templates:
- name: http-artifact-example
type: container
inputs:
artifacts:
CODE:
path: /bin/foo
http:
url: https://mycompany.com/files/foo
image: alpine:latest
command: [sh, -c]
args: ["/bin/foo"]
8 changes: 4 additions & 4 deletions examples/input-artifact-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: Workflow
metadata:
generateName: argo-wf-
spec:
entrypoint: git-clone
entrypoint: input-artifact-s3-example
templates:
- name: git-clone
- name: input-artifact-s3-example
type: container
inputs:
artifacts:
Expand All @@ -21,6 +21,6 @@ spec:
secretKeySecret:
name: my-s3-credentials
key: secretKey
image: golang:1.8
image: debian:latest
command: [sh, -c]
args: ["cd /src; git status"]
args: ["cd /src && ls -l"]
36 changes: 36 additions & 0 deletions examples/scripts-python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: argoproj.io/v1
kind: Workflow
metadata:
generateName: argo-wf-
spec:
entrypoint: python-script-example
templates:
-
name: python-script-example
steps:
- GENERATE:
template: gen-random-int
- PRINT:
template: print-message
arguments:
parameters.MESSAGE: "{{steps.GENERATE.outputs.result}}"
-
name: gen-random-int
script:
image: python:3.6
command: [python3]
source: |
import random
import json
i = random.randint(1, 100)
print(json.dumps(i))
-
name: print-message
inputs:
parameters:
MESSAGE:
container:
image: alpine:latest
command: [sh, -c]
args: ["echo {{inputs.parameters.MESSAGE}}"]

0 comments on commit a896f03

Please sign in to comment.