This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
/
template.yaml
220 lines (214 loc) · 7.18 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: spring-boot-backend-template
title: Create a Spring Boot Backend application with a CI pipeline
description: Create a starter Spring Boot backend application with a CI pipeline
tags:
- recommended
- spring-boot
- java
- maven
spec:
owner: janus-authors
system: janus-idp
type: service
parameters:
- title: Provide information about the new component
required:
- orgName
- repoName
- owner
- system
- port
properties:
orgName:
title: Organization Name
type: string
repoName:
title: Repository Name
type: string
description:
title: Description
type: string
description: Help others understand what this component is for
owner:
title: Owner
type: string
ui:field: EntityPicker
ui:options:
catalogFilter:
kind:
- Group
- User
system:
title: System
type: string
ui:field: EntityPicker
ui:options:
catalogFilter:
kind:
- System
port:
title: Port
type: number
default: 8080
description: Override the port exposed for the application
- title: Provide information about the Java metadata
required:
- groupId
- artifactId
- javaPackageName
properties:
groupId:
title: Group ID
type: string
default: io.janus
description: Maven Group ID eg (io.janus)
artifactId:
title: Artifact ID
type: string
default: spring-boot-app
description: Maven Artifact ID
javaPackageName:
title: Java Package Namespace
type: string
default: io/janus/spring-boot-app
description: Name for the Java Package (ensure to use the / character as this is used for folder structure) should match Group ID and Artifact ID
- title: Provide information about the CI method
required:
- ci
properties:
ci:
title: Select a CI method
type: string
description: This action will create a CI pipeline for your application based on chosen method
default: ../../../skeletons/github-actions/
enum:
- ../../../skeletons/github-actions/
- ../../../skeletons/tekton/
enumNames:
- GitHub Action
- Tekton
dependencies:
ci:
oneOf:
- properties:
# Show no extra properties when GitHub Actions is selected
ci:
const: ../../../skeletons/github-actions/
- required:
- imageRepository
- namespace
- imageUrl
properties:
ci:
const: ../../../skeletons/tekton/
imageRepository:
title: Select a registry
type: string
default: quay.io
enum:
- quay.io
- image-registry.openshift-image-registry.svc:5000
enumNames:
- Quay
- Internal OpenShift Registry
imageUrl:
title: Image URL
type: string
description: The Quay.io or OpenShift Image URL <REGISTRY>/<IMAGE_URL>/<REPO_NAME>
namespace:
title: Namespace
type: string
description: The namespace for deploying resources
steps:
- id: sourceCodeTemplate
name: Generating the Source Code Component
action: fetch:template
input:
url: ./skeleton
values:
orgName: ${{ parameters.orgName }}
repoName: ${{ parameters.repoName }}
owner: ${{ parameters.owner }}
system: ${{ parameters.system }}
applicationType: api
description: ${{ parameters.description }}
namespace: ${{ parameters.namespace }}
imageUrl: ${{ parameters.imageUrl }}
imageBuilder: s2i-java
imageRepository: ${{ parameters.imageRepository }}
port: ${{ parameters.port }}
ci: ${{ parameters.ci }}
groupId: ${{ parameters.groupId }}
artifactId: ${{ parameters.artifactId }}
javaPackageName: ${{ parameters.javaPackageName }}
sourceControl: github.com
- id: ciTemplate
name: Generating the CI Component
action: fetch:template
input:
url: ${{ parameters.ci }}
copyWithoutTemplating:
- .github/workflows/
values:
orgName: ${{ parameters.orgName }}
repoName: ${{ parameters.repoName }}
owner: ${{ parameters.owner }}
system: ${{ parameters.system }}
applicationType: api
description: ${{ parameters.description }}
namespace: ${{ parameters.namespace }}
imageUrl: ${{ parameters.imageUrl }}
imageBuilder: s2i-java
imageRepository: ${{ parameters.imageRepository }}
port: ${{ parameters.port }}
ci: ${{ parameters.ci }}
groupId: ${{ parameters.groupId }}
artifactId: ${{ parameters.artifactId }}
javaPackageName: ${{ parameters.javaPackageName }}
sourceControl: github.com
- id: catalogTemplate
name: Generating the Catalog Info Component
action: fetch:template
input:
url: ../../../skeletons/catalog-info/
values:
orgName: ${{ parameters.orgName }}
repoName: ${{ parameters.repoName }}
owner: ${{ parameters.owner }}
system: ${{ parameters.system }}
applicationType: api
description: ${{ parameters.description }}
namespace: ${{ parameters.namespace }}
imageUrl: ${{ parameters.imageUrl }}
imageBuilder: s2i-java
imageRepository: ${{ parameters.imageRepository }}
port: ${{ parameters.port }}
ci: ${{ parameters.ci }}
groupId: ${{ parameters.groupId }}
artifactId: ${{ parameters.artifactId }}
javaPackageName: ${{ parameters.javaPackageName }}
sourceControl: github.com
- id: publish
name: Publishing to the Source Code Repository
action: publish:github
input:
allowedHosts: ['github.com']
description: ${{ parameters.description }}
repoUrl: github.com?owner=${{ parameters.orgName }}&repo=${{ parameters.repoName }}
defaultBranch: main
- id: register
name: Registering the Catalog Info Component
action: catalog:register
input:
repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
catalogInfoPath: /catalog-info.yaml
output:
links:
- title: Open the Source Code Repository
url: ${{ steps.publish.output.remoteUrl }}
- title: Open the Catalog Info Component
icon: catalog
entityRef: ${{ steps.register.output.entityRef }}