Skip to content

Commit 004267e

Browse files
authored
MG-143 - Auto-generate Markdown documentation from Helm charts (#144)
* feat: Package MG helm chart Signed-off-by: JeffMboya <[email protected]> * feat: Add index.yaml file Signed-off-by: JeffMboya <[email protected]> * feat: remove index.yaml Signed-off-by: JeffMboya <[email protected]> * feat: add charts_dir Signed-off-by: JeffMboya <[email protected]> * feat: Add config file for helm chart-releaser-action Signed-off-by: JeffMboya <[email protected]> * feat: Add dependecies to release.yaml Signed-off-by: JeffMboya <[email protected]> * feat: Add lint-test and reusable workflow Signed-off-by: JeffMboya <[email protected]> * Feat: Add helm-docs.yaml Signed-off-by: JeffMboya <[email protected]> * fix CI Signed-off-by: JeffMboya <[email protected]> * remove unnecessary file Signed-off-by: JeffMboya <[email protected]> * fix CI Signed-off-by: JeffMboya <[email protected]> * Update workflow to point to master and all branches Signed-off-by: JeffMboya <[email protected]> * Update helm-docs workflow Signed-off-by: JeffMboya <[email protected]> * Update helm-docs workflow Signed-off-by: JeffMboya <[email protected]> * Update helm-docs workflow Signed-off-by: JeffMboya <[email protected]> * Update helm-docs workflow Signed-off-by: JeffMboya <[email protected]> * Update helm-docs workflow Signed-off-by: JeffMboya <[email protected]> * run on PR on all branches with norwoodj/helm-docs Signed-off-by: JeffMboya <[email protected]> * test norwoodj/helm-docs Signed-off-by: JeffMboya <[email protected]> * update README Signed-off-by: JeffMboya <[email protected]> * view CI logs Signed-off-by: JeffMboya <[email protected]> * view CI logs Signed-off-by: JeffMboya <[email protected]> * add README.md.gotmpl Signed-off-by: JeffMboya <[email protected]> * Update workflow to fail on diff Signed-off-by: JeffMboya <[email protected]> * Limit Helm docs to master Signed-off-by: JeffMboya <[email protected]> --------- Signed-off-by: JeffMboya <[email protected]>
1 parent fb44c46 commit 004267e

File tree

4 files changed

+62
-8
lines changed

4 files changed

+62
-8
lines changed

.github/workflows/helm-docs.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) Magistrala
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Generate Helm Docs
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
generate-docs:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
repository: ${{ github.repository }}
19+
ref: ${{ github.ref }}
20+
fetch-depth: 0
21+
22+
- name: Generate Helm Docs
23+
uses: losisin/[email protected]
24+
with:
25+
chart-search-root: "charts/magistrala"
26+
values-file: "values.yaml"
27+
output-file: "README.md"
28+
template-files: "README.md.gotmpl"
29+
git-push: false
30+
fail-on-diff: true

.github/workflows/release.yaml

+14-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ jobs:
1515

1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: Checkout Code
19-
uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 0
18+
- name: Call Common Steps
19+
uses: ./.github/workflows/common.yaml
2220

2321
- name: Configure Git
2422
run: |
@@ -43,7 +41,19 @@ jobs:
4341
run: |
4442
helm dependency update charts/magistrala
4543
44+
- name: Add Dependencies
45+
run: |
46+
helm repo add stable https://charts.helm.sh/stable
47+
helm repo add bitnami https://charts.bitnami.com/bitnami
48+
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
49+
helm repo add hashicorp https://helm.releases.hashicorp.com
50+
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
51+
helm repo update
52+
4653
- name: Run chart-releaser
4754
uses: helm/[email protected]
55+
with:
56+
charts_dir: charts/magistrala
57+
config: cr.yaml
4858
env:
4959
CR_TOKEN: "${{ secrets.HELM_RELEASE_TOKEN }}"

charts/magistrala/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# magistrala
22

3-
![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)
4-
53
Magistrala IoT Platform
64

5+
![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)
6+
77
**Homepage:** <https://abstractmachines.fr/magistrala.html>
88

99
## Maintainers
@@ -308,5 +308,4 @@ Magistrala IoT Platform
308308
| users.passwordRegex | string | `"^.{8,}$"` | |
309309
| users.secretKey | string | `"secretKey"` | |
310310
| users.tokenResetEndpoint | string | `"/reset-request"` | |
311-
| vault.enabled | bool | `false` | |
312-
311+
| vault.enabled | bool | `false` | |

charts/magistrala/README.md.gotmpl

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{ template "chart.header" . }}
2+
3+
{{ template "chart.description" . }}
4+
5+
{{ template "chart.badgesSection" . }}
6+
7+
{{ template "chart.homepageLine" . }}
8+
9+
{{ template "chart.maintainersSection" . }}
10+
11+
{{ template "chart.sourcesSection" . }}
12+
13+
{{ template "chart.requirementsSection" . }}
14+
15+
{{ template "chart.valuesSection" . }}

0 commit comments

Comments
 (0)