forked from backstage/backstage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:spotify/backstage into shmidt-i/s…
…caffolder-flow-frontend
- Loading branch information
Showing
151 changed files
with
3,123 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | `{}` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -}} |
Oops, something went wrong.