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-oka-wtf
22 namespace: osm-workflows
27 - name: git_sw_catalogs_url
28 - name: sw_catalogs_destination_folder
29 - name: git_sw_catalogs_cred_secret
30 # Specific parameters - OKA
32 ## Choose among `infra-controllers`, `infra-configs`, `cloud-resources`, `apps`:
44 secondsAfterCompletion: 6000 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
45 secondsAfterSuccess: 6000 # Time to live after workflow is successful
46 secondsAfterFailure: 9000 # Time to live after workflow fails
48 entrypoint: delete-oka
55 - name: git_sw_catalogs_url
56 - name: sw_catalogs_destination_folder
57 - name: git_sw_catalogs_cred_secret
64 # ------ Preparations for transaction
65 - - name: generate-sw-catalogs-volume-repo
67 name: k8s-resources-wft
68 template: generate-volume
73 - - name: clone-sw-catalogs
82 value: "{{inputs.parameters.git_sw_catalogs_url}}"
83 - name: destination_folder
84 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
85 - name: git_cred_secret
86 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
87 - name: git_volume_name
88 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
89 # ------ end of preparations for transaction
91 # ------ Transformations
94 name: oka-management-wft
98 # References to required external resources
99 - name: sw_catalogs_volume_name
100 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
101 # Specific parameters
103 value: "{{inputs.parameters.oka_name}}"
105 value: "{{inputs.parameters.oka_type}}"
107 value: "{{inputs.parameters.project_name}}"
110 value: "{{inputs.parameters.debug}}"
111 # ------ end of transformations
113 # ------ Commit transaction
114 - - name: push-to-sw-catalogs
117 template: git-commit-merge-push
121 value: "/sw-catalogs"
123 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
124 - name: git_cred_secret
125 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
126 - name: git_volume_name
127 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
128 - name: commit_message
129 value: "Delete OKA {{inputs.parameters.oka_name}} of {{inputs.parameters.oka_type}} type @ {{inputs.parameters.project_name}} project"
132 - name: contrib_branch
135 value: "{{inputs.parameters.dry_run}}"
136 # ------ end of commit transaction