Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MG-143 - auto-generate Markdown documentation from Helm charts #144

Merged
merged 25 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/helm-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Generate Helm Docs

on:
pull_request:
branches:
- '*' # Run on all pull requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this wildcard even necessary? Do we want it on PR or on each push?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dborovcanin this was for testing purposes. Ideally, we want to run the workflow on a push to master to ensures that Helm docs are only generated for finalized, merged code


jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Generate Helm Docs
uses: losisin/helm-docs-github-action@v1.3.1
with:
chart-search-root: "charts/magistrala"
values-file: "values.yaml"
output-file: "README.md"
template-files: "README.md.gotmpl"
git-push: false
fail-on-diff: true

18 changes: 14 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ jobs:

runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Call Common Steps
uses: ./.github/workflows/common.yaml

- name: Configure Git
run: |
Expand All @@ -43,7 +41,19 @@ jobs:
run: |
helm dependency update charts/magistrala

- name: Add Dependencies
run: |
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm repo update

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: charts/magistrala
config: cr.yaml
env:
CR_TOKEN: "${{ secrets.HELM_RELEASE_TOKEN }}"
7 changes: 3 additions & 4 deletions charts/magistrala/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# magistrala

![Version: 1.0.6](https://img.shields.io/badge/Version-1.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.0](https://img.shields.io/badge/AppVersion-0.14.0-informational?style=flat-square)

Magistrala IoT Platform

![Version: 1.0.6](https://img.shields.io/badge/Version-1.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.0](https://img.shields.io/badge/AppVersion-0.14.0-informational?style=flat-square)

**Homepage:** <https://abstractmachines.fr/magistrala.html>

## Maintainers
Expand Down Expand Up @@ -308,5 +308,4 @@ Magistrala IoT Platform
| users.passwordRegex | string | `"^.{8,}$"` | |
| users.secretKey | string | `"secretKey"` | |
| users.tokenResetEndpoint | string | `"/reset-request"` | |
| vault.enabled | bool | `false` | |

| vault.enabled | bool | `false` | |
15 changes: 15 additions & 0 deletions charts/magistrala/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ template "chart.header" . }}

{{ template "chart.description" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line.