diff --git a/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml b/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml index 68d582d41..555c1fee8 100644 --- a/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml +++ b/deployment/helm/human-connection/templates/deployments/deployment-backend.yaml @@ -26,10 +26,6 @@ spec: - name: backend image: humanconnection/nitro-backend:latest imagePullPolicy: {{ .Values.image.pullPolicy }} - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "{{ .Values.application.initializeCommand }}", "&&", "{{ .Values.application.migrationsCommand }}"] envFrom: - configMapRef: name: {{ .Release.Name }}-configmap diff --git a/deployment/helm/human-connection/templates/jobs/db-migration.yaml b/deployment/helm/human-connection/templates/jobs/db-migration.yaml new file mode 100644 index 000000000..a8cb2aaf7 --- /dev/null +++ b/deployment/helm/human-connection/templates/jobs/db-migration.yaml @@ -0,0 +1,23 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ .Release.Name }}-db-migrations + annotations: + "helm.sh/hook": post-upgrade + "helm.sh/hook-weight": "0" + "helm.sh/hook-delete-policy": hook-succeeded, hook-failed +spec: + template: + metadata: + name: {{ .Release.Name }} + spec: + restartPolicy: Never + containers: + - name: db-migrations-job + image: humanconnection/nitro-backend:latest + command: ["/bin/sh", "-c", "{{ .Values.application.migrationsCommand }}"] + envFrom: + - configMapRef: + name: {{ .Release.Name }}-configmap + - secretRef: + name: {{ .Release.Name }}-secrets \ No newline at end of file