Skip to content

Commit 585ec3b

Browse files
authored
MG-140 - Create HELM repo with GitHub or any with other provider (#142)
* feat: Add helm chart release workflow Signed-off-by: JeffMboya <[email protected]> feat: Add helm chart release workflow Signed-off-by: JeffMboya <[email protected]> * feat: Package MG helm chart Signed-off-by: JeffMboya <[email protected]> * feat: Add index.yaml file Signed-off-by: JeffMboya <[email protected]> * feat:Update helm chart-releaser-action to v1.6.0 Signed-off-by: JeffMboya <[email protected]> * feat: Add spaces 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 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 and test workflow for Helm charts Signed-off-by: JeffMboya <[email protected]> * feat: Update README Signed-off-by: JeffMboya <[email protected]> * feat: Add lint-test and reusable workflow Signed-off-by: JeffMboya <[email protected]> * Feat: Add inedx.yml Signed-off-by: JeffMboya <[email protected]> * Feat: restructure chart directory Signed-off-by: JeffMboya <[email protected]> * Feat: Update README Signed-off-by: JeffMboya <[email protected]> * Feat: Run release workflow on all branches Signed-off-by: JeffMboya <[email protected]> * Feat: Update README Signed-off-by: JeffMboya <[email protected]> * Feat: Update release.yaml Signed-off-by: JeffMboya <[email protected]> * Feat: Update chart version Signed-off-by: JeffMboya <[email protected]> * Feat: Update chart path Signed-off-by: JeffMboya <[email protected]> * Feat: Update chart path Signed-off-by: JeffMboya <[email protected]> * Feat: Update chart path Signed-off-by: JeffMboya <[email protected]> * Delete magistrala-charts dir Signed-off-by: JeffMboya <[email protected]> * rename common workflow Signed-off-by: JeffMboya <[email protected]> * Remove common workflow Signed-off-by: JeffMboya <[email protected]> * remove charts_dir and config parameters from release.yaml Signed-off-by: JeffMboya <[email protected]> * delete cr.yml file Signed-off-by: JeffMboya <[email protected]> --------- Signed-off-by: JeffMboya <[email protected]>
1 parent 72c72e7 commit 585ec3b

File tree

5 files changed

+142
-7
lines changed

5 files changed

+142
-7
lines changed

.github/workflows/lint-test.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright (c) Magistrala
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Lint and Test Charts
5+
6+
on: pull_request
7+
8+
jobs:
9+
lint-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set up Helm
18+
uses: azure/[email protected]
19+
with:
20+
version: v3.15.4
21+
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.x"
25+
check-latest: true
26+
27+
- name: Set up chart-testing
28+
uses: helm/[email protected]
29+
30+
- name: Run chart-testing (list-changed)
31+
id: list-changed
32+
run: |
33+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
34+
if [[ -n "$changed" ]]; then
35+
echo "changed=true" >> "$GITHUB_OUTPUT"
36+
fi
37+
38+
- name: Run chart-testing (lint)
39+
if: steps.list-changed.outputs.changed == 'true'
40+
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
41+
42+
- name: Create kind cluster
43+
if: steps.list-changed.outputs.changed == 'true'
44+
uses: helm/[email protected]
45+
46+
- name: Run chart-testing (install)
47+
if: steps.list-changed.outputs.changed == 'true'
48+
run: ct install --target-branch ${{ github.event.repository.default_branch }}

.github/workflows/release.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) Magistrala
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Release Charts
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
release:
13+
permissions:
14+
contents: write
15+
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Configure Git
24+
run: |
25+
git config user.name "$GITHUB_ACTOR"
26+
git config user.email "[email protected]"
27+
28+
- name: Set up Helm
29+
uses: azure/[email protected]
30+
with:
31+
version: v3.15.4
32+
33+
- name: Add Dependencies
34+
run: |
35+
helm repo add stable https://charts.helm.sh/stable
36+
helm repo add bitnami https://charts.bitnami.com/bitnami
37+
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
38+
helm repo add hashicorp https://helm.releases.hashicorp.com
39+
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
40+
helm repo update
41+
42+
- name: Run chart-releaser
43+
uses: helm/[email protected]
44+
env:
45+
CR_TOKEN: "${{ secrets.HELM_RELEASE_TOKEN }}"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## DevOps
22

3-
DevOps scripts for Magistrala IoT platform.
3+
DevOps scripts for Magistrala IoT platform
44

55
## Install
66

charts/magistrala/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ name: magistrala
66
description: Magistrala IoT Platform
77
icon: https://avatars1.githubusercontent.com/u/13207490
88
type: application
9-
version: 1.0.3
10-
appVersion: "0.12.1"
9+
version: 1.0.4 # Incremented chart version if the chart is updated
10+
appVersion: "0.12.2" # Update application version if the app is updated
1111
home: https://abstractmachines.fr/magistrala.html
1212
sources:
1313
- https://hub.docker.com/u/magistrala

charts/magistrala/README.md

+46-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Magistrala Helm Chart
22

3-
Helm Chart for the Magistrala IoT Platform
3+
Helm Chart for the Magistrala IoT Platform.
44

55
## Prerequisites
66

@@ -16,6 +16,48 @@ Helm Chart for the Magistrala IoT Platform
1616
- Certificate/Key installed as**TLS secret**
1717
- Intermediate certificate installed as**Generic secret**
1818

19+
## Adding the Helm Repository
20+
21+
The Helm charts are published via GitHub Pages. To add the repository to your Helm configuration, run the following command:
22+
23+
```bash
24+
helm repo add devops-charts https://absmach.github.io/devops/
25+
```
26+
27+
Update your local Helm repository cache to fetch the latest charts:
28+
29+
```bash
30+
helm repo update
31+
```
32+
33+
## Installing the Chart
34+
35+
Once the repository is added, you can install the chart using Helm. Replace `<release-name>` with your desired release name:
36+
37+
```bash
38+
helm install <release-name> devops-charts/magistrala
39+
```
40+
41+
This command will install the `magistrala` chart from the GitHub Pages-hosted Helm repository.
42+
43+
## Upgrading the Chart
44+
45+
To upgrade the chart with a new version or updated configuration, use the following command:
46+
47+
```bash
48+
helm upgrade <release-name> devops-charts/magistrala
49+
```
50+
51+
This ensures that your deployment uses the latest version of the chart while retaining any custom configurations.
52+
53+
## Uninstalling the Chart
54+
55+
To uninstall the chart and release, run:
56+
57+
```bash
58+
helm uninstall <release-name>
59+
```
60+
1961
## Configuration
2062

2163
The following table lists the configurable parameters and their default values.
@@ -145,7 +187,7 @@ The following table lists the configurable parameters and their default values.
145187
| influxdb.writer.httpPort | InfluxDB writer HTTP port | 9006 |
146188
| influxdb.reader.httpPort | InfluxDB reader HTTP port | 9005 |
147189
| influxdb.backup.enabled | Enable InfluxDB backup | false |
148-
| influxdb.backup.cronjob.schedule | Crontab style time schedule for backup execution | "0 2 * * *" |
190+
| influxdb.backup.cronjob.schedule | Crontab style time schedule for backup execution | "0 2 \* \* \*" |
149191
| adapter_opcua.enabled | Enable OPC-UA adapter | false |
150192
| adapter_opcua.httpPort | OPC-UA adapter HTTP port | 8188 |
151193
| adapter_opcua.redisRouteMapPort | OPC-UA adapter Redis Auth Cache port | 6379 |
@@ -160,8 +202,8 @@ The following table lists the configurable parameters and their default values.
160202
| notifier_smtp.enabled | Enable SMTP notifier | false |
161203
| notifier_smtp.emailHost | SMTP host | false |
162204
| notifier_smtp.smtpPort | SMTP port | false |
163-
| notifier_smtp.fromName | SMTP notifier `from` name | false |
164-
| notifier_smtp.fromEmail | SMTP `from` email address | false |
205+
| notifier_smtp.fromName | SMTP notifier `from` name | false |
206+
| notifier_smtp.fromEmail | SMTP `from` email address | false |
165207
| notifier_smtp.username | SMTP username | false |
166208
| notifier_smtp.password | SMTP password | false |
167209
| notifier_smtp.secret | SMTP secret | false |

0 commit comments

Comments
 (0)