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-delete-profile-wft
22 namespace: osm-workflows
30 - name: fleet_destination_folder
31 - name: git_fleet_cred_secret
46 # secondsAfterCompletion: 100 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
47 # secondsAfterSuccess: 50 # Time to live after workflow is successful
48 # secondsAfterFailure: 50 # Time to live after workflow fails
50 entrypoint: delete-profile
55 - name: delete-profile
60 - name: fleet_destination_folder
61 - name: git_fleet_cred_secret
72 # ------ Preparations for transaction
73 - - name: generate-fleet-volume-repo
75 name: k8s-resources-wft
76 template: generate-volume
90 value: "{{inputs.parameters.git_fleet_url}}"
91 - name: destination_folder
92 value: "{{inputs.parameters.fleet_destination_folder}}"
93 - name: git_cred_secret
94 value: "{{inputs.parameters.git_fleet_cred_secret}}"
95 - name: git_volume_name
96 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
97 # ------ end of preparations for transaction
99 # ------ Transformations
101 - - name: delete-profile
103 name: profile-management-wft
104 template: delete-profile
107 # Volumes with cloned repos
108 - name: fleet_volume_name
109 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
110 - name: fleet_mount_path
112 # Specific parameters
114 value: "{{inputs.parameters.profile_name}}"
116 value: "{{inputs.parameters.profile_type}}"
118 value: "{{inputs.parameters.project_name}}"
119 # ------ end of transformations
121 # ------ Commit transaction
122 - - name: push-to-fleet
125 template: git-commit-merge-push
131 value: "{{inputs.parameters.fleet_destination_folder}}"
132 - name: git_cred_secret
133 value: "{{inputs.parameters.git_fleet_cred_secret}}"
134 - name: git_volume_name
135 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
136 - name: commit_message
137 value: "Delete profile {{inputs.parameters.profile_name}} of type {{inputs.parameters.profile_type}}"
140 - name: contrib_branch
143 value: "{{inputs.parameters.dry_run}}"
144 # ------ end of commit transaction