From 6270c8fbac2904da74d32dd4a8b5cf9cc8d5bf85 Mon Sep 17 00:00:00 2001 From: Monta Bot <112391068+montabot@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:41:18 +0100 Subject: [PATCH 1/6] Add backstage file --- catalog-info.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 catalog-info.yaml diff --git a/catalog-info.yaml b/catalog-info.yaml new file mode 100644 index 00000000..67b60c15 --- /dev/null +++ b/catalog-info.yaml @@ -0,0 +1,44 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + # Name of the project + name: x + description: ORY-specific go-libraries + # Specifies the directory of the docs + annotations: + backstage.io/techdocs-ref: dir:. + + # TODO: Please set the service tier manually, + # See notion page for more info: https://www.notion.so/montaapp/Service-Tiers-035d974e192d496a962f409bc0808a53?pvs=4 + labels: + tier: '3' + + # These links are just examples, set them to what you think is the most relevant. + links: + # Slack channel to write in for communicating with the resposible team. + - title: Team Slack Channel + url: https://monta-app01.slack.com/archives/C04JANZMTQV # TODO: Please set manually + type: Slack + icon: chat + # Page in notion documenting the purpose and function of the service + - title: Notion + url: + https://www.notion.so/montaapp/Framework-Micronaut-2ae59cfc3a9c4261bb14e1194c80bd45?pvs=4 # TODO: Please set manually + type: Notion + icon: docs + # Link to the most relevant grafana dashboard, i recommend a "4 golden signals" dashboard + - url: + https://grafana.monta.app/d/e6faee93-c3b3-4b0d-a5e9-e236ee37903c/sre-monitor-1?orgId=1&refresh=1m # TODO: Please set manually + title: Grafana + icon: dashboard + type: metrics-dashboard + +# The spec defines who becomes the owner of the system in backstage +spec: + type: undefined + # See lifecycle common values: https://backstage.io/docs/features/software-catalog/descriptor-format/#speclifecycle-required + lifecycle: undefined # TODO: Please set manually + # Name of the squad responsible for the project, e.g. sre or cpi + owner: Platform Services + # Name of the greater system, e.g. "solar" is a part of the home system + system: Platform From 17ad572e559c615f98453b7863595faab92b0985 Mon Sep 17 00:00:00 2001 From: Monta Bot <112391068+montabot@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:41:20 +0100 Subject: [PATCH 2/6] Add backstage file --- mkdocs.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 mkdocs.yml diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..5f419c2b --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,8 @@ +# This file is used to index the docs in the ./docs directory +site_name: 'service documentation' + +nav: + - Home: index.md + +plugins: + - techdocs-core \ No newline at end of file From 46c8eec899f316a3c7b02d522ca05da6de97d52c Mon Sep 17 00:00:00 2001 From: Monta Bot <112391068+montabot@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:41:21 +0100 Subject: [PATCH 3/6] Add backstage file --- docs/index.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/index.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..89c4b047 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,11 @@ +# Introduction to TechDocs and mkdocs.yaml + +TechDocs is a tool used for generating beautiful documentation websites directly from your code repositories. It simplifies the process of creating and maintaining documentation for your projects. One of the key components of TechDocs is `mkdocs.yaml`, a configuration file that allows you to customize various aspects of your documentation site. + +## mkdocs.yaml + +`mkdocs.yaml` is a YAML configuration file used by MkDocs, the static site generator behind TechDocs. It allows you to define the structure, appearance, and behavior of your documentation website. + +In Backstage, the open-source platform for building developer portals, TechDocs is integrated seamlessly, and `mkdocs.yaml` is utilized to configure the documentation site generated by TechDocs. + +Inside `mkdocs.yaml`, you can specify various settings such as site title, navigation structure, theme customization, and more. This configuration file plays a crucial role in tailoring your documentation site to meet your project's specific requirements and preferences, providing a seamless experience for your users. From 43f06455e9a27b41bdb64f13ab32314b1d7ed642 Mon Sep 17 00:00:00 2001 From: Monta Bot <112391068+montabot@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:41:23 +0100 Subject: [PATCH 4/6] Add backstage file --- .github/workflows/backstage_techdocs.yaml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/backstage_techdocs.yaml diff --git a/.github/workflows/backstage_techdocs.yaml b/.github/workflows/backstage_techdocs.yaml new file mode 100644 index 00000000..c9cca3b4 --- /dev/null +++ b/.github/workflows/backstage_techdocs.yaml @@ -0,0 +1,44 @@ +name: Publish TechDocs Site + +on: + push: + branches: [main] + paths: + - "docs/**" + - "mkdocs.yml" + workflow_dispatch: + + +jobs: + publish-techdocs-site: + runs-on: ubuntu-latest + + env: + TECHDOCS_S3_BUCKET_NAME: 'monta-tech-docs' + AWS_ACCESS_KEY_ID: ${{ secrets.TECHDOCS_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.TECHDOCS_AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'eu-west-1' + ENTITY_NAMESPACE: 'default' + ENTITY_KIND: 'Component' + ENTITY_NAME: 'backstage' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install techdocs-cli + run: sudo npm install -g @techdocs/cli + + - name: Install mkdocs and mkdocs plugins + run: python -m pip install mkdocs-techdocs-core==1.* + + - name: Generate docs site + run: techdocs-cli generate --no-docker --verbose + + - name: Publish docs site + run: techdocs-cli publish --publisher-type awsS3 --storage-name $TECHDOCS_S3_BUCKET_NAME --entity $ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME \ No newline at end of file From a96aafdacb62732c4bd518b46361551110f1317a Mon Sep 17 00:00:00 2001 From: Monta Bot <112391068+montabot@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:29:57 +0100 Subject: [PATCH 5/6] Correct entity name in workflow file --- .github/workflows/backstage_techdocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backstage_techdocs.yaml b/.github/workflows/backstage_techdocs.yaml index c9cca3b4..3c633c4a 100644 --- a/.github/workflows/backstage_techdocs.yaml +++ b/.github/workflows/backstage_techdocs.yaml @@ -20,7 +20,7 @@ jobs: AWS_REGION: 'eu-west-1' ENTITY_NAMESPACE: 'default' ENTITY_KIND: 'Component' - ENTITY_NAME: 'backstage' + ENTITY_NAME: ${{ github.event.repository.name }} steps: - name: Checkout code From 654efe581fb412aee13a2e7f7579468cab579cf4 Mon Sep 17 00:00:00 2001 From: Monta Bot <112391068+montabot@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:36:19 +0100 Subject: [PATCH 6/6] Update version of github workflow --- .github/workflows/backstage_techdocs.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backstage_techdocs.yaml b/.github/workflows/backstage_techdocs.yaml index 3c633c4a..d7de3627 100644 --- a/.github/workflows/backstage_techdocs.yaml +++ b/.github/workflows/backstage_techdocs.yaml @@ -24,10 +24,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - - uses: actions/setup-python@v4 + - uses: actions/setup-node@v4 + - uses: actions/setup-python@v5 with: python-version: '3.9'