Skip to content

Commit

Permalink
feat: start of upgrade to backstage
Browse files Browse the repository at this point in the history
  • Loading branch information
josmo committed Jan 18, 2024
1 parent c736e34 commit 73d2fce
Show file tree
Hide file tree
Showing 31 changed files with 11,430 additions and 9,299 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playwright.config.ts
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ site

# vscode database functionality support files
*.session.sql

# E2E test reports
e2e-test-report/
2 changes: 2 additions & 0 deletions app-config.development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
app:
title: Pelostage development
41 changes: 36 additions & 5 deletions app-config.production.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
app:
title: ${ORG_NAME}
baseUrl: ${BASE_URL}
backend:
baseUrl: ${BASE_URL}
#app:
# title: ${ORG_NAME}
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
# baseUrl: ${BASE_URL}

#backend:
# Note that the baseUrl should be the URL that the browser and other clients
# should use when communicating with the backend, i.e. it needs to be
# reachable not just from within the backend host, but from all of your
# callers. When its value is "http://localhost:7007", it's strictly private
# and can't be reached by others.
# baseUrl: ${BASE_URL}
# The listener can also be expressed as a single <host>:<port> string. In this case we bind to
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
# listen: ':7007'

# config options: https://node-postgres.com/api/client
# database:
# client: pg
# connection:
# host: ${POSTGRES_HOST}
# port: ${POSTGRES_PORT}
# user: ${POSTGRES_USER}
# password: ${POSTGRES_PASSWORD}
# https://node-postgres.com/features/ssl
# you can set the sslmode configuration option via the `PGSSLMODE` environment variable
# see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
# ssl:
# ca: # if you have a CA file and want to verify it you can uncomment this section
# $file: <file-path>/ca/server.crt

#catalog:
# Overrides the default list locations from app-config.yaml as these contain example data.
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
# on how to get entities into the catalog.
# locations: []
48 changes: 31 additions & 17 deletions app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
app:
title: sample-app
baseUrl: https://backstage.host
title: ${ORG_NAME}
baseUrl: ${BASE_URL}

organization:
name: ${ORG_NAME}

backend:
# Used for enabling authentication, secret is shared by all backend plugins
# See https://backstage.io/docs/tutorials/backend-to-backend-auth for
# See https://backstage.io/docs/auth/service-to-service-auth for
# information on the format
# auth:
# keys:
# - secret: ${BACKEND_SECRET}
baseUrl: https://backstage.host
baseUrl: ${BASE_URL}
listen:
port: 7007
# Uncomment the following host directive to bind to all IPv4 interfaces and
# not just the baseUrl hostname.
host: 0.0.0.0
# Uncomment the following host directive to bind to specific interfaces
# host: 127.0.0.1
csp:
connect-src: ["'self'", 'http:', 'https:']
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
Expand Down Expand Up @@ -47,9 +46,12 @@ integrations:
# token: ${GHE_TOKEN}

proxy:
'/test':
target: 'https://example.com'
changeOrigin: true
### Example for how to add a proxy endpoint for the frontend.
### A typical reason to do this is to handle HTTPS and CORS for internal services.
# endpoints:
# '/test':
# target: 'https://example.com'
# changeOrigin: true

# Reference documentation http://backstage.io/docs/features/techdocs/configuration
# Note: After experimenting with basic setup, use CI/CD to generate docs
Expand Down Expand Up @@ -83,27 +85,39 @@ catalog:
- allow: [Component, System, API, Resource, Location]
providers:
github:
providerId:
default:
organization: ${GITHUB_ORG} # string
catalogPath: '/catalog-info.yaml' # string
filters:
branch: 'main' # string
repository: '.*' # Regex
schedule: # optional; same options as in TaskScheduleDefinition
# supports cron, ISO duration, "human duration" as used in code
frequency: { minutes: 30 }
# supports ISO duration, "human duration" as used in code
timeout: { minutes: 3 }
locations: []
# # Local example data, file locations are relative to the backend process, typically `packages/backend`
# - type: file
# target: ../../examples/entities.yaml
#
# # Local example template
# - type: file
# target: ../../examples/template/template.yaml
# rules:
# - allow: [Template]
#
# # Local example organizational data
# - type: file
# target: ../../examples/org.yaml
# rules:
# - allow: [User, Group]

kubernetes:
serviceLocatorMethod:
type: 'multiTenant'
clusterLocatorMethods:
- type: 'config'
clusters:
- url: ${CLUSTER_URL}
name: backstage
name: core-prod
authProvider: 'serviceAccount'
skipTLSVerify: true
skipMetricsLookup: false
serviceAccountToken: ${K8S_TOKEN}
customResources:
Expand Down
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.14.0-next.1"
"version": "1.22.0"
}
6 changes: 3 additions & 3 deletions examples/template/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ spec:
name: Register
action: catalog:register
input:
repoContentsUrl: ${{ steps.publish.output.repoContentsUrl }}
repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }}
catalogInfoPath: '/catalog-info.yaml'

# Outputs are displayed to the user after a successful execution of the template.
output:
links:
- title: Repository
url: ${{ steps.publish.output.remoteUrl }}
url: ${{ steps['publish'].output.remoteUrl }}
- title: Open in catalog
icon: catalog
entityRef: ${{ steps.register.output.entityRef }}
entityRef: ${{ steps['register'].output.entityRef }}
2 changes: 1 addition & 1 deletion gitops/overlays/prod/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: backstage
data:
NODE_ENV: "production"
CLUSTER_URL: "https://89844889B776A990C4980C5C8770F96D.gr7.us-west-2.eks.amazonaws.com"
CLUSTER_URL: "http://kubernetes.default.svc"
ORG_NAME: "Pelotech"
BASE_URL: "https://pelostage.pelo.tech"
GITHUB_ORG: "pelotech"
4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*", "plugins/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.1.0"
"version": "0.1.0",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
"version": "1.0.0",
"private": true,
"engines": {
"node": "14 || 16"
"node": "18 || 20"
},
"scripts": {
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
"start": "yarn workspace app start",
"start-backend": "yarn workspace backend start",
"build": "backstage-cli repo build --all",
"build:backend": "yarn workspace backend build",
"build:all": "backstage-cli repo build --all",
"build-image": "yarn workspace backend build-image",
"tsc": "tsc",
"tsc:full": "tsc --skipLibCheck false --incremental false",
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"test:e2e": "playwright test",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"create-plugin": "backstage-cli create-plugin --scope internal",
"new": "backstage-cli new --scope internal"
},
"workspaces": {
Expand All @@ -29,17 +31,19 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.22.7-next.0",
"@backstage/cli": "^0.25.1",
"@backstage/e2e-test-utils": "^0.1.0",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "^12.0.0",
"concurrently": "^6.0.0",
"lerna": "^4.0.0",
"concurrently": "^8.0.0",
"lerna": "^7.3.0",
"node-gyp": "^9.0.0",
"prettier": "^2.3.2",
"typescript": "~4.6.4",
"node-gyp": "^9.0.0"
"typescript": "~5.2.0"
},
"resolutions": {
"@types/react": "^17",
"@types/react-dom": "^17"
"@types/react": "^18",
"@types/react-dom": "^18"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
Expand Down
1 change: 1 addition & 0 deletions packages/app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public
6 changes: 0 additions & 6 deletions packages/app/cypress.json

This file was deleted.

21 changes: 0 additions & 21 deletions packages/app/cypress/.eslintrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions packages/app/cypress/integration/app.js

This file was deleted.

23 changes: 23 additions & 0 deletions packages/app/e2e-tests/app.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { test, expect } from '@playwright/test';

test('App should render the welcome page', async ({ page }) => {
await page.goto('/');

await expect(page.getByText('My Company Catalog')).toBeVisible();
});
Loading

0 comments on commit 73d2fce

Please sign in to comment.