fix(dispatch): tweaks to get initial deployment working

This commit is contained in:
Tommy 2024-09-25 17:45:32 +02:00
parent 67ba9898b9
commit f172764722
Signed by: tommy
SSH key fingerprint: SHA256:1LWgQT3QPHIT29plS8jjXc3S1FcE/4oGvsx3Efxs6Uc
2 changed files with 31 additions and 7 deletions

View file

@ -15,12 +15,6 @@ spec:
labels:
app: {{ include "dispatch.fullname" . }}-core
spec:
initContainers:
- name: db-init
image: "{{ .Values.initContainers.dbInit.image.registry }}:{{ .Values.initContainers.dbInit.image.tag }}"
envFrom:
- secretRef:
name: {{ .Values.postgres.secretName }}
{{ if ne .Values.image.pullSecret "" }}
imagePullSecrets:
- name: "{{ .Values.image.pullSecret }}"

View file

@ -26,7 +26,37 @@ spec:
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "database", "init"]
command:
- /bin/sh
- -c
- |
dispatch database init || true
env: &dispatchEnv
- name: MJML_PATH
value: /node_modules/.bin
- name: DISPATCH_UI_URL
value: "{{ .Values.url }}"
- name: DATABASE_HOSTNAME
value: "{{ .Values.postgres.hostname }}"
- name: DATABASE_PORT
value: "{{ .Values.postgres.port }}"
- name: DATABASE_NAME
value: "{{ .Values.postgres.database_name }}"
{{ if eq .Values.authentication.provider_slug "dispatch-auth-provider-header" }}
- name: DISPATCH_AUTHENTICATION_PROVIDER_SLUG
value: "{{ .Values.authentication.provider_slug }}"
- name: DISPATCH_AUTHENTICATION_PROVIDER_HEADER_NAME
value: "{{ .Values.authentication.header.header_name }}"
{{ end }}
envFrom:
- secretRef:
name: {{ .Values.envFromSecret }}
- name: dispatch-db-upgrade
{{- with .Values.image }}
image: "{{ coalesce $.Values.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.image.pullPolicy .pullPolicy }}
{{- end }}
command: ["dispatch", "database", "upgrade"]
env: &dispatchEnv
- name: MJML_PATH
value: /node_modules/.bin