Skip to content

Commit a5bff0b

Browse files
committed
UPD: merge branch 'main' into dependabot/npm_and_yarn/npm_and_yarn-66cf255e39
2 parents 91dea04 + e2cb9c6 commit a5bff0b

File tree

78 files changed

+41476
-25513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+41476
-25513
lines changed

.env.example

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ POSTGRES_PASSWORD="admin"
55

66
BASE_URL="http://localhost:7007"
77

8-
GITHUB_CLIENT_ID="your-id"
9-
GITHUB_CLIENT_SECRET="your-secret"
10-
118
GITHUB_TOKEN="your-token"
129

13-
K8S_URL="k8s-url"
14-
K8S_ACCOUNT_TOKEN="k8s-account-token"
15-
K8S_CA_DATA="k8s-ca-data"
16-
K8S_CA_FILE="k8s-ca-file"
10+
GOOGLE_CLIENT_ID="your-id"
11+
GOOGLE_CLIENT_SECRET="your-secret"

.github/workflows/cd-workflow.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Deploy backstage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
create-and-push-image:
13+
permissions:
14+
id-token: write
15+
contents: read
16+
name: "Create and push the Docker image to GAR"
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- id: 'setup-qemu'
27+
name: Set up QEMU
28+
uses: docker/setup-qemu-action@v3
29+
30+
- id: 'docker-buildx-setup'
31+
name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: 'Authenticate to Google Cloud'
35+
id: 'auth'
36+
uses: 'google-github-actions/auth@v2'
37+
with:
38+
create_credentials_file: true
39+
token_format: "access_token"
40+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
41+
service_account: ${{ secrets.GCP_DEPLOY_SA }}
42+
43+
- name: "Login to GAR"
44+
id: 'login-gar'
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}
48+
username: oauth2accesstoken
49+
password: ${{ steps.auth.outputs.access_token }}
50+
51+
- id: 'build-and-push'
52+
name: 'Build and Push docker Image'
53+
uses: docker/build-push-action@v5
54+
with:
55+
push: true
56+
context: .
57+
file: ./Dockerfile
58+
platforms: linux/amd64
59+
tags: ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/backstage-image:${{ github.sha }}
60+
build-args: |
61+
APP_ENV=docker
62+
63+
64+
deploy-image:
65+
permissions:
66+
id-token: write
67+
contents: read
68+
69+
name: "Deploy image on cloud run"
70+
runs-on: ubuntu-latest
71+
defaults:
72+
run:
73+
shell: bash
74+
needs: create-and-push-image
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v4
79+
80+
- id: 'auth'
81+
name: 'Authenticate to Google Cloud'
82+
uses: 'google-github-actions/auth@v2'
83+
with:
84+
create_credentials_file: true
85+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
86+
service_account: ${{ secrets.GCP_DEPLOY_SA }}
87+
88+
- name: Deploy to Cloud Run
89+
id: 'deploy'
90+
uses: 'google-github-actions/deploy-cloudrun@v2'
91+
with:
92+
service: ${{ secrets.GCP_CLOUD_RUN_SERVICE }}
93+
image: ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/backstage-image:${{ github.sha }}
94+
region: ${{ secrets.GCP_REGION }}
95+
flags: '--platform managed --allow-unauthenticated --port=7007'
96+
secrets: |-
97+
GITHUB_TOKEN=github_token:latest
98+
GITLAB_TOKEN=gitlab_token:latest
99+
GOOGLE_CLIENT_ID=google_client_id:latest
100+
GOOGLE_CLIENT_SECRET=google_client_secret:latest
101+
PROD_GITHUB_CLIENT_SECRET=github_client_secret:latest
102+
PROD_GITHUB_CLIENT_ID=github_client_id:latest
103+

.github/workflows/ci-workflow.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,40 @@ name: CI Workflow
33
on:
44
push:
55
branches:
6-
- '**'
6+
- main
77
pull_request:
88
branches:
9-
- '**'
9+
- main
1010

1111
jobs:
1212
setup_and_test:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: ['18.x', '20.x']
16+
node-version: ['20.x']
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222

23+
- name: Enable Corepack
24+
run: corepack enable
25+
26+
- name: Set Yarn Version
27+
run: corepack prepare [email protected] --activate
28+
2329
- name: Set up Node.js
24-
uses: actions/setup-node@v2
30+
uses: actions/setup-node@v4
2531
with:
2632
node-version: ${{ matrix.node-version }}
27-
cache: 'yarn'
33+
cache: 'yarn'
2834

2935
- name: Check Node.js version
3036
run: node -v
3137

3238
- name: Install dependencies
33-
run: yarn install --frozen-lockfile
39+
run: yarn install
3440

3541
# - name: Lint code
3642
# run: yarn lint:all
@@ -44,7 +50,7 @@ jobs:
4450
validate_commit_messages:
4551
runs-on: ubuntu-latest
4652
steps:
47-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
4854
with:
4955
fetch-depth: 0
5056
- name: Ensure full git history
@@ -73,7 +79,7 @@ jobs:
7379
validate_branch_names:
7480
runs-on: ubuntu-latest
7581
steps:
76-
- uses: actions/checkout@v2
82+
- uses: actions/checkout@v4
7783
- name: Validate Branch Names
7884
run: |
7985
if [ "${{ github.event_name }}" == "pull_request" ]; then
@@ -88,7 +94,7 @@ jobs:
8894
branch_name=$(git rev-parse --abbrev-ref HEAD)
8995
echo "Current branch: $branch_name"
9096
fi
91-
if ! echo "$branch_name" | grep -Eq '^(main|feature/.+|hotfix/.+)$'; then
97+
if ! echo "$branch_name" | grep -Eq '^(main|feature/.+|hotfix/.+|dependabot/.+)$'; then
9298
echo "Error: Branch name $branch_name does not fit the naming convention."
9399
exit 1
94100
fi

.github/workflows/create-user-db.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/create-user-mongo-db.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/run-tests.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: Test and E2E tests
2-
run-name: Run tests and E2E tests
3-
1+
name: Test and E2E tests on PR
2+
run-name: Run tests and E2E tests on PR
43
on:
5-
push:
64
pull_request:
75
branches:
86
- main
@@ -11,28 +9,44 @@ jobs:
119
runs-on: ubuntu-latest
1210
steps:
1311
- uses: actions/checkout@v4
12+
13+
- name: Enable Corepack
14+
run: corepack enable
15+
16+
- name: Set Yarn Version
17+
run: corepack prepare [email protected] --activate
18+
19+
1420
- name: Use Node.js
1521
uses: actions/setup-node@v3
1622
with:
1723
node-version: '20'
24+
1825
- run: yarn install
1926
- run: yarn backstage-cli repo test
2027

2128
run-e2e-tests:
2229
runs-on: ubuntu-latest
2330
steps:
24-
- uses: actions/checkout@v4 #chekcout te repository
31+
- uses: actions/checkout@v4
32+
33+
- name: Enable Corepack
34+
run: corepack enable
35+
36+
- name: Set Yarn Version
37+
run: corepack prepare [email protected] --activate
38+
2539
- name: Use Node.js
26-
uses: actions/setup-node@v3 #setup node version 20
40+
uses: actions/setup-node@v3
2741
with:
2842
node-version: '20'
2943

30-
- name: Install dependencies #install dependencies
44+
- name: Install dependencies
3145
run: yarn install
3246

3347
- name: Run E2E tests
3448
env:
35-
PLAYWRIGHT_URL: http://localhost:3000 # set the URL of the app to test with playwright
36-
CI: # unset CI because it is set by default in Github actions
49+
PLAYWRIGHT_URL: http://localhost:3000
50+
CI:
3751
run: |
3852
yarn test:e2e

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ e2e-test-report/
5656
pg_values.yaml
5757

5858
*secret.yaml
59+
60+
61+
key/

.yarn/plugins/@yarnpkg/plugin-backstage.cjs

Lines changed: 46 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- checksum: 8fa2e3a1cdf5076dde96b177618478419daea000b8038412817583e4d309fd39bf4813a337eb1fad3bfe9036d31732f7416383affbe3d420f48eacb60f6184d5
5+
path: .yarn/plugins/@yarnpkg/plugin-backstage.cjs
6+
spec: "https://versions.backstage.io/v1/tags/main/yarn-plugin"

0 commit comments

Comments
 (0)