Skip to content

Commit

Permalink
Merge pull request #9 from librenms/testing
Browse files Browse the repository at this point in the history
Add testing for helm chart and lint cleanup
  • Loading branch information
jochbru authored Jul 9, 2024
2 parents 92baa22 + c608f26 commit 201961f
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 14 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/chart-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Lint and Test Charts

on: pull_request

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

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

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

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

- name: Add repositories
run: |
for dir in $(ls -d charts/*/); do
helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
done
- 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 }} --skip-clean-up
4 changes: 2 additions & 2 deletions charts/librenms/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies:
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 10.3.0
digest: sha256:7b8a3f1182b70837c842c8a9fe7c1fa913cadd6800f1f780f94c357af7fca21f
generated: "2024-07-05T12:50:36.211666249Z"
digest: sha256:f1e63eec3d96520ef7cd365ece9a281d57e48f811fd9e19d47baefa37fceee76
generated: "2024-07-09T11:51:38.284682+02:00"
9 changes: 6 additions & 3 deletions charts/librenms/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ apiVersion: v2
name: librenms
description: LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.
type: application
version: 3.10.0
version: 3.10.1
appVersion: "24.5.0"
maintainers:
- name: TheChef23
url: https://github.com/TheChef23
dependencies:
- name: redis
version: "~19.6.0"
repository: "https://charts.bitnami.com/bitnami"
when: redis.enabled == true
condition: redis.enabled
- name: mysql
version: "~10.3.0"
repository: "https://charts.bitnami.com/bitnami"
when: mysql.enabled == true
condition: mysql.enabled
2 changes: 2 additions & 0 deletions charts/librenms/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
librenms:
appkey: base64:RTMmh+i10E2RMcDxookMu47BTzJQy87hOU+k/zcuPnA=
16 changes: 7 additions & 9 deletions charts/librenms/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ librenms:
# Laravel appkey used by LibreNMS, a default is set for useability it is
# recommended to replace this with your own key
# THIS A REQUIRED SETTINGS
appkey:
appkey:

# Timezone used by librenms for communication with RRD cached
timezone: UTC
Expand All @@ -20,9 +20,7 @@ librenms:
configuration: |-
$config['distributed_poller_group'] = '0';
$config['distributed_poller'] = true;
# Frontend container configurations options
frontend:
replicas: 1
Expand All @@ -47,9 +45,9 @@ librenms:
# memory: 200M

# SNMP network discovery scanner cron job. This job is optional and only use
# when having snmp network discovery enabled. For this to work either set the
# when having snmp network discovery enabled. For this to work either set the
# 'nets' confifuration in the custom config on in the admin interface
# See the following link for more information:
# See the following link for more information:
# https://docs.librenms.org/Extensions/Auto-Discovery/
snmp_scanner:
enabled: false
Expand All @@ -65,7 +63,7 @@ librenms:
extraEnvs: {}

# RRD cached is the tool that allows for distributed polling and is mandatory
# in this LibreNMS helm chart. See the rrdcached documentation for more
# in this LibreNMS helm chart. See the rrdcached documentation for more
# information: https://oss.oetiker.ch/rrdtool/doc/rrdcached.en.html
rrdcached:
image:
Expand Down Expand Up @@ -97,15 +95,15 @@ librenms:
# Extra environment variable for RRDCACHED container
extraEnvs: {}

# Configuration for MySQL dependency chart by Bitnami. See their chart for
# Configuration for MySQL dependency chart by Bitnami. See their chart for
# more information: https://github.com/bitnami/charts/tree/master/bitnami/mysql
mysql:
enabled: true
auth:
username: librenms
database: librenms

# Configuration for redis dependency chart by Bitnami. See their chart for
# Configuration for redis dependency chart by Bitnami. See their chart for
# more information: https://github.com/bitnami/charts/tree/master/bitnami/redis
redis:
enabled: true
Expand All @@ -119,4 +117,4 @@ redis:
master:
disableCommands: []

architecture: standalone
architecture: standalone

0 comments on commit 201961f

Please sign in to comment.