Skip to content

Commit

Permalink
Merge branch 'master' of github.com:spotify/backstage into shmidt-i/s…
Browse files Browse the repository at this point in the history
…caffolder-flow-frontend
  • Loading branch information
shmidt-i committed Jul 6, 2020
2 parents 3125712 + 219a053 commit 8f1e0f6
Show file tree
Hide file tree
Showing 151 changed files with 3,123 additions and 671 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/cli-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,4 @@ jobs:
- run: yarn tsc
- run: yarn build
- name: verify app and plugin creation
working-directory: ${{ runner.temp }}
run: node ${{ github.workspace }}/packages/cli/e2e-test/cli-e2e-test.js
env:
BACKSTAGE_E2E_CLI_TEST: true
- name: lint newly created app and plugin
run: yarn lint:all
working-directory: ${{ runner.temp }}/test-app
env:
BACKSTAGE_E2E_CLI_TEST: true
- name: test newly created app and plugin
run: yarn test:all
working-directory: ${{ runner.temp }}/test-app
env:
BACKSTAGE_E2E_CLI_TEST: true
- name: e2e test newly created app
run: yarn test:e2e:ci
working-directory: ${{ runner.temp }}/test-app/packages/app
env:
APP_CONFIG_app_baseUrl: '"http://localhost:3001"'
BACKSTAGE_E2E_CLI_TEST: true
19 changes: 0 additions & 19 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,6 @@ jobs:
- run: yarn tsc
- run: yarn build
- name: verify app and plugin creation
working-directory: ${{ runner.temp }}
run: |
sudo sysctl fs.inotify.max_user_watches=524288
node ${{ github.workspace }}/packages/cli/e2e-test/cli-e2e-test.js
env:
BACKSTAGE_E2E_CLI_TEST: true
- name: lint newly created app and plugin
run: yarn lint:all
working-directory: ${{ runner.temp }}/test-app
env:
BACKSTAGE_E2E_CLI_TEST: true
- name: test newly created app and plugin
run: yarn test:all
working-directory: ${{ runner.temp }}/test-app
env:
BACKSTAGE_E2E_CLI_TEST: true
- name: e2e test newly created app
run: yarn test:e2e:ci
working-directory: ${{ runner.temp }}/test-app/packages/app
env:
APP_CONFIG_app_baseUrl: '"http://localhost:3001"'
BACKSTAGE_E2E_CLI_TEST: true
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@
For more information go to [backstage.io](https://backstage.io) or join our [Discord chatroom](https://discord.gg/EBHEGzX).

### Features
* Create and manage all of your organization’s software and microservices in one place
* Services catalog keeps track of all software and its ownership
* Visualizations provide information about your backend services and tooling, and help you monitor them
* A unified method for managing microservices offers both visibility and control
* Preset templates allow engineers to quickly create microservices in a standardized way ([coming soon](https://github.com/spotify/backstage/milestone/11))
* Centralized, full-featured technical documentation with integrated tooling that makes it easy for developers to set up, publish, and maintain alongside their code ([coming soon](https://github.com/spotify/backstage/milestone/15))

- Create and manage all of your organization’s software and microservices in one place
- Services catalog keeps track of all software and its ownership
- Visualizations provide information about your backend services and tooling, and help you monitor them
- A unified method for managing microservices offers both visibility and control
- Preset templates allow engineers to quickly create microservices in a standardized way ([coming soon](https://github.com/spotify/backstage/milestone/11))
- Centralized, full-featured technical documentation with integrated tooling that makes it easy for developers to set up, publish, and maintain alongside their code ([coming soon](https://github.com/spotify/backstage/milestone/15))

### Benefits
* For engineering managers, it allows you to maintain standards and best practices across the organization, and can help you manage your whole tech ecosystem, from migrations to test certification.
* For end users (developers), it makes it fast and simple to build software components in a standardized way, and it provides a central place to manage all projects and documentation.
* For platform engineers, it enables extensibility and scalability by letting you easily integrate new tools and services (via plugins), as well as extending the functionality of existing ones.
* For everyone, it’s a single, consistent experience that ties all your infrastructure tooling, resources, standards, owners, contributors, and administrators together in one place.

- For engineering managers, it allows you to maintain standards and best practices across the organization, and can help you manage your whole tech ecosystem, from migrations to test certification.
- For end users (developers), it makes it fast and simple to build software components in a standardized way, and it provides a central place to manage all projects and documentation.
- For platform engineers, it enables extensibility and scalability by letting you easily integrate new tools and services (via plugins), as well as extending the functionality of existing ones.
- For everyone, it’s a single, consistent experience that ties all your infrastructure tooling, resources, standards, owners, contributors, and administrators together in one place.

## Backstage Service Catalog (alpha)

Expand Down Expand Up @@ -54,7 +56,7 @@ Our vision for Backstage is for it to become the trusted standard toolbox (read:

The Backstage platform consists of a number of different components:

- **app** - Main web application that users interact with. It's built up by a number of different _Plugins_. This repo contains an example implementation of an app (located in `packages/example-app`) and you can easily get started with your own app by [creating one](docs/create-an-app.md).
- **app** - Main web application that users interact with. It's built up by a number of different _Plugins_. This repo contains an example implementation of an app (located in `packages/app`) and you can easily get started with your own app by [creating one](docs/create-an-app.md).
- [**plugins**](https://github.com/spotify/backstage/tree/master/plugins) - Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins all use a common set of platform API's and reusable UI components. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_.
- [**service catalog**](https://github.com/spotify/backstage/tree/master/packages/backend) - Service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph.
- **proxy** \* - Terminates HTTPS and exposes any RESTful API to Plugins.
Expand Down
47 changes: 47 additions & 0 deletions docs/architecture-decisions/adr006-avoid-react-fc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ADR006: Avoid React.FC and React.SFC

## Context

Facebook has removed `React.FC` from their base template for a Typescript
project. The reason for this was that it was found to be an unnecessary feature
with next to no benefits in combination with a few downsides.

The main reasons were:

- **children props** were implicitly added
- **Generic Type** were not supported on children

Read more about the removal in
[this PR](https://github.com/facebook/create-react-app/pull/8177).

## Decision

To keep our codebase up to date, we have decided that `React.FC` and `React.SFC`
should be avoided in our codebase when adding new code.

Here is an example:

```ts
/* Avoid this: */
type BadProps = { text: string };
const BadComponent: FC<BadProps> = ({ text, children }) => (
<div>
<div>{text}</div>
{children}
</div>
);

/* Do this instead: */
type GoodProps = { text: string; children?: React.ReactNode };
const GoodComponent = ({ text, children }: GoodProps) => (
<div>
<div>{text}</div>
{children}
</div>
);
```

## Consequences

We will gradually remove the current usage of `React.FC` and `React.SFC` from
our codebase.
27 changes: 27 additions & 0 deletions install/kubernetes/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backstage
labels:
app: backstage
component: frontend
spec:
replicas: 1
selector:
matchLabels:
app: backstage
component: frontend
template:
metadata:
labels:
app: backstage
component: frontend
spec:
containers:
- name: app
image: spotify/backstage:latest
imagePullPolicy: Always
ports:
- containerPort: 80
name: app
protocol: TCP
27 changes: 27 additions & 0 deletions install/kubernetes/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backstage-backend
labels:
app: backstage
component: backend
spec:
replicas: 1
selector:
matchLabels:
app: backstage
component: backend
template:
metadata:
labels:
app: backstage
component: backend
spec:
containers:
- name: backend
image: spotify/backstage-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 7000
name: backend
protocol: TCP
22 changes: 22 additions & 0 deletions install/kubernetes/backstage/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
5 changes: 5 additions & 0 deletions install/kubernetes/backstage/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Spotify Backstage
name: backstage
version: 0.1.1-alpha.12
51 changes: 51 additions & 0 deletions install/kubernetes/backstage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Backstage Helm Chart

## App/Frontend Values

| Parameter | Description | Default |
| --------------------------- | --------------------------------------------------------- | ------------------- |
| app.enabled | Whether to render the frontend app config or not | `true` |
| app.nameOverride | Override the name given to the app/frontend | `""` |
| app.fullnameOverride | Override the full name of the app/frontend | `""` |
| app.replicaCount | The number of replicas for the app/frontend | `1` |
| app.image.repository | The image repository of the app/frontend container | `spotify/backstage` |
| app.image.tag | The app/frontend tag to pull | `latest` |
| app.image.pullPolicy | Image pull policy | `Always` |
| app.service.type | The service type for the app/frontend service | `ClusterIP` |
| app.service.port | The port for the app/frontend | `80` |
| app.ingress.enabled | Whether to create ingress or not | `false` |
| app.ingress.annotations | Annotations for the app/frontend ingress | `{}` |
| app.ingress.hosts[].host | Hostname for the app/frontend | `backstage.local` |
| app.ingress.hosts[].paths[] | Path name to serve the app/frontend on | `["/"]` |
| app.imagePullSecrets[] | Any image secrets you need to pull `app.image.repository` | `[]` |
| app.podSecurityContext | Security context for the app/frontend pods | `{}` |
| app.securityContext | Security context settings for the deployment | `{}` |
| app.resources | Kubernetes Pod resource requests/limits | `{}` |
| app.nodeSelector | Node selectors for scheduling app/frontend pods | `{}` |
| app.tolerations | Tolerations for scheduling app/frontend pods | `{}` |
| app.affinity | Affinity setttings for scheduling app/frontend pods | `{}` |

## Backend Values

| Parameter | Description | Default |
| ------------------------------- | ------------------------------------------------------------- | ------------------- |
| backend.enabled | Whether to render the backend config or not | `true` |
| backend.nameOverride | Override the name given to the backend | `""` |
| backend.fullnameOverride | Override the full name of the backend | `""` |
| backend.replicaCount | The number of replicas for the backend | `1` |
| backend.image.repository | The image repository of the backend container | `spotify/backstage` |
| backend.image.tag | The backend tag to pull | `latest` |
| backend.image.pullPolicy | Image pull policy | `Always` |
| backend.service.type | The service type for the backend service | `ClusterIP` |
| backend.service.port | The port for the backend | `80` |
| backend.ingress.enabled | Whether to create ingress or not | `false` |
| backend.ingress.annotations | Annotations for the backend ingress | `{}` |
| backend.ingress.hosts[].host | Hostname for the backend | `backstage.local` |
| backend.ingress.hosts[].paths[] | Path name to serve the backend on | `["/"]` |
| backend.imagePullSecrets[] | Any image secrets you need to pull `backend.image.repository` | `[]` |
| backend.podSecurityContext | Security context for the backend pods | `{}` |
| backend.securityContext | Security context settings for the deployment | `{}` |
| backend.resources | Kubernetes Pod resource requests/limits | `{}` |
| backend.nodeSelector | Node selectors for scheduling backend pods | `{}` |
| backend.tolerations | Tolerations for scheduling backend pods | `{}` |
| backend.affinity | Affinity setttings for scheduling backend pods | `{}` |
80 changes: 80 additions & 0 deletions install/kubernetes/backstage/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "backstage.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "backstage.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "backstage.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common App labels
*/}}
{{- define "backstage.app.labels" -}}
app.kubernetes.io/name: {{ include "backstage.name" . }}-app
helm.sh/chart: {{ include "backstage.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Common Backend labels
*/}}
{{- define "backstage.backend.labels" -}}
app.kubernetes.io/name: {{ include "backstage.name" . }}-backend
helm.sh/chart: {{ include "backstage.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Create the name of the service account to use for the app
*/}}
{{- define "backstage.app.serviceAccountName" -}}
{{- if .Values.app.serviceAccount.create -}}
{{ default "default" .Values.app.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.app.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use for the backend
*/}}
{{- define "backstage.backend.serviceAccountName" -}}
{{- if .Values.backend.serviceAccount.create -}}
{{ default default .Values.backend.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.backend.serviceAccount.name }}
{{- end -}}
{{- end -}}
Loading

0 comments on commit 8f1e0f6

Please sign in to comment.