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-create-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 # Temporary volume with OKA contents
31 - name: temp_volume_name
32 # Specific parameters - OKA
34 ## Choose among `infra-controllers`, `infra-configs`, `cloud-resources`, `apps`:
48 secondsAfterCompletion: 6000 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
49 secondsAfterSuccess: 6000 # Time to live after workflow is successful
50 secondsAfterFailure: 9000 # Time to live after workflow fails
52 entrypoint: create-oka
59 - name: git_sw_catalogs_url
60 - name: sw_catalogs_destination_folder
61 - name: git_sw_catalogs_cred_secret
62 - name: temp_volume_name
70 # ------ Preparations for transaction
71 - - name: generate-sw-catalogs-volume-repo
73 name: k8s-resources-wft
74 template: generate-volume
79 - - name: clone-sw-catalogs
88 value: "{{inputs.parameters.git_sw_catalogs_url}}"
89 - name: destination_folder
90 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
91 - name: git_cred_secret
92 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
93 - name: git_volume_name
94 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
95 # ------ end of preparations for transaction
97 # ------ Transformations
100 name: oka-management-wft
104 # References to required external resources
105 - name: sw_catalogs_volume_name
106 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
107 - name: temp_volume_name
108 value: "{{inputs.parameters.temp_volume_name}}"
109 # Specific parameters
111 value: "{{inputs.parameters.oka_name}}"
113 value: "{{inputs.parameters.oka_type}}"
115 value: "{{inputs.parameters.project_name}}"
117 value: "{{inputs.parameters.tarball_file}}"
120 value: "{{inputs.parameters.debug}}"
121 # ------ end of transformations
123 # ------ Commit transaction
124 - - name: push-to-sw-catalogs
127 template: git-commit-merge-push
131 value: "/sw-catalogs"
133 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
134 - name: git_cred_secret
135 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
136 - name: git_volume_name
137 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
138 - name: commit_message
139 value: "Create OKA {{inputs.parameters.oka_name}} of {{inputs.parameters.oka_type}} type @ {{inputs.parameters.project_name}} project"
142 - name: contrib_branch
145 value: "{{inputs.parameters.dry_run}}"
146 # ------ end of commit transaction