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-clone-ksu-wtf
22 namespace: osm-workflows
28 - name: fleet_destination_folder
29 - name: git_fleet_cred_secret
30 # Specific parameters - Source and destination KSU
32 - name: source_ksu_name
33 - name: source_profile_name
34 - name: source_profile_type
35 - name: source_project_name
38 ## - If any of the destination parameters are not specified, it will assume
39 ## they are the same as in source.
40 ## - It will reject if all are empty or equal to source, to avoid cloning a KSU over itself
41 - name: destination_ksu_name
43 - name: destination_profile_name
45 - name: destination_profile_type
47 - name: destination_project_name
57 secondsAfterCompletion: 6000 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
58 secondsAfterSuccess: 6000 # Time to live after workflow is successful
59 secondsAfterFailure: 9000 # Time to live after workflow fails
70 - name: fleet_destination_folder
71 - name: git_fleet_cred_secret
72 # Specific parameters - Source and destination KSU
74 - name: source_ksu_name
75 - name: source_profile_name
76 - name: source_profile_type
77 - name: source_project_name
79 - name: destination_ksu_name
80 - name: destination_profile_name
81 - name: destination_profile_type
82 - name: destination_project_name
88 # ------ Preparations for transaction
89 - - name: generate-fleet-volume-repo
91 name: k8s-resources-wft
92 template: generate-volume
97 - name: generate-sw-catalogs-volume-repo
99 name: k8s-resources-wft
100 template: generate-volume
105 - - name: clone-fleet
114 value: "{{inputs.parameters.git_fleet_url}}"
115 - name: destination_folder
116 value: "{{inputs.parameters.fleet_destination_folder}}"
117 - name: git_cred_secret
118 value: "{{inputs.parameters.git_fleet_cred_secret}}"
119 - name: git_volume_name
120 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
121 # ------ end of preparations for transaction
123 # ------ Transformations
126 name: ksu-management-wft
130 # References to required external resources
131 - name: fleet_volume_name
132 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
133 # Specific parameters - Source and destination KSU
135 - name: source_ksu_name
136 value: "{{inputs.parameters.source_ksu_name}}"
137 - name: source_profile_name
138 value: "{{inputs.parameters.source_profile_name}}"
139 - name: source_profile_type
140 value: "{{inputs.parameters.source_profile_type}}"
141 - name: source_project_name
142 value: "{{inputs.parameters.source_project_name}}"
144 - name: destination_ksu_name
145 value: "{{inputs.parameters.destination_ksu_name}}"
146 - name: destination_profile_name
147 value: "{{inputs.parameters.destination_profile_name}}"
148 - name: destination_profile_type
149 value: "{{inputs.parameters.destination_profile_type}}"
150 - name: destination_project_name
151 value: "{{inputs.parameters.destination_project_name}}"
154 value: "{{inputs.parameters.debug}}"
155 # ------ end of transformations
157 # ------ Commit transaction
158 - - name: push-to-fleet
161 template: git-commit-merge-push
167 value: "{{inputs.parameters.fleet_destination_folder}}"
168 - name: git_cred_secret
169 value: "{{inputs.parameters.git_fleet_cred_secret}}"
170 - name: git_volume_name
171 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
172 - name: commit_message
173 value: "Clone KSU {{inputs.parameters.source_ksu_name}} at {{inputs.parameters.source_profile_name}} profile of {{inputs.parameters.source_profile_type}} type @ {{inputs.parameters.source_project_name}} project as {{inputs.parameters.destination_ksu_name}} KSU at {{inputs.parameters.destination_profile_name}} profile of {{inputs.parameters.destination_profile_type}} type @ {{inputs.parameters.destination_project_name}}"
176 - name: contrib_branch
179 value: "{{inputs.parameters.dry_run}}"
180 # ------ end of commit transaction