Skip to content

Commit

Permalink
Merge branch 'main' into fix-yarn-start
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaperex committed Jul 12, 2024
2 parents e2adf51 + 6009aa4 commit f542c35
Show file tree
Hide file tree
Showing 160 changed files with 10,380 additions and 7,318 deletions.
101 changes: 94 additions & 7 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
":gitSignOff",
":rebaseStalePrs",
"group:allNonMajor",
"group:linters",
"group:test",
"default:pinDigestsDisabled",
"default:automergeBranchPush"
],
"js": {
"managerBranchPrefix": "js-"
},
"python": {
"managerBranchPrefix": "python-"
"groupName": "python ",
"additionalBranchPrefix": "python ",
"dependencyDashboardApproval": true,
"description": "require dashboard approval for all python dependencies due to potential conflicts"
},
"labels": ["kind/dependency upgrade"],
"npm": {
Expand All @@ -27,6 +25,9 @@
"enabled": false
}
},
"major": {
"dependencyDashboardApproval": true
},
"packageRules": [
{
"matchDatasources": ["docker"],
Expand All @@ -35,20 +36,106 @@
{
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["patch", "minor"],
"matchCurrentVersion": "!/^0/",
"groupName": ["DevDependencies (non-major)"],
"automerge": true
},
{
"matchDepTypes": ["devDependencies"],
"matchUpdateTypes": ["major"],
"groupName": ["DevDependencies "]
},
{
"matchDepTypes": ["dependencies", "peerDependencies"],
"groupName": "Dependencies (non-major)",
"matchUpdateTypes": ["minor", "patch"]
},
{
"matchDepTypes": ["dependencies", "peerDependencies"],
"groupName": "Dependencies",
"matchUpdateTypes": ["major"]
},
{
"extends": ["packages:test"],
"matchUpdateTypes": ["patch", "minor"],
"matchCurrentVersion": "!/^0/",
"groupName": "Test packages (non-major)",
"automerge": true
},
{
"extends": ["packages:test"],
"matchUpdateTypes": ["major"],
"groupName": "Test packages "
},
{
"extends": ["packages:linters"],
"matchUpdateTypes": ["patch", "minor"],
"matchCurrentVersion": "!/^0/",
"groupName": "linters (non-major)",
"automerge": true
},
{
"extends": ["packages:linters"],
"matchUpdateTypes": ["major"],
"groupName": "linters"
},
{
"extends": "monorepo:material-ui",
"matchUpdateTypes": ["patch", "minor"],
"groupName": "material-ui (non-major)",
"automerge": true
},
{
"extends": "monorepo:material-ui",
"matchUpdateTypes": ["major"],
"groupName": "material-ui"
},
{
"extends": "monorepo:react",
"matchUpdateTypes": ["patch", "minor"],
"groupName": "react (non-major)",
"automerge": true
},
{
"extends": "monorepo:react",
"matchUpdateTypes": ["major"],
"groupName": "react"
},
{
"extends": "monorepo:emotion",
"matchUpdateTypes": ["patch", "minor"],
"groupName": "emotion (non-major)",
"automerge": true
},
{
"extends": "monorepo:emotion",
"matchUpdateTypes": ["major"],
"groupName": "emotion"
},
{
"matchPackagePrefixes": ["@types/"],
"matchUpdateTypes": ["patch", "minor"],
"groupName": "types (non-major)"
},
{
"matchPackagePrefixes": ["@types/"],
"matchUpdateTypes": ["major"],
"groupName": "types "
},
{
"matchPackagePatterns": [
"^@backstage/",
"^@backstage-community/",
"^@janus-idp/",
"^@immobiliarelabs/",
"^@roadiehq/",
"^@pagerduty/",
"^@internal/"
],
"description": "ignore updates to all backstage updates and 3rd party plugins",
"groupName": ["Backstage packages"],
"dependencyDashboardApproval": true
"dependencyDashboardApproval": true,
"enabled": false
}
],
"ignorePaths": ["**/dist-dynamic/**"],
Expand Down
2 changes: 1 addition & 1 deletion .ibm/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.44.1-jammy
FROM mcr.microsoft.com/playwright:v1.45.1-jammy

ENV CI=1 \
QT_X11_NO_MITSHM=1 \
Expand Down
6 changes: 4 additions & 2 deletions .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ HELM_IMAGE_NAME=backstage
HELM_REPO_NAME=rhdh-chart
HELM_REPO_URL="https://redhat-developer.github.io/rhdh-chart"
K8S_CLUSTER_TOKEN_ENCODED=$(echo -n $K8S_CLUSTER_TOKEN | base64 | tr -d '\n')
QUAY_REPO="${QUAY_REPO:-janus-idp/backstage-showcase}"

RELEASE_NAME=rhdh
RELEASE_NAME_RBAC=rhdh-rbac
NAME_SPACE=showcase
NAME_SPACE_RBAC=showcase-rbac
NAME_SPACE="${NAME_SPACE:-showcase}"
NAME_SPACE_RBAC="${NAME_SPACE_RBAC:-showcase-rbac}"
NAME_SPACE_POSTGRES_DB="${NAME_SPACE_POSTGRES_DB:-postgress-external-db}"
CHART_VERSION="2.15.2"
GITHUB_APP_APP_ID=Mzc2ODY2
GITHUB_APP_CLIENT_ID=SXYxLjdiZDNlZDFmZjY3MmY3ZDg=
Expand Down
38 changes: 33 additions & 5 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,28 @@ configure_namespace() {
oc config set-context --current --namespace="${project}"
}

configure_external_postgres_db() {
local project=$1
oc apply -f "${DIR}/resources/postgres-db/postgres.yaml" --namespace="${NAME_SPACE_POSTGRES_DB}"
sleep 5

oc get secret postgress-external-db-cluster-cert -n "${NAME_SPACE_POSTGRES_DB}" -o jsonpath='{.data.ca\.crt}' | base64 --decode > postgres-ca
oc get secret postgress-external-db-cluster-cert -n "${NAME_SPACE_POSTGRES_DB}" -o jsonpath='{.data.tls\.crt}' | base64 --decode > postgres-tls-crt
oc get secret postgress-external-db-cluster-cert -n "${NAME_SPACE_POSTGRES_DB}" -o jsonpath='{.data.tls\.key}' | base64 --decode > postgres-tsl-key

oc create secret generic postgress-external-db-cluster-cert \
--from-file=ca.crt=postgres-ca \
--from-file=tls.crt=postgres-tls-crt \
--from-file=tls.key=postgres-tsl-key \
--dry-run=client -o yaml | oc apply -f - --namespace="${project}"

POSTGRES_PASSWORD=$(oc get secret/postgress-external-db-pguser-janus-idp -n "${NAME_SPACE_POSTGRES_DB}" -o jsonpath={.data.password})
sed -i "s|POSTGRES_PASSWORD:.*|POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}|g" "${DIR}/resources/postgres-db/postgres-cred.yaml"
POSTGRES_HOST=$(echo -n "postgress-external-db-primary.$NAME_SPACE_POSTGRES_DB.svc.cluster.local" | base64 | tr -d '\n')
sed -i "s|POSTGRES_HOST:.*|POSTGRES_HOST: ${POSTGRES_HOST}|g" "${DIR}/resources/postgres-db/postgres-cred.yaml"
oc apply -f "${DIR}/resources/postgres-db/postgres-cred.yaml" --namespace="${project}"
}

apply_yaml_files() {
local dir=$1
local project=$2
Expand Down Expand Up @@ -138,7 +160,7 @@ apply_yaml_files() {
token=$(oc get secret "${secret_name}" -n "${project}" -o=jsonpath='{.data.token}')
sed -i "s/OCM_CLUSTER_TOKEN: .*/OCM_CLUSTER_TOKEN: ${token}/" "$dir/auth/secrets-rhdh-secrets.yaml"

if [[ "${project}" == "showcase-rbac" || "${project}" == "showcase-rbac-nightly" ]]; then
if [[ "${project}" == "showcase-rbac" || "${project}" == "showcase-rbac-nightly" || "${project}" == "showcase-rbac-1-2-x" ]]; then
oc apply -f "$dir/resources/config_map/configmap-app-config-rhdh-rbac.yaml" --namespace="${project}"
else
oc apply -f "$dir/resources/config_map/configmap-app-config-rhdh.yaml" --namespace="${project}"
Expand Down Expand Up @@ -294,22 +316,27 @@ install_pipelines_operator() {
}

initiate_deployments() {
add_helm_repos
configure_namespace "${NAME_SPACE}"
install_pipelines_operator "${DIR}"
install_helm
uninstall_helmchart "${NAME_SPACE}" "${RELEASE_NAME}"

cd "${DIR}"
apply_yaml_files "${DIR}" "${NAME_SPACE}"
add_helm_repos
echo "Deploying Image: ${TAG_NAME}"
helm upgrade -i "${RELEASE_NAME}" -n "${NAME_SPACE}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "${DIR}/value_files/${HELM_CHART_VALUE_FILE_NAME}" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.tag="${TAG_NAME}"
echo "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE : ${NAME_SPACE}"
helm upgrade -i "${RELEASE_NAME}" -n "${NAME_SPACE}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "${DIR}/value_files/${HELM_CHART_VALUE_FILE_NAME}" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.repository="${QUAY_REPO}" --set upstream.backstage.image.tag="${TAG_NAME}"

configure_namespace "${NAME_SPACE_POSTGRES_DB}"
configure_namespace "${NAME_SPACE_RBAC}"
configure_external_postgres_db "${NAME_SPACE_RBAC}"


install_pipelines_operator "${DIR}"
uninstall_helmchart "${NAME_SPACE_RBAC}" "${RELEASE_NAME_RBAC}"
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}"
helm upgrade -i "${RELEASE_NAME_RBAC}" -n "${NAME_SPACE_RBAC}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "${DIR}/value_files/${HELM_CHART_RBAC_VALUE_FILE_NAME}" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.tag="${TAG_NAME}"
echo "Deploying image from repository: ${QUAY_REPO}, TAG_NAME: ${TAG_NAME}, in NAME_SPACE : ${RELEASE_NAME_RBAC}"
helm upgrade -i "${RELEASE_NAME_RBAC}" -n "${NAME_SPACE_RBAC}" "${HELM_REPO_NAME}/${HELM_IMAGE_NAME}" --version "${CHART_VERSION}" -f "${DIR}/value_files/${HELM_CHART_RBAC_VALUE_FILE_NAME}" --set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" --set upstream.backstage.image.repository="${QUAY_REPO}" --set upstream.backstage.image.tag="${TAG_NAME}"
}

check_and_test() {
Expand All @@ -332,6 +359,7 @@ main() {
if [[ "$JOB_NAME" == *periodic-* ]]; then
NAME_SPACE="showcase-ci-nightly"
NAME_SPACE_RBAC="showcase-rbac-nightly"
NAME_SPACE_POSTGRES_DB="postgress-external-db-nightly"
fi

install_oc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ subjects:
- kind: ServiceAccount
name: rhdh-k8s-plugin
namespace: showcase-ci-nightly
- kind: ServiceAccount
name: rhdh-k8s-plugin
namespace: showcase-1-2-x
- kind: ServiceAccount
name: rhdh-k8s-plugin
namespace: showcase-rbac-1-2-x

12 changes: 10 additions & 2 deletions .ibm/pipelines/resources/config_map/configmap-app-config-rhdh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ data:
headerColor1: "rgb(248, 248, 248)"
headerColor2: "rgb(248, 248, 248)"
navigationIndicatorColor: "rgb(255,95,21)"
dark:
primaryColor: '#ab75cf'
headerColor1: 'rgb(0, 0, 208)'
headerColor2: 'rgb(255, 246, 140)'
navigationIndicatorColor: 'rgb(244, 238, 169)'
backend:
auth:
keys:
Expand Down Expand Up @@ -98,7 +103,11 @@ data:
target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
rules:
- allow: [User, Group]
providers:
githubOrg:
id: production
githubUrl: "${GITHUB_URL}"
orgs: ["${GITHUB_ORG}"]
dynatrace:
baseUrl: temp
Expand All @@ -119,4 +128,3 @@ data:
admin:
users:
- name: user:default/rhdh-qe
10 changes: 10 additions & 0 deletions .ibm/pipelines/resources/postgres-db/postgres-cred.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: Secret
apiVersion: v1
metadata:
name: postgres-cred
data:
POSTGRES_PASSWORD: dG1w
POSTGRES_PORT: NTQzMg==
POSTGRES_USER: amFudXMtaWRw
POSTGRES_HOST: dG1w
PGSSLMODE: cmVxdWlyZQ==
74 changes: 74 additions & 0 deletions .ibm/pipelines/resources/postgres-db/postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: postgress-external-db
spec:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1
postgresVersion: 16
instances:
- name: instance1
dataVolumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 2Gi
resources:
limits:
cpu: 300m
requests:
cpu: 200m
sidecars:
replicaCertCopy:
resources:
limits:
cpu: 300m
requests:
cpu: 200m
backups:
pgbackrest:
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.51-1
global:
# Save backups for 7 days, this means 1 full backups with 6 differential ones in between
repo1-retention-full: "1"
repo1-retention-full-type: count
repoHost:
resources:
limits:
cpu: 300m
requests:
cpu: 200m
repos:
- name: repo1
schedules:
# Every sunday at 01:00 full backup
full: "0 1 * * 0"
# Monday through saturday at 01:00 differential backup
differential: "0 1 * * 1-6"
volume:
volumeClaimSpec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: 2Gi
sidecars:
pgbackrest:
resources:
limits:
cpu: 300m
requests:
cpu: 200m
pgbackrestConfig:
resources:
limits:
cpu: 300m
requests:
cpu: 200m
users:
- name: janus-idp
options: "SUPERUSER"
- name: sonarqube
databases:
- sonarqube
options: "NOSUPERUSER"
Loading

0 comments on commit f542c35

Please sign in to comment.