5d4d1644c6df88c85df51472c33af2781e2a2fd2
[osm/devops.git] /
1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #    http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
17
18 apiVersion: argoproj.io/v1alpha1
19 kind: WorkflowTemplate
20 metadata:
21   name: debugging-wft
22   namespace: osm-workflows
23
24 spec:
25   templates:
26   # Leaf templates
27   - name: ls-command
28     inputs:
29       parameters:
30       - name: volume_name
31       - name: folder
32       - name: mount_path
33     volumes:
34     - name: shared-volume
35       persistentVolumeClaim:
36         claimName: '{{inputs.parameters.volume_name}}'
37     script:
38       image: alpine:3.20
39       volumeMounts:
40       - name: shared-volume
41         mountPath: "{{inputs.parameters.mount_path}}"
42       command: ["sh"]
43       source: |
44         ls -laR "{{inputs.parameters.folder}}"
45   - name: find-command
46     inputs:
47       parameters:
48       - name: volume_name
49       - name: folder
50       - name: mount_path
51     volumes:
52     - name: shared-volume
53       persistentVolumeClaim:
54         claimName: '{{inputs.parameters.volume_name}}'
55     script:
56       image: alpine:3.20
57       volumeMounts:
58       - name: shared-volume
59         mountPath: "{{inputs.parameters.mount_path}}"
60       command: ["sh"]
61       source: |
62         find "{{inputs.parameters.folder}}"
63   - name: echo-command
64     inputs:
65       parameters:
66       - name: message
67     script:
68       image: alpine:3.20
69       command: ["sh"]
70       source: |
71         echo "{{inputs.parameters.message}}"
72   - name: cat-command
73     inputs:
74       parameters:
75       - name: volume_name
76       - name: mount_path
77       - name: filename
78     volumes:
79     - name: shared-volume
80       persistentVolumeClaim:
81         claimName: '{{inputs.parameters.volume_name}}'
82     script:
83       image: alpine:3.20
84       volumeMounts:
85       - name: shared-volume
86         mountPath: "{{inputs.parameters.mount_path}}"
87       command: ["sh"]
88       source: |
89         cat '{{inputs.parameters.filename}}'
90   - name: touch-command
91     inputs:
92       parameters:
93       - name: volume_name
94       - name: mount_path
95       - name: filename
96     volumes:
97     - name: shared-volume
98       persistentVolumeClaim:
99         claimName: '{{inputs.parameters.volume_name}}'
100     script:
101       image: alpine:3.20
102       volumeMounts:
103       - name: shared-volume
104         mountPath: "{{inputs.parameters.mount_path}}"
105       command: ["sh"]
106       source: |
107         touch "{{inputs.parameters.filename}}"