Add db-migrations-job, not working yet

This commit is contained in:
mattwr18 2020-01-30 15:50:51 +01:00
parent a74abbb053
commit c3548e5d8d
2 changed files with 23 additions and 4 deletions

View File

@ -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

View File

@ -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