537753a1a1b4fc4569bc5e5e631f82db7271a0df
[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: clone-transform-push-wft
22   namespace: osm-workflows
23
24 spec:
25   arguments:
26     parameters:
27     # Fleet repo
28     - name: git_fleet_url
29     - name: fleet_destination_folder
30     - name: git_fleet_cred_secret
31     # SW-Catalogs repo
32     - name: git_sw_catalogs_url
33     - name: sw_catalogs_destination_folder
34     - name: git_sw_catalogs_cred_secret
35     # Transformation template
36     - name: templateref_name
37       # value: debugging-wft
38     - name: templateref_template
39       # value: ls-command
40
41   entrypoint: main
42
43   templates:
44
45   # Main template
46   - name: main
47     inputs:
48       parameters:
49       - name: git_fleet_url
50       - name: fleet_destination_folder
51       - name: git_fleet_cred_secret
52       - name: git_sw_catalogs_url
53       - name: sw_catalogs_destination_folder
54       - name: git_sw_catalogs_cred_secret
55       - name: templateref_name
56       - name: templateref_template
57     steps:
58     - - name: generate-volume-repos
59         templateRef:
60           name: k8s-resources-wft
61           template: generate-volume
62         arguments:
63           parameters:
64             - name: pvc-size
65               value: '100Mi'
66     - - name: clone-fleet
67         templateRef:
68           name: git-wft
69           template: git-clone
70         arguments:
71           parameters:
72           - name: repo_url
73             value: "{{inputs.parameters.git_fleet_url}}"
74           - name: destination_folder
75             value: "{{inputs.parameters.fleet_destination_folder}}"
76           - name: git_cred_secret
77             value: "{{inputs.parameters.git_fleet_cred_secret}}"
78           - name: git_volume_name
79             value: '{{steps.generate-volume-repos.outputs.parameters.pvc-name}}'
80     - - name: clone-sw-catalogs
81         templateRef:
82           name: git-wft
83           template: git-clone
84         arguments:
85           parameters:
86           - name: repo_url
87             value: "{{inputs.parameters.git_sw_catalogs_url}}"
88           - name: destination_folder
89             value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
90           - name: git_cred_secret
91             value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
92           - name: git_volume_name
93             value: '{{steps.generate-volume-repos.outputs.parameters.pvc-name}}'
94     - - name: transform
95         templateRef:
96           name: "{{inputs.parameters.templateref_name}}"
97           template: "{{inputs.parameters.templateref_template}}"
98         arguments:
99           parameters:
100           - name: folder
101             value: "/repos"
102           - name: volume_name
103             value: '{{steps.generate-volume-repos.outputs.parameters.pvc-name}}'
104           - name: mount_path
105             value: "/repos"
106     # - - name: list-repo-files
107     #     template: ls-command
108     #     arguments:
109     #       parameters:
110     #       - name: folder
111     #         value: "/repos"
112     #       - name: volume_name
113     #         value: '{{steps.generate-volume-repos.outputs.parameters.pvc-name}}'
114     #       - name: mount_path
115     #         value: "/repos"
116     - - name: push-to-fleet
117         templateRef:
118           name: git-wft
119           template: git-commit-merge-push
120         arguments:
121           parameters:
122           - name: repo_folder
123             value: "{{inputs.parameters.fleet_destination_folder}}"
124           - name: git_cred_secret
125             value: "{{inputs.parameters.git_fleet_cred_secret}}"
126           - name: git_volume_name
127             value: '{{steps.generate-volume-repos.outputs.parameters.pvc-name}}'
128           - name: commit_message
129             value: "My test commit message"
130           - name: main_branch
131             value: main
132           - name: contrib_branch
133             value: osm_contrib