Skip to content

Commit dc0e562

Browse files
committed
feat: Baseline on Backstage 1.25.0
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
1 parent 61cc788 commit dc0e562

File tree

27 files changed

+258
-515
lines changed

27 files changed

+258
-515
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ node_modules/
2424
!.yarn/sdks
2525
!.yarn/versions
2626

27+
# Node version directives
28+
.nvmrc
29+
2730
# dotenv environment variables file
2831
.env
2932
.env.test

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

backstage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "1.23.4"
2+
"version": "1.25.0"
33
}

examples/entities.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system
3+
apiVersion: backstage.io/v1alpha1
4+
kind: System
5+
metadata:
6+
name: examples
7+
spec:
8+
owner: guests
9+
---
10+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component
11+
apiVersion: backstage.io/v1alpha1
12+
kind: Component
13+
metadata:
14+
name: example-website
15+
spec:
16+
type: website
17+
lifecycle: experimental
18+
owner: guests
19+
system: examples
20+
providesApis: [example-grpc-api]
21+
---
22+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api
23+
apiVersion: backstage.io/v1alpha1
24+
kind: API
25+
metadata:
26+
name: example-grpc-api
27+
spec:
28+
type: grpc
29+
lifecycle: experimental
30+
owner: guests
31+
system: examples
32+
definition: |
33+
syntax = "proto3";
34+
35+
service Exampler {
36+
rpc Example (ExampleMessage) returns (ExampleMessage) {};
37+
}
38+
39+
message ExampleMessage {
40+
string example = 1;
41+
};

examples/org.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-user
3+
apiVersion: backstage.io/v1alpha1
4+
kind: User
5+
metadata:
6+
name: guest
7+
spec:
8+
memberOf: [guests]
9+
---
10+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-group
11+
apiVersion: backstage.io/v1alpha1
12+
kind: Group
13+
metadata:
14+
name: guests
15+
spec:
16+
type: team
17+
children: []
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: backstage.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: ${{ values.name | dump }}
5+
spec:
6+
type: service
7+
owner: user:guest
8+
lifecycle: experimental

examples/template/content/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Hello from ${{ values.name }}!');
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "${{ values.name }}",
3+
"private": true,
4+
"dependencies": {}
5+
}

examples/template/template.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: scaffolder.backstage.io/v1beta3
2+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-template
3+
kind: Template
4+
metadata:
5+
name: example-nodejs-template
6+
title: Example Node.js Template
7+
description: An example template for the scaffolder that creates a simple Node.js service
8+
spec:
9+
owner: user:guest
10+
type: service
11+
12+
# These parameters are used to generate the input form in the frontend, and are
13+
# used to gather input data for the execution of the template.
14+
parameters:
15+
- title: Fill in some steps
16+
required:
17+
- name
18+
properties:
19+
name:
20+
title: Name
21+
type: string
22+
description: Unique name of the component
23+
ui:autofocus: true
24+
ui:options:
25+
rows: 5
26+
- title: Choose a location
27+
required:
28+
- repoUrl
29+
properties:
30+
repoUrl:
31+
title: Repository Location
32+
type: string
33+
ui:field: RepoUrlPicker
34+
ui:options:
35+
allowedHosts:
36+
- github.com
37+
38+
# These steps are executed in the scaffolder backend, using data that we gathered
39+
# via the parameters above.
40+
steps:
41+
# Each step executes an action, in this case one templates files into the working directory.
42+
- id: fetch-base
43+
name: Fetch Base
44+
action: fetch:template
45+
input:
46+
url: ./content
47+
values:
48+
name: ${{ parameters.name }}
49+
50+
# This step publishes the contents of the working directory to GitHub.
51+
- id: publish
52+
name: Publish
53+
action: publish:github
54+
input:
55+
allowedHosts: ['github.com']
56+
description: This is ${{ parameters.name }}
57+
repoUrl: ${{ parameters.repoUrl }}
58+
59+
# The final step is to register our new component in the catalog.
60+
- id: register
61+
name: Register
62+
action: catalog:register
63+
input:
64+
repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }}
65+
catalogInfoPath: '/catalog-info.yaml'
66+
67+
# Outputs are displayed to the user after a successful execution of the template.
68+
output:
69+
links:
70+
- title: Repository
71+
url: ${{ steps['publish'].output.remoteUrl }}
72+
- title: Open in catalog
73+
icon: catalog
74+
entityRef: ${{ steps['register'].output.entityRef }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
]
3333
},
3434
"devDependencies": {
35-
"@backstage/cli": "^0.25.2",
35+
"@backstage/cli": "^0.26.2",
3636
"@backstage/e2e-test-utils": "^0.1.1",
3737
"@playwright/test": "^1.32.3",
3838
"@spotify/prettier-config": "^12.0.0",

0 commit comments

Comments
 (0)