Skip to content

Commit

Permalink
support deployment and svc disable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 23, 2023
1 parent 9805e2d commit 4463f70
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/eurofurence-registration-system/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: eurofurence-registration-system
version: 0.0.11
version: 0.0.12
description: A helm chart that can deploy the Eurofurence Registration System.
type: application
home: https://github.com/eurofurence/reg-helm-chart
14 changes: 14 additions & 0 deletions charts/eurofurence-registration-system/templates/deployments.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.system.components.attendee_service.enable }}
{{ $attSrvInput := dict "name" "attendee-service"
"all" .Values
"component" .Values.system.components.attendee_service
Expand All @@ -6,6 +7,8 @@
"args" (list "--config=/config/config.yaml" "--migrate-database" "--ecs-json-logging") -}}
{{- template "helpers.deployment" $attSrvInput }}
---
{{- end }}
{{- if .Values.system.components.auth_service.enable }}
{{ $authSrvInput := dict "name" "auth-service"
"all" .Values
"component" .Values.system.components.auth_service
Expand All @@ -14,6 +17,8 @@
"args" (list "--config=/config/config.yaml" "--ecs-json-logging") -}}
{{- template "helpers.deployment" $authSrvInput }}
---
{{- end }}
{{- if .Values.system.components.mail_service.enable }}
{{ $mailSrvInput := dict "name" "mail-service"
"all" .Values
"component" .Values.system.components.mail_service
Expand All @@ -22,6 +27,8 @@
"args" (list "--config=/config/config.yaml" "--migrate-database" "--ecs-json-logging") -}}
{{- template "helpers.deployment" $mailSrvInput }}
---
{{- end }}
{{- if .Values.system.components.payment_cncrd_adapter.enable }}
{{ $cncrdAdapterInput := dict "name" "payment-cncrd-adapter"
"all" .Values
"component" .Values.system.components.payment_cncrd_adapter
Expand All @@ -30,6 +37,8 @@
"args" (list "--config=/config/config.yaml" "--migrate-database" "--ecs-json-logging") -}}
{{- template "helpers.deployment" $cncrdAdapterInput }}
---
{{- end }}
{{- if .Values.system.components.payment_service.enable }}
{{ $paySrvInput := dict "name" "payment-service"
"all" .Values
"component" .Values.system.components.payment_service
Expand All @@ -38,6 +47,8 @@
"args" (list "--config=/config/config.yaml" "--migrate-database" "--ecs-json-logging") -}}
{{- template "helpers.deployment" $paySrvInput }}
---
{{- end }}
{{- if .Values.system.components.regsys_classic.enable }}
{{ $classicInput := dict "name" "regsys-classic"
"all" .Values
"component" .Values.system.components.regsys_classic
Expand All @@ -46,6 +57,8 @@
"args" (list "-jar" "/app/regsys-classic.jar") -}}
{{- template "helpers.deployment" $classicInput }}
---
{{- end }}
{{- if .Values.system.components.frontend.enable }}
{{ $frontendInput := dict "name" "frontend"
"all" .Values
"component" .Values.system.components.frontend
Expand All @@ -54,3 +67,4 @@
"args" (list "-f" "/etc/apache2/regsys.conf" "-DNO_DETACH" "-DFOREGROUND")
"volume" "no" -}}
{{- template "helpers.deployment" $frontendInput }}
{{- end }}
14 changes: 14 additions & 0 deletions charts/eurofurence-registration-system/templates/services.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
{{- if .Values.system.components.attendee_service.enable }}
{{ $attSrvInput := dict "name" "attendee-service"
"all" .Values
"component" .Values.system.components.attendee_service -}}
{{- template "helpers.service" $attSrvInput }}
---
{{- end }}
{{- if .Values.system.components.auth_service.enable }}
{{ $authSrvInput := dict "name" "auth-service"
"all" .Values
"component" .Values.system.components.auth_service -}}
{{- template "helpers.service" $authSrvInput }}
---
{{- end }}
{{- if .Values.system.components.mail_service.enable }}
{{ $mailSrvInput := dict "name" "mail-service"
"all" .Values
"component" .Values.system.components.mail_service -}}
{{- template "helpers.service" $mailSrvInput }}
---
{{- end }}
{{- if .Values.system.components.payment_cncrd_adapter.enable }}
{{ $cncrdAdapterInput := dict "name" "payment-cncrd-adapter"
"all" .Values
"component" .Values.system.components.payment_cncrd_adapter -}}
{{- template "helpers.service" $cncrdAdapterInput }}
---
{{- end }}
{{- if .Values.system.components.payment_service.enable }}
{{ $paySrvInput := dict "name" "payment-service"
"all" .Values
"component" .Values.system.components.payment_service -}}
{{- template "helpers.service" $paySrvInput }}
---
{{- end }}
{{- if .Values.system.components.regsys_classic.enable }}
{{ $classicInput := dict "name" "regsys-classic"
"all" .Values
"component" .Values.system.components.regsys_classic -}}
{{- template "helpers.service" $classicInput }}
---
{{- end }}
{{- if .Values.system.components.frontend.enable }}
{{ $frontendInput := dict "name" "frontend"
"all" .Values
"component" .Values.system.components.frontend -}}
{{- template "helpers.service" $frontendInput }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,45 @@ suite: test deployments
templates:
- deployments.yaml
tests:
- it: should create expected deployments minimal
- it: should create no deployments if all disabled
set:
system:
components:
attendee_service:
enable: false
auth_service:
enable: false
mail_service:
enable: false
payment_cncrd_adapter:
enable: false
payment_service:
enable: false
regsys_classic:
enable: false
frontend:
enable: false
asserts:
- hasDocuments:
count: 0
- it: should create all deployments minimal
set:
system:
components:
attendee_service:
enable: true
auth_service:
enable: true
mail_service:
enable: true
payment_cncrd_adapter:
enable: true
payment_service:
enable: true
regsys_classic:
enable: true
frontend:
enable: true
asserts:
- isKind:
of: Deployment
Expand Down
40 changes: 39 additions & 1 deletion charts/eurofurence-registration-system/tests/services_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,45 @@ suite: test services
templates:
- services.yaml
tests:
- it: should create expected services all defaults
- it: should create no services if all disabled
set:
system:
components:
attendee_service:
enable: false
auth_service:
enable: false
mail_service:
enable: false
payment_cncrd_adapter:
enable: false
payment_service:
enable: false
regsys_classic:
enable: false
frontend:
enable: false
asserts:
- hasDocuments:
count: 0
- it: should create expected services all enabled
set:
system:
components:
attendee_service:
enable: true
auth_service:
enable: true
mail_service:
enable: true
payment_cncrd_adapter:
enable: true
payment_service:
enable: true
regsys_classic:
enable: true
frontend:
enable: true
asserts:
- isKind:
of: Service
Expand Down

0 comments on commit 4463f70

Please sign in to comment.