-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscaffolder-test.yaml
106 lines (100 loc) · 3.12 KB
/
scaffolder-test.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
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: create-react-app-template-with-timestamp-entityRef
title: Create React App Template
description: Create a new CRA website project
tags:
- react
- cra
spec:
owner: example-group
type: website
parameters:
- title: Provide some simple information
required:
- component_id
- owner
properties:
component_id:
title: Name
type: string
description: Unique name of the component
ui:field: EntityNamePicker
description:
title: Description
type: string
description: Help others understand what this website is for.
owner:
title: Owner
type: string
description: Owner of the component
ui:field: OwnerPicker
ui:options:
allowedKinds:
- Group
- title: Choose a location
required:
- repoUrl
properties:
repoUrl:
title: Repository Location
type: string
ui:field: RepoUrlPicker
ui:options:
allowedHosts:
- github.com
steps:
- id: template
name: Fetch Skeleton + Template
action: fetch:template
input:
url: https://github.com/backstage/software-templates/tree/main/scaffolder-templates/create-react-app/skeleton
copyWithoutRender:
- .github/workflows/*
values:
component_id: ${{ parameters.component_id }}
description: ${{ parameters.description }}
destination: ${{ parameters.repoUrl | parseRepoUrl }}
owner: ${{ parameters.owner }}
# this step is an example of using the `catalog:timestamping` action
- id: timestamp
name: Add Timestamp to catalog-info.yaml
action: catalog:timestamping
# this step is an example of using the `catalog:annotate` action
- id: add-fields-to-catalog-info
name: Add a few fields into `catalog-info.yaml` using the generic action
action: catalog:annotate
input:
labels:
custom: ${{ parameters.label }}
other: "test-label"
annotations:
custom.io/annotation: ${{ parameters.label }}
custom.io/other: "value"
# this step is an example of using the `catalog:scaffolded-from` action
- id: append-templateRef
name: Append the entityRef of this template to the entityRef
action: catalog:scaffolded-from
- id: publish
name: Publish
action: publish:github
input:
allowedHosts:
- github.com
description: This is ${{ parameters.component_id }}
repoUrl: ${{ parameters.repoUrl }}
repoVisibility: public
- id: register
name: Register
action: catalog:register
input:
repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
catalogInfoPath: '/catalog-info.yaml'
output:
links:
- title: Repository
url: ${{ steps.publish.output.remoteUrl }}
- title: Open in catalog
icon: catalog
entityRef: ${{ steps.register.output.entityRef }}