Skip to content

Commit

Permalink
MG-140 - Create HELM repo with GitHub or any with other provider (#142)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
JeffMboya authored Sep 9, 2024
1 parent 72c72e7 commit 585ec3b
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 7 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) Magistrala
# SPDX-License-Identifier: Apache-2.0

name: Lint and Test Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.15.4

- uses: actions/setup-python@v5
with:
python-version: "3.x"
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright (c) Magistrala
# SPDX-License-Identifier: Apache-2.0

name: Release Charts

on:
push:
branches:
- main

jobs:
release:
permissions:
contents: write

runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.15.4

- 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/[email protected]
env:
CR_TOKEN: "${{ secrets.HELM_RELEASE_TOKEN }}"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DevOps

DevOps scripts for Magistrala IoT platform.
DevOps scripts for Magistrala IoT platform

## Install

Expand Down
4 changes: 2 additions & 2 deletions charts/magistrala/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name: magistrala
description: Magistrala IoT Platform
icon: https://avatars1.githubusercontent.com/u/13207490
type: application
version: 1.0.3
appVersion: "0.12.1"
version: 1.0.4 # Incremented chart version if the chart is updated
appVersion: "0.12.2" # Update application version if the app is updated
home: https://abstractmachines.fr/magistrala.html
sources:
- https://hub.docker.com/u/magistrala
Expand Down
50 changes: 46 additions & 4 deletions charts/magistrala/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Magistrala Helm Chart

Helm Chart for the Magistrala IoT Platform
Helm Chart for the Magistrala IoT Platform.

## Prerequisites

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

## Adding the Helm Repository

The Helm charts are published via GitHub Pages. To add the repository to your Helm configuration, run the following command:

```bash
helm repo add devops-charts https://absmach.github.io/devops/
```

Update your local Helm repository cache to fetch the latest charts:

```bash
helm repo update
```

## Installing the Chart

Once the repository is added, you can install the chart using Helm. Replace `<release-name>` with your desired release name:

```bash
helm install <release-name> devops-charts/magistrala
```

This command will install the `magistrala` chart from the GitHub Pages-hosted Helm repository.

## Upgrading the Chart

To upgrade the chart with a new version or updated configuration, use the following command:

```bash
helm upgrade <release-name> devops-charts/magistrala
```

This ensures that your deployment uses the latest version of the chart while retaining any custom configurations.

## Uninstalling the Chart

To uninstall the chart and release, run:

```bash
helm uninstall <release-name>
```

## Configuration

The following table lists the configurable parameters and their default values.
Expand Down Expand Up @@ -145,7 +187,7 @@ The following table lists the configurable parameters and their default values.
| influxdb.writer.httpPort | InfluxDB writer HTTP port | 9006 |
| influxdb.reader.httpPort | InfluxDB reader HTTP port | 9005 |
| influxdb.backup.enabled | Enable InfluxDB backup | false |
| influxdb.backup.cronjob.schedule | Crontab style time schedule for backup execution | "0 2 * * *" |
| influxdb.backup.cronjob.schedule | Crontab style time schedule for backup execution | "0 2 \* \* \*" |
| adapter_opcua.enabled | Enable OPC-UA adapter | false |
| adapter_opcua.httpPort | OPC-UA adapter HTTP port | 8188 |
| adapter_opcua.redisRouteMapPort | OPC-UA adapter Redis Auth Cache port | 6379 |
Expand All @@ -160,8 +202,8 @@ The following table lists the configurable parameters and their default values.
| notifier_smtp.enabled | Enable SMTP notifier | false |
| notifier_smtp.emailHost | SMTP host | false |
| notifier_smtp.smtpPort | SMTP port | false |
| notifier_smtp.fromName | SMTP notifier `from` name | false |
| notifier_smtp.fromEmail | SMTP `from` email address | false |
| notifier_smtp.fromName | SMTP notifier `from` name | false |
| notifier_smtp.fromEmail | SMTP `from` email address | false |
| notifier_smtp.username | SMTP username | false |
| notifier_smtp.password | SMTP password | false |
| notifier_smtp.secret | SMTP secret | false |
Expand Down

0 comments on commit 585ec3b

Please sign in to comment.