forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelinerun-using-different-subpaths-of-workspace.yaml
86 lines (86 loc) · 1.72 KB
/
pipelinerun-using-different-subpaths-of-workspace.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: tekton.dev/v1
kind: Task
metadata:
name: writer
spec:
steps:
- name: write
image: ubuntu
script: echo bar > $(workspaces.task-ws.path)/foo
workspaces:
- name: task-ws
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: read-both
spec:
params:
- name: directory1
type: string
- name: directory2
type: string
workspaces:
- name: local-ws
steps:
- name: read-1
image: ubuntu
script: cat $(workspaces.local-ws.path)/$(params.directory1)/foo | grep bar
- name: read-2
image: ubuntu
script: cat $(workspaces.local-ws.path)/$(params.directory2)/foo | grep bar
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: pipeline-using-different-subpaths
spec:
workspaces:
- name: ws
tasks:
- name: writer-1
taskRef:
name: writer
workspaces:
- name: task-ws
workspace: ws
subPath: dir-1
- name: writer-2
runAfter:
- writer-1
taskRef:
name: writer
workspaces:
- name: task-ws
workspace: ws
subPath: dir-2
- name: read-all
runAfter:
- writer-2
params:
- name: directory1
value: dir-1
- name: directory2
value: dir-2
taskRef:
name: read-both
workspaces:
- name: local-ws
workspace: ws
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: pr-different-path-
spec:
pipelineRef:
name: pipeline-using-different-subpaths
workspaces:
- name: ws
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi