forked from IronCore864/backstage-test-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
91 lines (87 loc) · 2.59 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
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: backstage-test-template
title: Node App with GitHub Actions
description: Create a Node service with GitHub Actions workflows
tags:
- recommended
spec:
owner: [email protected]
type: service
parameters:
- title: Provide some simple information
required:
- service_name
- owner
properties:
service_name:
title: Name
type: string
description: Unique name of the service.
ui:field: EntityNamePicker
description:
title: Description
type: string
description: Help others understand what this service is for; optional.
owner:
title: Owner
type: string
description: Owner of the component
ui:field: OwnerPicker
ui:options:
allowedKinds:
- Group
- title: Choose a location
required:
- repoUrl
- gitguardianApiKey
properties:
repoUrl:
title: Repository Location
type: string
ui:field: RepoUrlPicker
ui:options:
allowedHosts:
- github.com
gitguardianApiKey:
title: GITGUARDIAN_API_KEY
type: string
description: API Key from GitGuardian, used for CI to scan secrets https://dashboard.gitguardian.com/api/personal-access-tokens.
steps:
- id: template
name: Fetch Skeleton + Template
action: fetch:template
input:
url: ./skeleton
copyWithoutTemplating:
- .github/workflows/*
values:
serviceName: ${{ parameters.service_name }}
description: ${{ parameters.description }}
destination: ${{ parameters.repoUrl | parseRepoUrl }}
owner: ${{ parameters.owner }}
- id: publish
name: Publish
action: publish:github
input:
allowedHosts: ["github.com"]
description: This is ${{ parameters.service_name }}
repoUrl: ${{ parameters.repoUrl }}
defaultBranch: main
repoVisibility: public
secrets:
"GITGUARDIAN_API_KEY": ${{ parameters.gitguardianApiKey }}
- 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 }}