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-140 - Create HELM repo with GitHub or any with other provider #142

Merged
merged 28 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f08b047
feat: Add helm chart release workflow
JeffMboya Sep 3, 2024
2557d29
feat: Package MG helm chart
JeffMboya Sep 3, 2024
86b8198
feat: Add index.yaml file
JeffMboya Sep 3, 2024
c19aad7
feat:Update helm chart-releaser-action to v1.6.0
JeffMboya Sep 3, 2024
953561d
feat: Add spaces
JeffMboya Sep 3, 2024
c9ac6f7
feat: remove index.yaml
JeffMboya Sep 3, 2024
9c84505
feat: add charts_dir
JeffMboya Sep 3, 2024
e9df314
feat: Add config file for helm chart-releaser-action
JeffMboya Sep 3, 2024
b7ade03
feat: Add config file for helm chart-releaser-action
JeffMboya Sep 3, 2024
f4acb02
feat: Add dependecies to release.yaml
JeffMboya Sep 4, 2024
0a2dc88
feat: Add lint and test workflow for Helm charts
JeffMboya Sep 4, 2024
8fdc66a
feat: Update README
JeffMboya Sep 4, 2024
2de9330
feat: Add lint-test and reusable workflow
JeffMboya Sep 5, 2024
efcebde
Feat: Add inedx.yml
JeffMboya Sep 9, 2024
5a422f1
Feat: restructure chart directory
JeffMboya Sep 9, 2024
7330367
Feat: Update README
JeffMboya Sep 9, 2024
05a42df
Feat: Run release workflow on all branches
JeffMboya Sep 9, 2024
fb30b04
Feat: Update README
JeffMboya Sep 9, 2024
c1242fd
Feat: Update release.yaml
JeffMboya Sep 9, 2024
b30de2d
Feat: Update chart version
JeffMboya Sep 9, 2024
9b3c020
Feat: Update chart path
JeffMboya Sep 9, 2024
c1a4cc2
Feat: Update chart path
JeffMboya Sep 9, 2024
9a6da07
Feat: Update chart path
JeffMboya Sep 9, 2024
3c65d86
Delete magistrala-charts dir
JeffMboya Sep 9, 2024
f56e6af
rename common workflow
JeffMboya Sep 9, 2024
7e7ee5c
Remove common workflow
JeffMboya Sep 9, 2024
daa1796
remove charts_dir and config parameters from release.yaml
JeffMboya Sep 9, 2024
8ef329b
delete cr.yml file
JeffMboya Sep 9, 2024
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
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