Skip to content

Commit 5385a83

Browse files
authored
Merge pull request #19 from diggerhq/feat/custom-env-vars
feat/custom env vars
2 parents da0b685 + f9c9709 commit 5385a83

File tree

6 files changed

+63
-2
lines changed

6 files changed

+63
-2
lines changed

.github/workflows/helm-test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Helm Unit Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/**'
7+
- '.github/workflows/helm-test.yml'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Install Helm
17+
uses: azure/setup-helm@v3
18+
with:
19+
version: v3.12.3
20+
21+
- name: Install Helm unittest plugin
22+
run: |
23+
helm plugin install https://github.com/quintush/helm-unittest
24+
25+
- name: Run Helm unit tests
26+
run: |
27+
for chart in charts/*/; do
28+
if [ -d "$chart" ]; then
29+
echo "Testing chart: $chart"
30+
helm unittest $chart
31+
fi
32+
done

charts/digger-backend/.helmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
.idea/
2222
*.tmproj
2323
.vscode/
24+
tests/

charts/digger-backend/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.8
18+
version: 0.1.9
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "v0.6.44"
24+
appVersion: "v0.6.101"

charts/digger-backend/templates/backend-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ spec:
6565
{{- end }}
6666
- name: ALLOW_DIRTY
6767
value: "{{ .Values.digger.postgres.allow_dirty }}"
68+
{{- with .Values.digger.customEnv }}
69+
{{- toYaml . | nindent 8 }}
70+
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# digger/tests/deployment_test.yaml
2+
suite: Test customEnv injection
3+
templates:
4+
- templates/backend-deployment.yaml
5+
tests:
6+
- it: should include customEnv environment variable
7+
set:
8+
digger.customEnv:
9+
- name: TEST_ENV
10+
value: test-value
11+
asserts:
12+
- contains:
13+
path: spec.template.spec.containers[0].env
14+
content:
15+
name: TEST_ENV
16+
value: test-value

charts/digger-backend/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ digger:
88
repository: registry.digger.dev/diggerhq/digger_backend
99
tag: "v0.6.44"
1010

11+
# Custom environment variables to be added to the backend deployment
12+
# Format:
13+
# customEnv:
14+
# - name: MY_CUSTOM_ENV
15+
# value: "my-value"
16+
# - name: ANOTHER_ENV
17+
# value: "another-value"
18+
customEnv: []
19+
1120
# livenessProbe and startupProbe settings
1221
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
1322

0 commit comments

Comments
 (0)