-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
122 lines (121 loc) · 4.86 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: parasol-store-dev-template
title: Parasol Store Development
description: Creates a development sandbox deployment for the Parasol Store app
tags:
- parasol
- parasol-store
spec:
owner: rhdh
type: service
parameters:
- title: Provide Information for the sandbox deployment
required:
- branch
properties:
branch:
title: Branch
type: string
description: Branch of the parasol-store source code repo
- title: Provide database information
required:
- database
properties:
database:
title: Database connection properties
type: object
required:
- namespace
- service
- name
- username
- password
properties:
namespace:
title: Database namespace
type: string
description: Namespace wheree the database is deployed
default: {{ parasol_db_namespace }}
service:
title: Database Service name
type: string
description: Name of the database service
default: {{ parasol_db_service }}
name:
title: Database schema name
type: string
description: Name of the database schema
default: {{ parasol_db_name }}
username:
title: Database user name
type: string
description: Name of the database user
default: {{ parasol_db_user }}
password:
title: Database user password
type: string
description: Name of the database user
default: {{ parasol_db_password }}
steps:
- id: template-gitops-deployment
name: Generating Deployment Resources
action: fetch:template
input:
url: ./manifests
copyWithoutTemplating: []
values:
component_id: parasol-store
branch: {{ '${{ parameters.branch }}' }}
source_repository: https://{{ gitlab_host }}/{{ parasol_store_group }}/{{ parasol_store_manifests_repo }}.git
source_repository_gitops: https://{{ gitlab_host }}/{{ '${{ user.entity.metadata.name }}' }}/parasol-store-{{ '${{ parameters.branch }}' }}-gitops.git
source_repository_app: https://{{ gitlab_host }}/{{ parasol_store_group }}/{{ parasol_store_repo }}.git
gitlab_host: {{ gitlab_host }}
gitlab_group: {{ parasol_store_group }}
gitlab_project: {{ parasol_store_repo }}
owner: {{ '${{ user.entity.metadata.name }}' }}
image_host: 'image-registry.openshift-image-registry.svc:5000'
image_organization: parasol-store-{{ '${{ parameters.branch }}' }}
image_name: 'parasol-store'
image_tag: 'latest'
database_namespace: {{ '${{ parameters.database.namespace }}' }}
database_service: {{ '${{ parameters.database.service }}' }}
database_name: {{ '${{ parameters.database.name }}' }}
database_user: {{ '${{ parameters.database.username }}' }}
database_password: {{ '${{ parameters.database.password }}' }}
namespace: parasol-store-{{ '${{ parameters.branch }}' }}
gitops_namespace: {{ rhdh_gitops_namespace }}
gitops_project: {{ rhdh_gitops_project }}
cluster_subdomain: {{ cluster_subdomain }}
targetPath: {{ './parasol-store-${{parameters.branch}}-gitops' }}
- id: publish
name: Publishing to Resource Repository
action: publish:gitlab
input:
repoUrl: "{{ gitlab_host }}?owner={{ '${{ user.entity.metadata.name }}' }}&repo=parasol-store-{{ '${{ parameters.branch }}' }}-gitops"
repoVisibility: public
defaultBranch: main
title: gitops resources for parasol-store-{{ '${{ parameters.branch }}' }}
description: gitops resources for parasol-store-{{ '${{ parameters.branch }}' }}
sourcePath: {{ './parasol-store-${{ parameters.branch }}-gitops' }}
- id: create-argocd-resources
name: Create ArgoCD Resources
action: argocd:create-resources
input:
appName: parasol-store-{{ '${{ parameters.branch }}' }}-bootstrap
argoInstance: main
namespace: {{ rhdh_gitops_namespace }}
repoUrl: https://{{ gitlab_host }}/{{ '${{ user.entity.metadata.name }}' }}/parasol-store-{{ '${{ parameters.branch }}' }}-gitops.git
path: 'argocd/'
- id: register
name: Register
action: catalog:register
input:
repoContentsUrl: {{ '${{ steps.publish.output.repoContentsUrl }}' }}
catalogInfoPath: "/catalog-info.yaml"
output:
links:
- title: Open Component in catalog
icon: catalog
entityRef: {{ '${{ steps.register.output.entityRef }}' }}