-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
101 lines (94 loc) · 2.71 KB
/
template.yaml
File metadata and controls
101 lines (94 loc) · 2.71 KB
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
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: simple-go-api-template
title: Go Hello World API
description: Creates a new Go REST API service (Gin framework, port 8080) using the hello-world-api.go skeleton, publishes to GitHub, and registers in the catalog.
tags:
- go
- api
- service
spec:
owner: user:guest
type: service
parameters:
- title: Component Information
required:
- name
- description
- owner
properties:
name:
title: Name
type: string
description: Unique name for the new service component
ui:autofocus: true
ui:field: EntityNamePicker
description:
title: Description
type: string
description: A short description of the service
owner:
title: Owner
type: string
description: Owner of the component (e.g. user:guest or group:my-team)
ui:field: OwnerPicker
ui:options:
catalogFilter:
kind:
- Group
- User
- title: Repository Location
required:
- repoUrl
properties:
repoUrl:
title: Repository Location
type: string
ui:field: RepoUrlPicker
ui:options:
allowedHosts:
- github.com
allowedOwners:
- solthoth
steps:
- id: fetch-template-files
name: Overlay Templated Files
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.name }}
description: ${{ parameters.description }}
owner: ${{ parameters.owner }}
destination: ${{ parameters.repoUrl | parseRepoUrl }}
- id: publish
name: Publish to GitHub
action: publish:github
input:
description: ${{ parameters.description }}
repoUrl: ${{ parameters.repoUrl }}
defaultBranch: main
- id: register
name: Register in Catalog
action: catalog:register
input:
repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }}
catalogInfoPath: '/catalog-info.yaml'
- id: notify
name: Notify
action: notification:send
input:
recipients: entity
entityRefs:
- user:default/guest
title: New Go API service created
info: 'Your service "${{ parameters.name }}" has been created and registered in the catalog.'
severity: normal
output:
links:
- title: Repository
url: ${{ steps['publish'].output.remoteUrl }}
- title: Open in catalog
icon: catalog
entityRef: ${{ steps['register'].output.entityRef }}