Skip to content

Commit 0f66f79

Browse files
committed
chore: Basic kind testing
1 parent e1cc26c commit 0f66f79

File tree

8 files changed

+53
-505
lines changed

8 files changed

+53
-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 ci/value.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: 7 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
@@ -32,22 +30,26 @@ jobs:
3230
- name: Helm Chart Testing
3331
uses: helm/chart-testing-action@v2.6.1
3432

33+
- name: Helm Setup
34+
run: |
35+
helm repo add bitnami https://charts.bitnami.com/bitnami
36+
3537
- name: Run chart-testing (list-changed)
3638
id: list-changed
3739
run: |
38-
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
40+
changed=$(ct list-changed --config .ct.yaml --target-branch ${{ github.event.repository.default_branch }})
3941
if [[ -n "$changed" ]]; then
4042
echo "changed=true" >> "$GITHUB_OUTPUT"
4143
fi
4244
4345
- name: Run chart-testing (lint)
4446
if: steps.list-changed.outputs.changed == 'true'
45-
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
47+
run: ct lint --config .ct.yaml --target-branch ${{ github.event.repository.default_branch }}
4648

4749
- name: Create kind cluster
4850
if: steps.list-changed.outputs.changed == 'true'
4951
uses: helm/kind-action@v1.10.0
5052

5153
- name: Run chart-testing (install)
5254
if: steps.list-changed.outputs.changed == 'true'
53-
run: ct install --target-branch ${{ github.event.repository.default_branch }}
55+
run: ct install --config .ct.yaml --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--create-namespace --namespace test"

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)