1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
18 apiVersion: argoproj.io/v1alpha1
19 kind: WorkflowTemplate
21 name: full-update-ksu-hr-wtf
22 namespace: osm-workflows
28 - name: fleet_destination_folder
29 - name: git_fleet_cred_secret
31 - name: git_sw_catalogs_url
32 - name: sw_catalogs_destination_folder
33 - name: git_sw_catalogs_cred_secret
34 # Specific parameters - Base KSU generation from template
35 ## Relative path from "SW Catalogs" repo root
36 - name: templates_path
37 ## Should substitute environment variables in the template?
38 - name: substitute_environment
39 ## Filter for substitution of environment variables
40 - name: substitution_filter
41 ## Custom environment variables (formatted as .env), to be used for template parametrization
42 - name: custom_env_vars
43 # Specific parameters - Patch HelmRelease in KSU with inline values
44 - name: kustomization_name
45 - name: helmrelease_name
47 # Specific parameters - Secret generation
48 - name: is_preexisting_secret
50 - name: age_public_key
51 - name: values_secret_name
54 ################################################################
55 # This temporary secret should exist already in the `osm-workflows`
56 # namespace and contain the desired secret key-values
57 # in a well-known key (in the example, `creds`).
63 # jenkinsPassword: myJ3nk1n2P2ssw0rd
64 - name: reference_secret_for_values
65 - name: reference_key_for_values
66 # Specific parameters - Configmap generation
67 - name: is_preexisting_cm
68 - name: values_cm_name
73 # Specific parameters - KSU rendering
87 secondsAfterCompletion: 6000 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
88 secondsAfterSuccess: 6000 # Time to live after workflow is successful
89 secondsAfterFailure: 9000 # Time to live after workflow fails
91 entrypoint: update-ksu-hr
100 - name: fleet_destination_folder
101 - name: git_fleet_cred_secret
103 - name: git_sw_catalogs_url
104 - name: sw_catalogs_destination_folder
105 - name: git_sw_catalogs_cred_secret
106 # Specific parameters - Base KSU generation from template
107 - name: templates_path
108 - name: substitute_environment
109 - name: substitution_filter
110 - name: custom_env_vars
111 # Specific parameters - Patch HelmRelease in KSU with inline values
112 - name: kustomization_name
113 - name: helmrelease_name
114 - name: inline_values
115 # Specific parameters - Secret generation
116 - name: is_preexisting_secret
118 - name: age_public_key
119 - name: values_secret_name
120 - name: reference_secret_for_values
121 - name: reference_key_for_values
123 # Specific parameters - Configmap generation
124 - name: is_preexisting_cm
125 - name: values_cm_name
128 # Specific parameters - KSU rendering
138 # ------ Preparations for transaction
139 - - name: generate-fleet-volume-repo
141 name: k8s-resources-wft
142 template: generate-volume
147 - name: generate-sw-catalogs-volume-repo
149 name: k8s-resources-wft
150 template: generate-volume
155 - - name: clone-fleet
164 value: "{{inputs.parameters.git_fleet_url}}"
165 - name: destination_folder
166 value: "{{inputs.parameters.fleet_destination_folder}}"
167 - name: git_cred_secret
168 value: "{{inputs.parameters.git_fleet_cred_secret}}"
169 - name: git_volume_name
170 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
171 - name: clone-sw-catalogs
178 value: "/sw-catalogs"
180 value: "{{inputs.parameters.git_sw_catalogs_url}}"
181 - name: destination_folder
182 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
183 - name: git_cred_secret
184 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
185 - name: git_volume_name
186 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
187 # ------ end of preparations for transaction
189 # ------ Transformations
190 - - name: update-ksu-oka-hr
192 name: ksu-management-wft
193 template: update-ksu-oka-hr
196 # References to required external resources
197 - name: fleet_volume_name
198 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
199 - name: sw_catalogs_volume_name
200 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
201 # Specific parameters - Base KSU generation from template
202 - name: templates_path
203 value: "{{inputs.parameters.templates_path}}"
204 - name: substitute_environment
205 value: "{{inputs.parameters.substitute_environment}}"
206 - name: substitution_filter
207 value: "{{inputs.parameters.substitution_filter}}"
208 - name: custom_env_vars
209 value: "{{inputs.parameters.custom_env_vars}}"
210 # Specific parameters - Patch HelmRelease in KSU with inline values
211 - name: kustomization_name
212 value: "{{inputs.parameters.kustomization_name}}"
213 - name: helmrelease_name
214 value: "{{inputs.parameters.helmrelease_name}}"
215 - name: inline_values
216 value: "{{inputs.parameters.inline_values}}"
217 # Specific parameters - Secret generation
218 - name: is_preexisting_secret
219 value: "{{inputs.parameters.is_preexisting_secret}}"
221 value: "{{inputs.parameters.target_ns}}"
222 - name: age_public_key
223 value: "{{inputs.parameters.age_public_key}}"
224 - name: values_secret_name
225 value: "{{inputs.parameters.values_secret_name}}"
226 - name: reference_secret_for_values
227 value: "{{inputs.parameters.reference_secret_for_values}}"
228 - name: reference_key_for_values
229 value: "{{inputs.parameters.reference_key_for_values}}"
231 value: "{{inputs.parameters.secret_key}}"
232 # Specific parameters - Configmap generation
233 - name: is_preexisting_cm
234 value: "{{inputs.parameters.is_preexisting_cm}}"
235 - name: values_cm_name
236 value: "{{inputs.parameters.values_cm_name}}"
238 value: "{{inputs.parameters.cm_key}}"
240 value: "{{inputs.parameters.cm_values}}"
241 # Specific parameters - KSU rendering
243 value: "{{inputs.parameters.ksu_name}}"
245 value: "{{inputs.parameters.profile_name}}"
247 value: "{{inputs.parameters.profile_type}}"
249 value: "{{inputs.parameters.project_name}}"
252 value: "{{inputs.parameters.debug}}"
253 # ------ end of transformations
255 # ------ Commit transaction
256 - - name: push-to-fleet
259 template: git-commit-merge-push
265 value: "{{inputs.parameters.fleet_destination_folder}}"
266 - name: git_cred_secret
267 value: "{{inputs.parameters.git_fleet_cred_secret}}"
268 - name: git_volume_name
269 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
270 - name: commit_message
271 value: "Update KSU {{inputs.parameters.ksu_name}} of {{inputs.parameters.profile_name}} profile of {{inputs.parameters.profile_type}} type @ {{inputs.parameters.project_name}} project"
274 - name: contrib_branch
277 value: "{{inputs.parameters.dry_run}}"
278 # ------ end of commit transaction