Skip to content

Commit 96f3868

Browse files
committed
chore: Basic kind testing
1 parent e1cc26c commit 96f3868

File tree

8 files changed

+55
-505
lines changed

8 files changed

+55
-505
lines changed

.ct.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ debug: true
44
target-branch: main
55
check-version-increment: false
66
validate-maintainers: false
7+
helm-extra-args: -f chart/ci/values.yaml

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ max_line_length = 140
1313

1414
[*.md]
1515
trim_trailing_whitespace = false
16+
17+
[*.yml,*.yaml]
18+
quote_type = single

.github/workflows/workflow.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ on:
88
- develop
99

1010
jobs:
11-
1211
chart:
1312
name: 'Build and Test Helm Chart'
1413
runs-on: ubuntu-latest
1514

1615
steps:
17-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
1816
- uses: actions/checkout@v4
1917
with:
2018
fetch-depth: 0
@@ -24,6 +22,8 @@ jobs:
2422
with:
2523
version: v3.11.2
2624

25+
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
26+
# yamllint (https://github.com/adrienverge/yamllint) which require Python
2727
- uses: actions/setup-python@v5
2828
with:
2929
python-version: '3.9'
@@ -32,22 +32,26 @@ jobs:
3232
- name: Helm Chart Testing
3333
uses: helm/chart-testing-action@v2.6.1
3434

35+
- name: Helm Setup
36+
run: |
37+
helm repo add bitnami https://charts.bitnami.com/bitnami
38+
3539
- name: Run chart-testing (list-changed)
3640
id: list-changed
3741
run: |
38-
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
42+
changed=$(ct list-changed --config .ct.yaml --target-branch ${{ github.event.repository.default_branch }})
3943
if [[ -n "$changed" ]]; then
4044
echo "changed=true" >> "$GITHUB_OUTPUT"
4145
fi
4246
4347
- name: Run chart-testing (lint)
4448
if: steps.list-changed.outputs.changed == 'true'
45-
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
49+
run: ct lint --config .ct.yaml --target-branch ${{ github.event.repository.default_branch }}
4650

4751
- name: Create kind cluster
4852
if: steps.list-changed.outputs.changed == 'true'
4953
uses: helm/kind-action@v1.10.0
5054

5155
- name: Run chart-testing (install)
5256
if: steps.list-changed.outputs.changed == 'true'
53-
run: ct install --target-branch ${{ github.event.repository.default_branch }}
57+
run: ct install --config .ct.yaml --target-branch ${{ github.event.repository.default_branch }}

chart/ci/values.yaml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
1-
postgresql:
2-
config:
3-
dbName: automatisch
4-
auth:
5-
password: admin
1+
2+
global:
3+
storageClass: longhorn-fast
4+
accessMode: ReadWriteMany
5+
persistence:
6+
volumeSize: 1Gi
7+
ingress:
8+
enabled: true
9+
hostname: automatisch-test.m13t.de
10+
className: traefik
11+
annotations:
12+
kubernetes.io/tls-acme: "true"
13+
cert-manager.io/cluster-issuer: ca-issuer
14+
tls:
15+
secretName: automatisch-tls
616
app:
717
credentials:
818
ENCRYPTION_KEY: "123"
919
WEBHOOK_SECRET_KEY: "123"
10-
APP_SECRET_KEY: "123"
20+
APP_SECRET_KEY: "123"
21+
postgresql:
22+
auth:
23+
dbName: automatisch
24+
password: admin
25+
postgresPassword: admin
26+
primary:
27+
livenessProbe:
28+
enabled: true
29+
initialDelaySeconds: 60
30+
periodSeconds: 10
31+
timeoutSeconds: 5
32+
# on setup only!
33+
failureThreshold: 30
34+
successThreshold: 1
35+
readinessProbe:
36+
enabled: true
37+
initialDelaySeconds: 30
38+
periodSeconds: 10
39+
timeoutSeconds: 5
40+
# on setup only!
41+
failureThreshold: 20
42+
successThreshold: 1

chart/templates/deployment-app.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ spec:
4949
- name: PORT
5050
value: "3000"
5151
- name: HOST
52-
valueFrom:
53-
fieldRef:
54-
fieldPath: status.podIP
52+
value: "localhost"
5553
{{- include "ah.envValues" . | nindent 12 }}
5654
ports:
5755
- name: ah-tcp

chart/templates/secret-app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ stringData:
99
{{ include "ah.camelcase" $k }}: {{ $v | quote }}
1010
{{- end }}
1111
dbHost: "{{ include "ah.fullname" . }}-postgresql"
12-
dbName: "{{ .Values.postgresql.config.dbName }}"
12+
dbName: "{{ .Values.postgresql.auth.database }}"
1313
dbUser: "{{ .Values.postgresql.auth.username }}"
1414
dbPassword: "{{ .Values.postgresql.auth.password }}"

chart/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Default values for ah.
1+
# Default values for Automatisch chart.
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44
global:
55
storageClass:
66
accessMode: ReadWriteOnce
7-
replicaCount: 1
7+
replicaCount: 2
88
# -- Update policy
99
updateStrategy: "RollingUpdate"
1010
image:

0 commit comments

Comments
 (0)