forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci-output-artifact.yaml
86 lines (80 loc) · 2.05 KB
/
ci-output-artifact.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: ci-output-artifact-
spec:
entrypoint: ci-example
# a temporary volume, named workdir, will be used as a working
# directory for this workflow. This volume is passed around
# from step to step.
volumeClaimTemplates:
- metadata:
name: workdir
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
templates:
- name: ci-example
steps:
- - name: build
template: build-golang-example
# the test step expands into three parallel steps running
# different operating system images. each mounts the workdir
# and runs the compiled binary from the build step.
- - name: test
template: run-hello
arguments:
parameters:
- name: os-image
value: "{{item.image}}:{{item.tag}}"
withItems:
- { image: 'debian', tag: '9.1' }
- { image: 'alpine', tag: '3.6' }
- { image: 'ubuntu', tag: '17.10' }
- - name: release
template: release-artifact
- name: build-golang-example
inputs:
artifacts:
- name: code
path: /go/src/github.com/golang/example
git:
repo: https://github.com/golang/example.git
revision: cfe12d6
container:
image: golang:1.8
command: [sh, -c]
args: ["
cd /go/src/github.com/golang/example/hello &&
go build -v .
"]
volumeMounts:
- name: workdir
mountPath: /go
- name: run-hello
inputs:
parameters:
- name: os-image
container:
image: "{{inputs.parameters.os-image}}"
command: [sh, -c]
args: ["
uname -a ;
cat /etc/os-release ;
/go/src/github.com/golang/example/hello/hello
"]
volumeMounts:
- name: workdir
mountPath: /go
- name: release-artifact
container:
image: alpine:3.8
volumeMounts:
- name: workdir
mountPath: /go
outputs:
artifacts:
- name: release
path: /go