43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
---
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: {{ .Chart.Name }}-migrate
|
|
annotations:
|
|
"helm.sh/hook": post-install,post-upgrade
|
|
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
|
|
"helm.sh/hook-weight": "10"
|
|
spec:
|
|
ttlSecondsAfterFinished: 100
|
|
template:
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: regsecret
|
|
initContainers:
|
|
- name: wait-postgres
|
|
image: postgres:14-alpine
|
|
command:
|
|
- bash
|
|
- /wait.sh
|
|
volumeMounts:
|
|
- name: configs
|
|
mountPath: /wait.sh
|
|
subPath: wait.sh
|
|
env:
|
|
{{- include "envs_all" . | indent 12 }}
|
|
containers:
|
|
- name: run-migrations
|
|
image: {{ .Values.app.image }}
|
|
command: ["php", "yii", "migrate", "--interactive=0"]
|
|
env:
|
|
{{- include "envs_all" . | indent 12 }}
|
|
{{- include "jobs_resources" . | indent 10 }}
|
|
volumes:
|
|
- name: configs
|
|
configMap:
|
|
name: job-scripts
|
|
defaultMode: 420
|
|
restartPolicy: OnFailure
|
|
terminationGracePeriodSeconds: 5
|
|
backoffLimit: 6
|