From 06439b304a52eb1b047a6dba6b86a6708114a941 Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Wed, 25 Jan 2023 15:21:55 -0600 Subject: [PATCH 1/3] added ci workflow Signed-off-by: Paul Schultz --- .github/PULL_REQUEST_TEMPLATE.md | 13 + .github/workflows/ci.yml | 60 + .prettierignore | 1 + .prettierrc | 6 + charts/backstage/Chart.yaml | 4 +- charts/backstage/README.md | 112 +- charts/backstage/templates/service.yaml | 16 +- charts/backstage/values.schema.json | 1753 ++++++++++------------- charts/backstage/values.yaml | 28 +- package.json | 1 + 10 files changed, 949 insertions(+), 1045 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yml create mode 100644 .prettierrc diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..f545f04a95 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +## What does this PR do / why we need it + +## Which issue(s) does this PR fix + +Fixes #? + +## PR acceptance criteria + +- [ ] Unit Tests +- [ ] E2E Tests +- [ ] Documentation + +## How to test changes / Special notes to the reviewer diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..22f57366fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +# Copyright 2023 Janus 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. + +name: CI +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +jobs: + ci: + name: Main Job + runs-on: ubuntu-latest + + env: + NX_SKIP_NX_CACHE: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install + run: | + yarn install --frozen-lockfile + + - name: Lint + run: | + yarn lint:all + yarn tsc:full + yarn prettier:check + + - name: Test + run: | + yarn test:all + + - name: Build + run: | + yarn build:all + + - name: Docker + run: | + yarn nx affected --target=docker-build --parallel=3 diff --git a/.prettierignore b/.prettierignore index dfb0f1cd11..5318b0f47e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ dist dist-types coverage .vscode +*.yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..345f449ea8 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "arrowParens": "always", + "printWidth": 100, + "singleQuote": true, + "trailingComma": "all" +} diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index b3364d1a75..67dbfbe94e 100644 --- a/charts/backstage/Chart.yaml +++ b/charts/backstage/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: backstage description: A helm chart for deploying Backstage version: 0.1.6 -appVersion: "v1.7.0" -kubeVersion: ">= 1.19.0-0" +appVersion: 'v1.7.0' +kubeVersion: '>= 1.19.0-0' home: https://github.com/janus-idp/helm-backstage annotations: charts.openshift.io/name: backstage diff --git a/charts/backstage/README.md b/charts/backstage/README.md index 80bc2fce38..d971549488 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -30,59 +30,59 @@ Replace `` with the name of the Helm release that was used when install ## Values -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| additionalConfig | object | `{}` | | -| backstage.baseUrl | string | `""` | | -| backstage.catalog.locations[0].target | string | `"https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml"` | | -| backstage.catalog.locations[0].type | string | `"url"` | | -| backstage.catalog.rules[0].allow[0] | string | `"Component"` | | -| backstage.catalog.rules[0].allow[1] | string | `"System"` | | -| backstage.catalog.rules[0].allow[2] | string | `"API"` | | -| backstage.catalog.rules[0].allow[3] | string | `"Resource"` | | -| backstage.catalog.rules[0].allow[4] | string | `"Location"` | | -| backstage.companyname | string | `"Red Hat Backstage Helm Chart"` | | -| fullnameOverride | string | `""` | | -| image.pullPolicy | string | `"Always"` | | -| image.registry | string | `"ghcr.io"` | | -| image.repository | string | `"janus-idp/redhat-backstage-build"` | | -| image.version | string | `"latest"` | | -| imagePullSecrets | list | `[]` | | -| ingress.className | string | `""` | | -| ingress.enabled | bool | `false` | | -| ingress.tls.secretName | string | `""` | | -| name | string | `"backstage"` | | -| nameOverride | string | `""` | | -| postgres.database_host | string | `""` | | -| postgres.database_name | string | `"postgres"` | | -| postgres.database_password | string | `""` | | -| postgres.database_port | int | `5432` | | -| postgres.database_user | string | `"postgres"` | | -| postgres.existingSecret | string | `""` | | -| postgres.external | bool | `false` | | -| postgres.image.pullPolicy | string | `"Always"` | | -| postgres.image.registry | string | `"quay.io"` | | -| postgres.image.repository | string | `"fedora/postgresql-13"` | | -| postgres.image.version | string | `"13"` | | -| postgres.resources.limits.cpu | string | `"400m"` | | -| postgres.resources.limits.memory | string | `"596Mi"` | | -| postgres.resources.requests.cpu | string | `"100m"` | | -| postgres.resources.requests.memory | string | `"128Mi"` | | -| postgres.secretKeys.adminPasswordKey | string | `""` | | -| postgres.serviceAccount.annotations | object | `{}` | | -| postgres.serviceAccount.create | bool | `true` | | -| postgres.serviceAccount.name | string | `""` | | -| postgres.storage.enabled | bool | `true` | | -| postgres.storage.size | string | `"2Gi"` | | -| replicaCount | int | `1` | | -| resources | object | `{}` | | -| route.annotations | object | `{}` | | -| route.enabled | bool | `true` | | -| route.termination | string | `"edge"` | | -| securityContext | object | `{}` | | -| service.port | int | `8080` | | -| service.targetPort | int | `7007` | | -| service.type | string | `"ClusterIP"` | | -| serviceAccount.annotations | object | `{}` | | -| serviceAccount.create | bool | `true` | | -| serviceAccount.name | string | `""` | | +| Key | Type | Default | Description | +| ------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------- | ----------- | +| additionalConfig | object | `{}` | | +| backstage.baseUrl | string | `""` | | +| backstage.catalog.locations[0].target | string | `"https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml"` | | +| backstage.catalog.locations[0].type | string | `"url"` | | +| backstage.catalog.rules[0].allow[0] | string | `"Component"` | | +| backstage.catalog.rules[0].allow[1] | string | `"System"` | | +| backstage.catalog.rules[0].allow[2] | string | `"API"` | | +| backstage.catalog.rules[0].allow[3] | string | `"Resource"` | | +| backstage.catalog.rules[0].allow[4] | string | `"Location"` | | +| backstage.companyname | string | `"Red Hat Backstage Helm Chart"` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.registry | string | `"ghcr.io"` | | +| image.repository | string | `"janus-idp/redhat-backstage-build"` | | +| image.version | string | `"latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.tls.secretName | string | `""` | | +| name | string | `"backstage"` | | +| nameOverride | string | `""` | | +| postgres.database_host | string | `""` | | +| postgres.database_name | string | `"postgres"` | | +| postgres.database_password | string | `""` | | +| postgres.database_port | int | `5432` | | +| postgres.database_user | string | `"postgres"` | | +| postgres.existingSecret | string | `""` | | +| postgres.external | bool | `false` | | +| postgres.image.pullPolicy | string | `"Always"` | | +| postgres.image.registry | string | `"quay.io"` | | +| postgres.image.repository | string | `"fedora/postgresql-13"` | | +| postgres.image.version | string | `"13"` | | +| postgres.resources.limits.cpu | string | `"400m"` | | +| postgres.resources.limits.memory | string | `"596Mi"` | | +| postgres.resources.requests.cpu | string | `"100m"` | | +| postgres.resources.requests.memory | string | `"128Mi"` | | +| postgres.secretKeys.adminPasswordKey | string | `""` | | +| postgres.serviceAccount.annotations | object | `{}` | | +| postgres.serviceAccount.create | bool | `true` | | +| postgres.serviceAccount.name | string | `""` | | +| postgres.storage.enabled | bool | `true` | | +| postgres.storage.size | string | `"2Gi"` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| route.annotations | object | `{}` | | +| route.enabled | bool | `true` | | +| route.termination | string | `"edge"` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.targetPort | int | `7007` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | diff --git a/charts/backstage/templates/service.yaml b/charts/backstage/templates/service.yaml index ae382f9e02..06a6a545e4 100644 --- a/charts/backstage/templates/service.yaml +++ b/charts/backstage/templates/service.yaml @@ -1,16 +1,14 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "backstage.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "backstage.labels" . | nindent 4 }} + name: { { include "backstage.fullname" . } } + namespace: { { .Release.Namespace } } + labels: { { - include "backstage.labels" . | nindent 4 } } spec: - type: {{ .Values.service.type }} + type: { { .Values.service.type } } ports: - - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.targetPort }} + - port: { { .Values.service.port } } + targetPort: { { .Values.service.targetPort } } protocol: TCP name: http - selector: - {{- include "backstage.selectorLabels" . | nindent 4 }} + selector: { { - include "backstage.selectorLabels" . | nindent 4 } } diff --git a/charts/backstage/values.schema.json b/charts/backstage/values.schema.json index ca421a821a..e95fd642a2 100644 --- a/charts/backstage/values.schema.json +++ b/charts/backstage/values.schema.json @@ -1,1008 +1,833 @@ { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "http://example.com/example.json", - "type": "object", - "default": {}, - "title": "Root Schema", - "required": [ - "replicaCount", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "http://example.com/example.json", + "type": "object", + "default": {}, + "title": "Root Schema", + "required": [ + "replicaCount", + "image", + "imagePullSecrets", + "nameOverride", + "fullnameOverride", + "service", + "route", + "ingress", + "name", + "postgres", + "resources", + "serviceAccount", + "securityContext", + "backstage" + ], + "properties": { + "replicaCount": { + "type": "integer", + "default": 0, + "title": "The replicaCount Schema", + "examples": [1] + }, + "image": { + "type": "object", + "default": {}, + "title": "The image Schema", + "required": ["pullPolicy", "registry", "repository", "version"], + "properties": { + "pullPolicy": { + "type": "string", + "default": "", + "title": "The pullPolicy Schema", + "examples": ["Always"] + }, + "registry": { + "type": "string", + "default": "", + "title": "The registry Schema", + "examples": ["ghcr.io"] + }, + "repository": { + "type": "string", + "default": "", + "title": "The repository Schema", + "examples": ["janus-idp/redhat-backstage-build"] + }, + "version": { + "type": "string", + "default": "", + "title": "The version Schema", + "examples": ["latest"] + } + }, + "examples": [ + { + "pullPolicy": "Always", + "registry": "ghcr.io", + "repository": "janus-idp/redhat-backstage-build", + "version": "latest" + } + ] + }, + "imagePullSecrets": { + "type": "array", + "default": [], + "title": "The imagePullSecrets Schema", + "items": {}, + "examples": [[]] + }, + "nameOverride": { + "type": "string", + "default": "", + "title": "The nameOverride Schema", + "examples": [""] + }, + "fullnameOverride": { + "type": "string", + "default": "", + "title": "The fullnameOverride Schema", + "examples": [""] + }, + "service": { + "type": "object", + "default": {}, + "title": "The service Schema", + "required": ["type", "port", "targetPort"], + "properties": { + "type": { + "type": "string", + "default": "", + "title": "The type Schema", + "examples": ["ClusterIP"] + }, + "port": { + "type": "integer", + "default": 0, + "title": "The port Schema", + "examples": [8080] + }, + "targetPort": { + "type": "integer", + "default": 0, + "title": "The targetPort Schema", + "examples": [7007] + } + }, + "examples": [ + { + "type": "ClusterIP", + "port": 8080, + "targetPort": 7007 + } + ] + }, + "route": { + "type": "object", + "default": {}, + "title": "The route Schema", + "required": ["enabled", "termination", "annotations"], + "properties": { + "enabled": { + "type": "boolean", + "default": false, + "title": "The enabled Schema", + "examples": [true] + }, + "termination": { + "type": "string", + "default": "", + "title": "The termination Schema", + "examples": ["edge"] + }, + "annotations": { + "type": "object", + "default": {}, + "title": "The annotations Schema", + "required": [], + "properties": {}, + "examples": [{}] + } + }, + "examples": [ + { + "enabled": true, + "termination": "edge", + "annotations": {} + } + ] + }, + "ingress": { + "type": "object", + "default": {}, + "title": "The ingress Schema", + "required": ["enabled", "className", "annotations", "tls"], + "properties": { + "enabled": { + "type": "boolean", + "default": false, + "title": "The enabled Schema", + "examples": [false] + }, + "className": { + "type": "string", + "default": "", + "title": "The className Schema", + "examples": [""] + }, + "annotations": { + "type": "object", + "default": {}, + "title": "The annotations Schema", + "required": [], + "properties": {}, + "examples": [{}] + }, + "tls": { + "type": "object", + "default": {}, + "title": "The tls Schema", + "required": ["secretName"], + "properties": { + "secretName": { + "type": "string", + "default": "", + "title": "The secretName Schema", + "examples": [""] + } + }, + "examples": [ + { + "secretName": "" + } + ] + } + }, + "examples": [ + { + "enabled": false, + "className": "", + "annotations": {}, + "tls": { + "secretName": "" + } + } + ] + }, + "name": { + "type": "string", + "default": "", + "title": "The name Schema", + "examples": ["backstage"] + }, + "postgres": { + "type": "object", + "default": {}, + "title": "The postgres Schema", + "required": [ + "external", + "storage", + "database_user", + "database_name", + "database_host", + "database_password", + "database_port", + "existingSecret", + "secretKeys", "image", - "imagePullSecrets", - "nameOverride", - "fullnameOverride", - "service", - "route", - "ingress", - "name", - "postgres", "resources", - "serviceAccount", - "securityContext", - "backstage" - ], - "properties": { - "replicaCount": { - "type": "integer", - "default": 0, - "title": "The replicaCount Schema", - "examples": [ - 1 - ] + "serviceAccount" + ], + "properties": { + "external": { + "type": "boolean", + "default": false, + "title": "The external Schema", + "examples": [false] }, - "image": { - "type": "object", - "default": {}, - "title": "The image Schema", - "required": [ - "pullPolicy", - "registry", - "repository", - "version" - ], - "properties": { - "pullPolicy": { - "type": "string", - "default": "", - "title": "The pullPolicy Schema", - "examples": [ - "Always" - ] - }, - "registry": { - "type": "string", - "default": "", - "title": "The registry Schema", - "examples": [ - "ghcr.io" - ] - }, - "repository": { - "type": "string", - "default": "", - "title": "The repository Schema", - "examples": [ - "janus-idp/redhat-backstage-build" - ] - }, - "version": { - "type": "string", - "default": "", - "title": "The version Schema", - "examples": [ - "latest" - ] - } + "storage": { + "type": "object", + "default": {}, + "title": "The storage Schema", + "required": ["enabled", "size"], + "properties": { + "enabled": { + "type": "boolean", + "default": false, + "title": "The enabled Schema", + "examples": [true] }, - "examples": [ - { - "pullPolicy": "Always", - "registry": "ghcr.io", - "repository": "janus-idp/redhat-backstage-build", - "version": "latest" - } - ] + "size": { + "type": "string", + "default": "", + "title": "The size Schema", + "examples": ["2Gi"] + } + }, + "examples": [ + { + "enabled": true, + "size": "2Gi" + } + ] }, - "imagePullSecrets": { - "type": "array", - "default": [], - "title": "The imagePullSecrets Schema", - "items": {}, - "examples": [ - [] - ] + "database_user": { + "type": "string", + "default": "", + "title": "The database_user Schema", + "examples": ["postgres"] }, - "nameOverride": { - "type": "string", - "default": "", - "title": "The nameOverride Schema", - "examples": [ - "" - ] + "database_name": { + "type": "string", + "default": "", + "title": "The database_name Schema", + "examples": ["postgres"] }, - "fullnameOverride": { - "type": "string", - "default": "", - "title": "The fullnameOverride Schema", - "examples": [ - "" - ] + "database_host": { + "type": "string", + "default": "", + "title": "The database_host Schema", + "examples": [""] }, - "service": { - "type": "object", - "default": {}, - "title": "The service Schema", - "required": [ - "type", - "port", - "targetPort" - ], - "properties": { - "type": { - "type": "string", - "default": "", - "title": "The type Schema", - "examples": [ - "ClusterIP" - ] - }, - "port": { - "type": "integer", - "default": 0, - "title": "The port Schema", - "examples": [ - 8080 - ] - }, - "targetPort": { - "type": "integer", - "default": 0, - "title": "The targetPort Schema", - "examples": [ - 7007 - ] - } + "database_password": { + "type": "string", + "default": "", + "title": "The database_password Schema", + "examples": [""] + }, + "database_port": { + "type": "integer", + "default": 0, + "title": "The database_port Schema", + "examples": [5432] + }, + "existingSecret": { + "type": "string", + "default": "", + "title": "The existingSecret Schema", + "examples": [""] + }, + "secretKeys": { + "type": "object", + "default": {}, + "title": "The secretKeys Schema", + "required": ["adminPasswordKey"], + "properties": { + "adminPasswordKey": { + "type": "string", + "default": "", + "title": "The adminPasswordKey Schema", + "examples": [""] + } + }, + "examples": [ + { + "adminPasswordKey": "" + } + ] + }, + "image": { + "type": "object", + "default": {}, + "title": "The image Schema", + "required": ["pullPolicy", "registry", "repository", "version"], + "properties": { + "pullPolicy": { + "type": "string", + "default": "", + "title": "The pullPolicy Schema", + "examples": ["Always"] }, - "examples": [ - { - "type": "ClusterIP", - "port": 8080, - "targetPort": 7007 - } - ] + "registry": { + "type": "string", + "default": "", + "title": "The registry Schema", + "examples": ["quay.io"] + }, + "repository": { + "type": "string", + "default": "", + "title": "The repository Schema", + "examples": ["fedora/postgresql-13"] + }, + "version": { + "type": "string", + "default": "", + "title": "The version Schema", + "examples": ["13"] + } + }, + "examples": [ + { + "pullPolicy": "Always", + "registry": "quay.io", + "repository": "fedora/postgresql-13", + "version": "13" + } + ] }, - "route": { - "type": "object", - "default": {}, - "title": "The route Schema", - "required": [ - "enabled", - "termination", - "annotations" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - true - ] - }, - "termination": { - "type": "string", - "default": "", - "title": "The termination Schema", - "examples": [ - "edge" - ] + "resources": { + "type": "object", + "default": {}, + "title": "The resources Schema", + "required": ["limits", "requests"], + "properties": { + "limits": { + "type": "object", + "default": {}, + "title": "The limits Schema", + "required": ["cpu", "memory"], + "properties": { + "cpu": { + "type": "string", + "default": "", + "title": "The cpu Schema", + "examples": ["400m"] }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] + "memory": { + "type": "string", + "default": "", + "title": "The memory Schema", + "examples": ["596Mi"] } - }, - "examples": [ + }, + "examples": [ { - "enabled": true, - "termination": "edge", - "annotations": {} + "cpu": "400m", + "memory": "596Mi" } - ] - }, - "ingress": { - "type": "object", - "default": {}, - "title": "The ingress Schema", - "required": [ - "enabled", - "className", - "annotations", - "tls" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] - }, - "className": { - "type": "string", - "default": "", - "title": "The className Schema", - "examples": [ - "" - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] + ] + }, + "requests": { + "type": "object", + "default": {}, + "title": "The requests Schema", + "required": ["cpu", "memory"], + "properties": { + "cpu": { + "type": "string", + "default": "", + "title": "The cpu Schema", + "examples": ["100m"] }, - "tls": { - "type": "object", - "default": {}, - "title": "The tls Schema", - "required": [ - "secretName" - ], - "properties": { - "secretName": { - "type": "string", - "default": "", - "title": "The secretName Schema", - "examples": [ - "" - ] - } - }, - "examples": [ - { - "secretName": "" - } - ] + "memory": { + "type": "string", + "default": "", + "title": "The memory Schema", + "examples": ["128Mi"] } - }, - "examples": [ + }, + "examples": [ { - "enabled": false, - "className": "", - "annotations": {}, - "tls": { - "secretName": "" - } + "cpu": "100m", + "memory": "128Mi" } - ] + ] + } + }, + "examples": [ + { + "limits": { + "cpu": "400m", + "memory": "596Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + } + ] + }, + "serviceAccount": { + "type": "object", + "default": {}, + "title": "The serviceAccount Schema", + "required": ["create", "annotations", "name"], + "properties": { + "create": { + "type": "boolean", + "default": false, + "title": "The create Schema", + "examples": [true] + }, + "annotations": { + "type": "object", + "default": {}, + "title": "The annotations Schema", + "required": [], + "properties": {}, + "examples": [{}] + }, + "name": { + "type": "string", + "default": "", + "title": "The name Schema", + "examples": [""] + } + }, + "examples": [ + { + "create": true, + "annotations": {}, + "name": "" + } + ] + } + }, + "examples": [ + { + "external": false, + "storage": { + "enabled": true, + "size": "2Gi" + }, + "database_user": "postgres", + "database_name": "postgres", + "database_host": "", + "database_password": "", + "database_port": 5432, + "existingSecret": "", + "secretKeys": { + "adminPasswordKey": "" + }, + "image": { + "pullPolicy": "Always", + "registry": "quay.io", + "repository": "fedora/postgresql-13", + "version": "13" + }, + "resources": { + "limits": { + "cpu": "400m", + "memory": "596Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "serviceAccount": { + "create": true, + "annotations": {}, + "name": "" + } + } + ] + }, + "resources": { + "type": "object", + "default": {}, + "title": "The resources Schema", + "required": [], + "properties": {}, + "examples": [{}] + }, + "serviceAccount": { + "type": "object", + "default": {}, + "title": "The serviceAccount Schema", + "required": ["create", "annotations", "name"], + "properties": { + "create": { + "type": "boolean", + "default": false, + "title": "The create Schema", + "examples": [true] + }, + "annotations": { + "type": "object", + "default": {}, + "title": "The annotations Schema", + "required": [], + "properties": {}, + "examples": [{}] }, "name": { - "type": "string", - "default": "", - "title": "The name Schema", - "examples": [ - "backstage" - ] + "type": "string", + "default": "", + "title": "The name Schema", + "examples": [""] + } + }, + "examples": [ + { + "create": true, + "annotations": {}, + "name": "" + } + ] + }, + "securityContext": { + "type": "object", + "default": {}, + "title": "The securityContext Schema", + "required": [], + "properties": {}, + "examples": [{}] + }, + "backstage": { + "type": "object", + "default": {}, + "title": "The backstage Schema", + "required": ["companyname", "baseUrl", "catalog"], + "properties": { + "companyname": { + "type": "string", + "default": "", + "title": "The companyname Schema", + "examples": ["Red Hat Backstage Helm Chart"] }, - "postgres": { - "type": "object", - "default": {}, - "title": "The postgres Schema", - "required": [ - "external", - "storage", - "database_user", - "database_name", - "database_host", - "database_password", - "database_port", - "existingSecret", - "secretKeys", - "image", - "resources", - "serviceAccount" - ], - "properties": { - "external": { - "type": "boolean", - "default": false, - "title": "The external Schema", - "examples": [ - false - ] - }, - "storage": { - "type": "object", - "default": {}, - "title": "The storage Schema", - "required": [ - "enabled", - "size" - ], - "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - true - ] - }, - "size": { - "type": "string", - "default": "", - "title": "The size Schema", - "examples": [ - "2Gi" - ] - } + "baseUrl": { + "type": "string", + "default": "", + "title": "The baseUrl Schema", + "examples": [""] + }, + "catalog": { + "type": "object", + "default": {}, + "title": "The catalog Schema", + "required": ["rules", "locations"], + "properties": { + "rules": { + "type": "array", + "default": [], + "title": "The rules Schema", + "items": { + "type": "object", + "default": {}, + "title": "A Schema", + "required": ["allow"], + "properties": { + "allow": { + "type": "array", + "default": [], + "title": "The allow Schema", + "items": { + "type": "string", + "title": "A Schema", + "examples": [ + "Component", + "System", + "API", + "Resource", + "Location" + ] }, "examples": [ - { - "enabled": true, - "size": "2Gi" - } + ["Component", "System", "API", "Resource", "Location"] ] + } }, - "database_user": { - "type": "string", - "default": "", - "title": "The database_user Schema", - "examples": [ - "postgres" - ] - }, - "database_name": { - "type": "string", - "default": "", - "title": "The database_name Schema", - "examples": [ - "postgres" - ] - }, - "database_host": { - "type": "string", - "default": "", - "title": "The database_host Schema", - "examples": [ - "" - ] - }, - "database_password": { + "examples": [ + { + "allow": [ + "Component", + "System", + "API", + "Resource", + "Location" + ] + } + ] + }, + "examples": [ + [ + { + "allow": [ + "Component", + "System", + "API", + "Resource", + "Location" + ] + } + ] + ] + }, + "locations": { + "type": "array", + "default": [], + "title": "The locations Schema", + "items": { + "type": "object", + "default": {}, + "title": "A Schema", + "required": ["type", "target"], + "properties": { + "type": { "type": "string", "default": "", - "title": "The database_password Schema", - "examples": [ - "" - ] - }, - "database_port": { - "type": "integer", - "default": 0, - "title": "The database_port Schema", - "examples": [ - 5432 - ] - }, - "existingSecret": { + "title": "The type Schema", + "examples": ["url"] + }, + "target": { "type": "string", "default": "", - "title": "The existingSecret Schema", - "examples": [ - "" - ] - }, - "secretKeys": { - "type": "object", - "default": {}, - "title": "The secretKeys Schema", - "required": [ - "adminPasswordKey" - ], - "properties": { - "adminPasswordKey": { - "type": "string", - "default": "", - "title": "The adminPasswordKey Schema", - "examples": [ - "" - ] - } - }, - "examples": [ - { - "adminPasswordKey": "" - } - ] - }, - "image": { - "type": "object", - "default": {}, - "title": "The image Schema", - "required": [ - "pullPolicy", - "registry", - "repository", - "version" - ], - "properties": { - "pullPolicy": { - "type": "string", - "default": "", - "title": "The pullPolicy Schema", - "examples": [ - "Always" - ] - }, - "registry": { - "type": "string", - "default": "", - "title": "The registry Schema", - "examples": [ - "quay.io" - ] - }, - "repository": { - "type": "string", - "default": "", - "title": "The repository Schema", - "examples": [ - "fedora/postgresql-13" - ] - }, - "version": { - "type": "string", - "default": "", - "title": "The version Schema", - "examples": [ - "13" - ] - } - }, - "examples": [ - { - "pullPolicy": "Always", - "registry": "quay.io", - "repository": "fedora/postgresql-13", - "version": "13" - } - ] - }, - "resources": { - "type": "object", - "default": {}, - "title": "The resources Schema", - "required": [ - "limits", - "requests" - ], - "properties": { - "limits": { - "type": "object", - "default": {}, - "title": "The limits Schema", - "required": [ - "cpu", - "memory" - ], - "properties": { - "cpu": { - "type": "string", - "default": "", - "title": "The cpu Schema", - "examples": [ - "400m" - ] - }, - "memory": { - "type": "string", - "default": "", - "title": "The memory Schema", - "examples": [ - "596Mi" - ] - } - }, - "examples": [ - { - "cpu": "400m", - "memory": "596Mi" - } - ] - }, - "requests": { - "type": "object", - "default": {}, - "title": "The requests Schema", - "required": [ - "cpu", - "memory" - ], - "properties": { - "cpu": { - "type": "string", - "default": "", - "title": "The cpu Schema", - "examples": [ - "100m" - ] - }, - "memory": { - "type": "string", - "default": "", - "title": "The memory Schema", - "examples": [ - "128Mi" - ] - } - }, - "examples": [ - { - "cpu": "100m", - "memory": "128Mi" - } - ] - } - }, + "title": "The target Schema", "examples": [ - { - "limits": { - "cpu": "400m", - "memory": "596Mi" - }, - "requests": { - "cpu": "100m", - "memory": "128Mi" - } - } + "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" ] + } }, - "serviceAccount": { - "type": "object", - "default": {}, - "title": "The serviceAccount Schema", - "required": [ - "create", - "annotations", - "name" - ], - "properties": { - "create": { - "type": "boolean", - "default": false, - "title": "The create Schema", - "examples": [ - true - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] - }, - "name": { - "type": "string", - "default": "", - "title": "The name Schema", - "examples": [ - "" - ] - } - }, - "examples": [ - { - "create": true, - "annotations": {}, - "name": "" - } - ] - } - }, - "examples": [ + "examples": [ + { + "type": "url", + "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" + } + ] + }, + "examples": [ + [ + { + "type": "url", + "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" + } + ] + ] + } + }, + "examples": [ + { + "rules": [ { - "external": false, - "storage": { - "enabled": true, - "size": "2Gi" - }, - "database_user": "postgres", - "database_name": "postgres", - "database_host": "", - "database_password": "", - "database_port": 5432, - "existingSecret": "", - "secretKeys": { - "adminPasswordKey": "" - }, - "image": { - "pullPolicy": "Always", - "registry": "quay.io", - "repository": "fedora/postgresql-13", - "version": "13" - }, - "resources": { - "limits": { - "cpu": "400m", - "memory": "596Mi" - }, - "requests": { - "cpu": "100m", - "memory": "128Mi" - } - }, - "serviceAccount": { - "create": true, - "annotations": {}, - "name": "" - } - } - ] - }, - "resources": { - "type": "object", - "default": {}, - "title": "The resources Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] - }, - "serviceAccount": { - "type": "object", - "default": {}, - "title": "The serviceAccount Schema", - "required": [ - "create", - "annotations", - "name" - ], - "properties": { - "create": { - "type": "boolean", - "default": false, - "title": "The create Schema", - "examples": [ - true - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] - }, - "name": { - "type": "string", - "default": "", - "title": "The name Schema", - "examples": [ - "" - ] + "allow": [ + "Component", + "System", + "API", + "Resource", + "Location" + ] } - }, - "examples": [ + ], + "locations": [ { - "create": true, - "annotations": {}, - "name": "" + "type": "url", + "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" } + ] + } + ] + } + }, + "examples": [ + { + "companyname": "Red Hat Backstage Helm Chart", + "baseUrl": "", + "catalog": { + "rules": [ + { + "allow": ["Component", "System", "API", "Resource", "Location"] + } + ], + "locations": [ + { + "type": "url", + "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" + } ] + } + } + ] + }, + "additionalConfig": { + "type": "object", + "default": {}, + "title": "Additional Backstage configuration", + "properties": {}, + "examples": [{}] + } + }, + "examples": [ + { + "replicaCount": 1, + "image": { + "pullPolicy": "Always", + "registry": "ghcr.io", + "repository": "janus-idp/redhat-backstage-build", + "version": "latest" + }, + "imagePullSecrets": [], + "nameOverride": "", + "fullnameOverride": "", + "service": { + "type": "ClusterIP", + "port": 8080, + "targetPort": 7007 + }, + "route": { + "enabled": true, + "termination": "edge", + "annotations": {} + }, + "ingress": { + "enabled": false, + "className": "", + "annotations": {}, + "tls": { + "secretName": "" + } + }, + "name": "backstage", + "postgres": { + "external": false, + "storage": { + "enabled": true, + "size": "2Gi" }, - "securityContext": { - "type": "object", - "default": {}, - "title": "The securityContext Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] + "database_user": "postgres", + "database_name": "postgres", + "database_host": "", + "database_password": "", + "database_port": 5432, + "existingSecret": "", + "secretKeys": { + "adminPasswordKey": "" }, - "backstage": { - "type": "object", - "default": {}, - "title": "The backstage Schema", - "required": [ - "companyname", - "baseUrl", - "catalog" - ], - "properties": { - "companyname": { - "type": "string", - "default": "", - "title": "The companyname Schema", - "examples": [ - "Red Hat Backstage Helm Chart" - ] - }, - "baseUrl": { - "type": "string", - "default": "", - "title": "The baseUrl Schema", - "examples": [ - "" - ] - }, - "catalog": { - "type": "object", - "default": {}, - "title": "The catalog Schema", - "required": [ - "rules", - "locations" - ], - "properties": { - "rules": { - "type": "array", - "default": [], - "title": "The rules Schema", - "items": { - "type": "object", - "default": {}, - "title": "A Schema", - "required": [ - "allow" - ], - "properties": { - "allow": { - "type": "array", - "default": [], - "title": "The allow Schema", - "items": { - "type": "string", - "title": "A Schema", - "examples": [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - }, - "examples": [ - [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - ] - } - }, - "examples": [ - { - "allow": [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - } - ] - }, - "examples": [ - [ - { - "allow": [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - } - ] - ] - }, - "locations": { - "type": "array", - "default": [], - "title": "The locations Schema", - "items": { - "type": "object", - "default": {}, - "title": "A Schema", - "required": [ - "type", - "target" - ], - "properties": { - "type": { - "type": "string", - "default": "", - "title": "The type Schema", - "examples": [ - "url" - ] - }, - "target": { - "type": "string", - "default": "", - "title": "The target Schema", - "examples": [ - "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" - ] - } - }, - "examples": [ - { - "type": "url", - "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" - } - ] - }, - "examples": [ - [ - { - "type": "url", - "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" - } - ] - ] - } - }, - "examples": [ - { - "rules": [ - { - "allow": [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - } - ], - "locations": [ - { - "type": "url", - "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" - } - ] - } - ] - } - }, - "examples": [ - { - "companyname": "Red Hat Backstage Helm Chart", - "baseUrl": "", - "catalog": { - "rules": [ - { - "allow": [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - } - ], - "locations": [ - { - "type": "url", - "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" - } - ] - } - } - ] + "image": { + "pullPolicy": "Always", + "registry": "quay.io", + "repository": "fedora/postgresql-13", + "version": "13" }, - "additionalConfig": { - "type": "object", - "default": {}, - "title": "Additional Backstage configuration", - "properties": {}, - "examples": [ - {} - ] + "resources": { + "limits": { + "cpu": "400m", + "memory": "596Mi" + }, + "requests": { + "cpu": "100m", + "memory": "128Mi" + } + }, + "serviceAccount": { + "create": true, + "annotations": {}, + "name": "" } - }, - "examples": [ - { - "replicaCount": 1, - "image": { - "pullPolicy": "Always", - "registry": "ghcr.io", - "repository": "janus-idp/redhat-backstage-build", - "version": "latest" - }, - "imagePullSecrets": [], - "nameOverride": "", - "fullnameOverride": "", - "service": { - "type": "ClusterIP", - "port": 8080, - "targetPort": 7007 - }, - "route": { - "enabled": true, - "termination": "edge", - "annotations": {} - }, - "ingress": { - "enabled": false, - "className": "", - "annotations": {}, - "tls": { - "secretName": "" - } - }, - "name": "backstage", - "postgres": { - "external": false, - "storage": { - "enabled": true, - "size": "2Gi" - }, - "database_user": "postgres", - "database_name": "postgres", - "database_host": "", - "database_password": "", - "database_port": 5432, - "existingSecret": "", - "secretKeys": { - "adminPasswordKey": "" - }, - "image": { - "pullPolicy": "Always", - "registry": "quay.io", - "repository": "fedora/postgresql-13", - "version": "13" - }, - "resources": { - "limits": { - "cpu": "400m", - "memory": "596Mi" - }, - "requests": { - "cpu": "100m", - "memory": "128Mi" - } - }, - "serviceAccount": { - "create": true, - "annotations": {}, - "name": "" - } - }, - "resources": {}, - "serviceAccount": { - "create": true, - "annotations": {}, - "name": "" - }, - "securityContext": {}, - "backstage": { - "companyname": "Red Hat Backstage Helm Chart", - "baseUrl": "", - "catalog": { - "rules": [ - { - "allow": [ - "Component", - "System", - "API", - "Resource", - "Location" - ] - } - ], - "locations": [ - { - "type": "url", - "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" - } - ] - } - }, - "additionalConfig": {} + }, + "resources": {}, + "serviceAccount": { + "create": true, + "annotations": {}, + "name": "" + }, + "securityContext": {}, + "backstage": { + "companyname": "Red Hat Backstage Helm Chart", + "baseUrl": "", + "catalog": { + "rules": [ + { + "allow": ["Component", "System", "API", "Resource", "Location"] + } + ], + "locations": [ + { + "type": "url", + "target": "https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all-components.yaml" + } + ] } - ] + }, + "additionalConfig": {} + } + ] } diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index 98356148c0..081b18ed97 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -4,11 +4,11 @@ image: pullPolicy: Always registry: ghcr.io repository: janus-idp/redhat-backstage-build - version: "latest" + version: 'latest' imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" +nameOverride: '' +fullnameOverride: '' service: type: ClusterIP @@ -28,13 +28,13 @@ ingress: enabled: false ## @param ingress.className Name of the IngressClass cluster resource which defines which controller will implement the resource (e.g nginx) - className: "" + className: '' ## @param ingress.annotations Additional annotations for the Ingress resource annotations: {} tls: - secretName: "" + secretName: '' # name of instances name: backstage @@ -49,20 +49,20 @@ postgres: database_user: postgres database_name: postgres ## If using external db set the host - database_host: "" + database_host: '' ## Password will be autogenerated if left empty ## If using external instance supply the password - database_password: "" + database_password: '' database_port: 5432 ## To you self created secret define the following - existingSecret: "" + existingSecret: '' secretKeys: - adminPasswordKey: "" + adminPasswordKey: '' image: pullPolicy: Always registry: quay.io repository: fedora/postgresql-13 - version: "13" + version: '13' resources: limits: cpu: 400m @@ -77,7 +77,7 @@ postgres: annotations: {} # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template - name: "" + name: '' resources: {} @@ -95,14 +95,14 @@ serviceAccount: annotations: {} # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template - name: "" + name: '' securityContext: {} ## There is a secret created via the template/ backstage: - companyname: "Red Hat Backstage Helm Chart" - baseUrl: "" + companyname: 'Red Hat Backstage Helm Chart' + baseUrl: '' ## Override Catalog with here catalog: diff --git a/package.json b/package.json index c99c13d526..749473dd27 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "lint": "backstage-cli repo lint --since origin/main", "lint:all": "backstage-cli repo lint", "prettier:check": "prettier --check .", + "prettier:write": "prettier --write .", "new": "backstage-cli new --scope internal" }, "workspaces": { From 7501bdc1f62b15bb308b8da136e3b8f2b51ab4da Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Wed, 25 Jan 2023 15:25:24 -0600 Subject: [PATCH 2/3] removed docker build from ci Signed-off-by: Paul Schultz --- .github/workflows/docker-build.yaml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/docker-build.yaml diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000000..e1321e8d0b --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -0,0 +1,38 @@ +# Copyright 2023 Janus 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. + +name: Docker Build +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +jobs: + docker-build: + name: Docker Build Job + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Docker + run: | + docker build -t backstage-showcase . From d619f4153549d098dca2dfcbb553471cdd55061e Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Wed, 25 Jan 2023 15:25:56 -0600 Subject: [PATCH 3/3] removed docker build from ci Signed-off-by: Paul Schultz --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22f57366fa..1befc3bc7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,3 @@ jobs: - name: Build run: | yarn build:all - - - name: Docker - run: | - yarn nx affected --target=docker-build --parallel=3