Skip to content

Commit b369337

Browse files
authored
feat: setup docs (#98)
* ADD: prod configurations * ADD: migrate scaffolder plugin for github * UPD: update database config * UPD: techdocs config * UPD: techdocs config * UPD: fix errors * UPD: fix errors * UPD: fix dependencies issues * UPD: fix Dockerfile issue * UPD: fix Dockerfile commandas * ADD: Add TechDocs documentation for CODE-IDP platform
1 parent 678d874 commit b369337

File tree

10 files changed

+741
-60
lines changed

10 files changed

+741
-60
lines changed

.github/workflows/cd-workflow.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,9 @@ jobs:
6969
uses: 'google-github-actions/auth@v2'
7070
with:
7171
create_credentials_file: true
72-
workload_identity_provider: 'projects/1006240973223/locations/global/workloadIdentityPools/deploy-backstage/providers/github-actions'
73-
service_account: '[email protected]'
74-
- id: 'deploy'
75-
uses: 'google-github-actions/deploy-cloudrun@v2'
7672
with:
7773
service: 'backstage-deployment'
7874
image: 'europe-west10-docker.pkg.dev/code-idp/backstage-deploy/backstage-image:${{ github.sha }}'
7975
region: europe-west10
8076
flags: |
8177
--port=7007
82-
--allow-unauthenticated
83-
--add-cloudsql-instances=code-idp:europe-west10:backstage-pg
84-
env_vars: |
85-
POSTGRES_HOST=/cloudsql/code-idp:europe-west10:backstage-pg
86-
POSTGRES_PORT=5432
87-
POSTGRES_USER=postgres
88-
POSTGRES_DB=postgres
89-
secrets: |
90-
POSTGRES_PASSWORD=postgres_password:latest
91-
GITHUB_TOKEN=github_token:latest
92-
GOOGLE_CLIENT_ID=google_client_id:latest
93-
GOOGLE_CLIENT_SECRET=google_client_secret:latest
94-
GITHUB_CLIENT_ID=github_client_id:latest
95-
GITHUB_CLIENT_SECRET=github_client_secret:latest
96-
GITLAB_TOKEN=gitlab_token:latest
97-
TECHDOCS_GCS_CREDENTIALS=techdocs_gcs_credentials:latest

.github/workflows/techdocs-gcs.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,13 @@ jobs:
1616
node-version: ['20.x']
1717

1818
env:
19-
TECHDOCS_BUCKET_NAME: backstage-codeidp-techdocs
20-
TECHDOCS_GCS_CREDENTIALS: ${{ secrets.TECHDOCS_GCS_CREDENTIALS }}
21-
TECHDOCS_REGION: europe-west10
2219
ENTITY_NAMESPACE: 'default'
2320
ENTITY_KIND: 'Component'
2421
ENTITY_NAME: 'code-idp-docs'
2522

2623
steps:
2724
- name: Checkout code
2825
uses: actions/checkout@v4
29-
30-
- uses: actions/setup-node@v3
31-
- uses: actions/setup-python@v4
32-
with:
33-
python-version: '3.9'
34-
35-
- name: Install techdocs-cli
36-
run: sudo npm install -g @techdocs/cli
37-
38-
- name: Install mkdocs and required plugins
39-
run: |
40-
python3 -m pip install mkdocs-techdocs-core==1.*
41-
python3 -m pip install mkdocs-include-markdown-plugin
42-
4326

4427
- name: Generate docs site
4528
run: techdocs-cli generate --no-docker --verbose

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ ENV PYTHON=/usr/bin/python3
2727
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2828
--mount=type=cache,target=/var/lib/apt,sharing=locked \
2929
apt-get update && \
30-
apt-get install -y --no-install-recommends python3 g++ build-essential && \
30+
apt-get install -y --no-install-recommends \
31+
python3 \
32+
g++ \
33+
build-essential \
34+
libcairo2-dev \
35+
libpango1.0-dev \
36+
libjpeg-dev \
37+
libgif-dev \
38+
librsvg2-dev \
39+
pkg-config && \
3140
rm -rf /var/lib/apt/lists/*
3241

3342
# Enable Corepack (for Yarn management) and install the required Yarn version
@@ -48,6 +57,7 @@ COPY --from=packages --chown=node:node /app/backstage.json ./
4857
RUN mkdir -p /home/node/.cache/node/corepack/v1 && \
4958
chown -R node:node /home/node/.cache
5059

60+
5161
#ENV CYPRESS_INSTALL_BINARY=0
5262
#RUN yarn install --immutable --network-timeout 600000
5363
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \

app-config.production.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
app:
2-
baseUrl: https://backstage-deployment-1006240973223.europe-west10.run.app
2+
baseUrl: https://backstage.foundations-software-engineering.com
33

44
backend:
5-
baseUrl: https://backstage-deployment-1006240973223.europe-west10.run.app
5+
baseUrl: https://backstage.foundations-software-engineering.com
66
cors:
7-
origin: https://backstage-deployment-1006240973223.europe-west10.run.app
7+
origin: https://backstage.foundations-software-engineering.com
88
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
99
credentials: true
1010

app-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ techdocs:
4242
generator:
4343
runIn: 'local'
4444
publisher:
45-
type: 'googleGcs'
46-
googleGcs:
47-
bucketName: 'backstage-codeidp-techdocs'
48-
projectId: code-idp
49-
credentials: ${TECHDOCS_GCS_CREDENTIALS}
45+
type: 'local'
5046

5147
# scaffolder:
5248

docs/mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
site_name: Documentation Site
2+
docs_dir: docs
3+
plugins:
4+
- techdocs-core

mkdocs.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ site_description: This is the user guide for the CODE-IDP platform.
33
docs_dir: docs
44
nav:
55
- Overview:
6-
- Introduction: 'index.md'
6+
- Introduction: 'index.md'
77
- Components:
8-
- Register Your Software Component: 'how-to-register-a-component.md'
9-
- Technical Documentation:
10-
- Publish Your Docs: 'how-to-publish-documentation.md'
118
- CHANGELOG: 'CHANGELOG.md'
129

13-
plugins:
10+
plugins:
1411
- techdocs-core
1512
- include-markdown

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@backstage/e2e-test-utils": "^0.1.1",
5050
"@playwright/test": "^1.32.3",
5151
"@spotify/prettier-config": "^12.0.0",
52+
"@techdocs/cli": "^1.9.8",
5253
"@testing-library/react": "^16.2.0",
5354
"@types/babel__core": "^7.1.20",
5455
"@types/babel__preset-env": "^7.4.7",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"exclude": ["node_modules"],
1212
"compilerOptions": {
13+
"moduleResolution": "bundler",
1314
"outDir": "dist-types",
1415
"rootDir": "."
1516
}

0 commit comments

Comments
 (0)