Skip to content

Commit 21ceaae

Browse files
committed
refactor(backstage): simplify dev bootstrap and use remote catalog templates
- Always rebuild the Backstage Docker image to ensure consistency during local development - Remove references to local example files in app-configs - Use remote GitHub URL for centralized catalog templates - Add NODE_OPTIONS to ConfigMap to prevent node snapshot issues
1 parent cdcb476 commit 21ceaae

File tree

4 files changed

+28
-42
lines changed

4 files changed

+28
-42
lines changed

.bootstrap/backstage/manifests/config-map.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ metadata:
44
name: backstage-config
55
namespace: backstage-system
66
data:
7+
NODE_OPTIONS: --no-node-snapshot
78
POSTGRES_HOST: postgres.backstage-system.svc.cluster.local
89
POSTGRES_PORT: "5432"

.bootstrap/backstage/up.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,13 @@ else
2828
echo "✅ Namespace $NS already exists."
2929
fi
3030

31-
# Build Docker image only if it doesn't already exist
32-
if ! docker image inspect "$IMAGE" >/dev/null 2>&1; then
33-
echo "Building Backstage image $IMAGE..."
34-
cd "./backstage"
35-
yarn build:all
36-
yarn build-image --tag "$IMAGE" --no-cache
37-
kind load docker-image "$IMAGE" --name "$CLUSTER_NAME"
38-
cd ..
39-
else
40-
echo "✅ Docker image $IMAGE already exists. Skipping build."
41-
fi
31+
echo "Building Backstage image $IMAGE..."
32+
cd ./backstage
33+
docker rmi -f $IMAGE
34+
yarn build:all
35+
yarn build-image --tag "$IMAGE" --no-cache
36+
kind load docker-image "$IMAGE" --name "$CLUSTER_NAME"
37+
cd ..
4238

4339
# Apply manifests to the cluster (idempotent)
4440
echo "Applying manifests from $MANIFESTS_DIR..."

backstage/app-config.production.yaml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,8 @@ catalog:
4242
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
4343
# on how to get entities into the catalog.
4444
locations:
45-
# Local example data, replace this with your production config, these are intended for demo use only.
46-
# File locations are relative to the backend process, typically in a deployed context, such as in a Docker container, this will be the root
47-
- type: file
48-
target: ./examples/entities.yaml
49-
50-
# Local example template
51-
- type: file
52-
target: ./examples/template/template.yaml
45+
# All Templates
46+
- type: url
47+
target: https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/catalog/all-templates.yaml
5348
rules:
5449
- allow: [Template]
55-
56-
# Local example organizational data
57-
- type: file
58-
target: ./examples/org.yaml
59-
rules:
60-
- allow: [User, Group]

backstage/app-config.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,27 @@ catalog:
7878
rules:
7979
- allow: [Component, System, API, Resource, Location]
8080
locations:
81-
# Local example data, file locations are relative to the backend process, typically `packages/backend`
82-
- type: file
83-
target: ../../examples/entities.yaml
84-
85-
# Local example template
86-
- type: file
87-
target: ../../examples/template/template.yaml
81+
# All Templates
82+
- type: url
83+
target: https://github.com/wnqueiroz/platform-engineering-backstack/blob/main/backstage/catalog/all-templates.yaml
8884
rules:
8985
- allow: [Template]
9086

91-
# Local example template
92-
- type: file
93-
target: ../../catalog/templates/xqueue-claim/template.yaml
94-
rules:
95-
- allow: [Template]
87+
# Local example data, file locations are relative to the backend process, typically `packages/backend`
88+
# - type: file
89+
# target: ../../examples/entities.yaml
9690

97-
# Local example organizational data
98-
- type: file
99-
target: ../../examples/org.yaml
100-
rules:
101-
- allow: [User, Group]
91+
# # Local example template
92+
# - type: file
93+
# target: ../../examples/template/template.yaml
94+
# rules:
95+
# - allow: [Template]
96+
97+
# # Local example organizational data
98+
# - type: file
99+
# target: ../../examples/org.yaml
100+
# rules:
101+
# - allow: [User, Group]
102102

103103
## Uncomment these lines to add more example data
104104
# - type: url

0 commit comments

Comments
 (0)