forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 1
/
workspace.yaml
93 lines (93 loc) · 2.21 KB
/
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
87
88
89
90
91
92
93
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
resources:
requests:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-configmap
data:
message: hello world
---
apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
stringData:
username: user
data:
message: aGVsbG8gc2VjcmV0
---
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
generateName: custom-volume-
spec:
workspaces:
- name: custom
persistentVolumeClaim:
claimName: my-pvc
subPath: my-subdir
- name: custom2
persistentVolumeClaim:
claimName: my-pvc
- name: custom3
emptyDir: {}
subPath: testing
- name: custom4
configMap:
name: my-configmap
items:
- key: message
path: my-message.txt
- name: custom5
secret:
secretName: my-secret
taskSpec:
steps:
- name: write
image: ubuntu
script: echo $(workspaces.custom.volume) > $(workspaces.custom.path)/foo
- name: read
image: ubuntu
script: cat $(workspaces.custom.path)/foo | grep $(workspaces.custom.volume)
- name: write2
image: ubuntu
script: echo $(workspaces.custom2.path) > $(workspaces.custom2.path)/foo
- name: read2
image: ubuntu
script: cat $(workspaces.custom2.path)/foo | grep $(workspaces.custom2.path)
- name: write3
image: ubuntu
script: echo $(workspaces.custom3.path) > $(workspaces.custom3.path)/foo
- name: read3
image: ubuntu
script: cat $(workspaces.custom3.path)/foo | grep $(workspaces.custom3.path)
- name: readconfigmap
image: ubuntu
script: cat $(workspaces.custom4.path)/my-message.txt | grep "hello world"
- name: readsecret
image: ubuntu
script: |
#!/usr/bin/env bash
set -xe
cat $(workspaces.custom5.path)/username | grep "user"
cat $(workspaces.custom5.path)/message | grep "hello secret"
workspaces:
- name: custom
- name: custom2
mountPath: /foo/bar/baz
- name: custom3
- name: custom4
mountPath: /baz/bar/quux
- name: custom5
mountPath: /my/secret/volume