-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
115 lines (105 loc) · 2.98 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
apiVersion: backstage.io/v1beta2
kind: Template
metadata:
name: sample-openapi
title: Sample OpenAPI
description: Create a Sample OpenAPI
tags:
- demo
- openapi
- node
spec:
owner: mauro.sala@kiratech.it
type: service
# these are the steps which are rendered in the frontend with the form input
parameters:
- title: Demp App values
required:
- component_id
- description
- owner
properties:
component_id:
title: Name
type: string
description: Unique name of the component
description:
title: Description
type: string
description: Help others understand what this service does.
owner:
title: Owner
type: string
description: Owner of the component
ui:field: OwnerPicker
ui:options:
allowedKinds:
- User
- title: Choose Url
required:
- apiUrl
properties:
apiUrl:
title: Api Url
type: string
description: Api url without https://
- title: Choose a location
required:
- repoUrl
properties:
repoUrl:
title: Repository Location
type: string
ui:field: RepoUrlPicker
ui:options:
allowedHosts:
- github.com
# here's the steps that are executed in series in the scaffolder backend
steps:
- id: template
name: Fetch Skeleton + Template
action: fetch:template
input:
url: ./skeleton
copyWithoutRender:
- .github/workflows/*
values:
component_id: "{{ parameters.component_id }}"
description: "{{ parameters.description }}"
apiUrl: "{{ parameters.apiUrl }}"
owner: "{{ parameters.owner }}"
destination: "{{ parseRepoUrl parameters.repoUrl }}"
- id: publish
name: Publish
action: publish:github
input:
allowedHosts: ["github.com"]
description: "This is a Demo App with name {{ parameters.component_id }}"
repoUrl: "{{ parameters.repoUrl }}"
repoVisibility: public
defaultBranch: main
- id: register
name: Register
action: catalog:register
input:
repoContentsUrl: "{{ steps.publish.output.repoContentsUrl }}"
catalogInfoPath: "/catalog-info.yaml"
- id: argocd
name: Create application on ArgoCD
action: kerberus:argocd
input:
host: ${{parameters.repoUrl}}
pathRepoSubfolder: "true"
# - id: sonarcloud
# name: Create application on SonarCloud
# action: kerberus:sonarcloud
# input:
# host: ${{parameters.repoUrl}}
- id: githubprotection
name: Set GitHub branch protection
action: kerberus:githubprotection
input:
host: ${{parameters.repoUrl}}
output:
remoteUrl: "{{ steps.publish.output.remoteUrl }}"
entityRef: "{{ steps.register.output.entityRef }}"