Skip to content

Commit 82664b7

Browse files
authored
Merge pull request #1 from datum-cloud/feat/initial-backstage-scaffold
feat: scaffold Backstage application
2 parents a91ce93 + ece00e0 commit 82664b7

78 files changed

Lines changed: 34554 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git
2+
.yarn/cache
3+
.yarn/install-state.gz
4+
node_modules
5+
packages/*/node_modules
6+
plugins/*/node_modules
7+
*.local.yaml

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
playwright.config.ts

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
root: true,
3+
};

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
ignore:
8+
- dependency-name: "@backstage/*"
9+
groups:
10+
minor-and-patch:
11+
update-types:
12+
- minor
13+
- patch
14+
15+
- package-ecosystem: github-actions
16+
directory: /
17+
schedule:
18+
interval: weekly

.github/workflows/e2e.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: E2E
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
kind-e2e:
14+
runs-on: ubuntu-latest
15+
env:
16+
CLUSTER_NAME: backstage-e2e
17+
IMAGE: backstage:e2e
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
24+
25+
- name: Build backend image
26+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
27+
with:
28+
context: .
29+
file: packages/backend/Dockerfile
30+
load: true
31+
tags: ${{ env.IMAGE }}
32+
cache-from: type=gha,scope=backstage-e2e
33+
cache-to: type=gha,mode=max,scope=backstage-e2e
34+
35+
- name: Create kind cluster
36+
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1
37+
with:
38+
cluster_name: ${{ env.CLUSTER_NAME }}
39+
40+
- name: Load image into kind
41+
run: kind load docker-image "${IMAGE}" --name "${CLUSTER_NAME}"
42+
43+
- name: Install CloudNativePG operator
44+
run: |
45+
helm repo add cnpg https://cloudnative-pg.github.io/charts
46+
helm upgrade --install cnpg cnpg/cloudnative-pg \
47+
--namespace cnpg-system --create-namespace \
48+
--version '0.28.x' --wait --timeout 5m
49+
50+
- name: Deploy e2e overlay
51+
run: kubectl kustomize config/overlays/e2e | kubectl apply --server-side -f -
52+
53+
- name: Wait for PostgreSQL
54+
run: kubectl -n backstage wait --for=condition=Ready cluster/backstage-postgres --timeout=5m
55+
56+
- name: Wait for Backstage
57+
run: kubectl -n backstage rollout status deploy/backstage --timeout=10m
58+
59+
- name: Smoke test backend
60+
run: |
61+
kubectl -n backstage run curl-smoke \
62+
--image=curlimages/curl:8.10.1 \
63+
--restart=Never --rm -i --quiet -- \
64+
sh -ceu '
65+
echo "readiness:"
66+
code=$(curl -sS -o /dev/null -w "%{http_code}" http://backstage:7007/.backstage/health/v1/readiness)
67+
echo "$code"
68+
[ "$code" = "200" ]
69+
70+
echo "liveness:"
71+
code=$(curl -sS -o /dev/null -w "%{http_code}" http://backstage:7007/.backstage/health/v1/liveness)
72+
echo "$code"
73+
[ "$code" = "200" ]
74+
75+
echo "catalog entities:"
76+
code=$(curl -sS -o /dev/null -w "%{http_code}" http://backstage:7007/api/catalog/entities)
77+
echo "$code"
78+
[ "$code" = "200" ]
79+
'
80+
81+
- name: Dump diagnostics
82+
if: failure()
83+
run: |
84+
kubectl -n backstage get pods,svc,cluster
85+
kubectl -n backstage describe cluster/backstage-postgres || true
86+
kubectl -n backstage describe deploy/backstage
87+
kubectl -n backstage logs deploy/backstage --all-containers --tail=200 || true

.github/workflows/publish.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['v*']
7+
release:
8+
types: ['published']
9+
10+
jobs:
11+
publish-container-image:
12+
permissions:
13+
id-token: write
14+
contents: read
15+
packages: write
16+
attestations: write
17+
uses: datum-cloud/actions/.github/workflows/publish-docker.yaml@v1.16.0
18+
with:
19+
image-name: backstage
20+
context: .
21+
dockerfile-path: packages/backend/Dockerfile
22+
platforms: linux/amd64
23+
secrets: inherit
24+
25+
publish-kustomize-bundle:
26+
needs: publish-container-image
27+
permissions:
28+
id-token: write
29+
contents: read
30+
packages: write
31+
uses: datum-cloud/actions/.github/workflows/publish-kustomize-bundle.yaml@v1.16.0
32+
with:
33+
bundle-name: ghcr.io/datum-cloud/backstage-kustomize
34+
bundle-path: config
35+
image-name: ghcr.io/datum-cloud/backstage
36+
image-overlays: config/base
37+
secrets: inherit

.github/workflows/snyk-scan.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Snyk Security Scan
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
schedule:
8+
- cron: '0 6 * * 1'
9+
10+
permissions:
11+
contents: read
12+
security-events: write
13+
actions: read
14+
15+
jobs:
16+
snyk:
17+
permissions:
18+
contents: read
19+
security-events: write
20+
actions: read
21+
uses: datum-cloud/actions/.github/workflows/snyk-scan.yaml@v1.16.0
22+
with:
23+
severity-threshold: high
24+
upload-sarif: true
25+
secrets: inherit
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Backstage Version Bump
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * 1'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
bump:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
21+
with:
22+
node-version: 22
23+
24+
- name: Enable Corepack
25+
run: corepack enable
26+
27+
- name: Install dependencies
28+
run: yarn install --immutable
29+
30+
- name: Bump Backstage packages
31+
run: yarn backstage-cli versions:bump
32+
33+
- name: Open pull request
34+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
35+
with:
36+
token: ${{ secrets.BACKSTAGE_BUMP_TOKEN || github.token }}
37+
branch: chore/backstage-version-bump
38+
delete-branch: true
39+
base: main
40+
title: 'chore: bump Backstage to latest release'
41+
commit-message: 'chore: bump Backstage packages'
42+
labels: dependencies
43+
body: |
44+
Automated `yarn backstage-cli versions:bump` — moves every
45+
`@backstage/*` package to the latest coordinated release and
46+
updates `backstage.json`.
47+
48+
Review the diff and let the `E2E` workflow validate the kind
49+
deployment before merging.

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Coverage directory generated when running tests with coverage
12+
coverage
13+
14+
# Dependencies
15+
node_modules/
16+
17+
# Yarn files
18+
.pnp.*
19+
.yarn/*
20+
!.yarn/patches
21+
!.yarn/plugins
22+
!.yarn/releases
23+
!.yarn/sdks
24+
!.yarn/versions
25+
26+
# Node version directives
27+
.nvmrc
28+
29+
# dotenv environment variables file
30+
.env
31+
.env.test
32+
33+
# Build output
34+
dist
35+
dist-types
36+
37+
# Temporary change files created by Vim
38+
*.swp
39+
40+
# MkDocs build output
41+
site
42+
43+
# Local configuration files
44+
*.local.yaml
45+
46+
# Sensitive credentials
47+
*-credentials.yaml
48+
49+
# vscode database functionality support files
50+
*.session.sql
51+
52+
# E2E test reports
53+
e2e-test-report/
54+
55+
# Cache
56+
.cache/

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
dist-types
3+
coverage
4+
.vscode

0 commit comments

Comments
 (0)