Add cronjob
This commit is contained in:
parent
0a3329b9b6
commit
2d636f592a
1 changed files with 156 additions and 0 deletions
156
helm/chart/templates/cronjob-fixture-reset.yaml
Normal file
156
helm/chart/templates/cronjob-fixture-reset.yaml
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
{{- if .Values.dailyCronjobs.enabled }}
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: {{ include "plateformcoop-ebs" . }}-fixture-reset
|
||||
labels:
|
||||
{{- include "plateformcoop-ebs.labels" . | nindent 4 }}
|
||||
spec:
|
||||
schedule: '0 0 * * *'
|
||||
jobTemplate:
|
||||
metadata:
|
||||
annotations:
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
labels:
|
||||
{{- include "plateformcoop-ebs.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "plateformcoop-ebs.serviceAccountName" . }}
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-cronjob-notify-ms-e-7
|
||||
image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.php.image.pullPolicy }}
|
||||
command: ['/bin/sh', '-c']
|
||||
args: ['
|
||||
bin/console doctrine:database:drop --if-exists --force;
|
||||
bin/console doctrine:database:create --if-not-exists;
|
||||
bin/console doctrine:schema:create;
|
||||
bin/console doctrine:schema:validate;
|
||||
bin/console messenger:setup-transports;
|
||||
bin/console hautelook:fixtures:load --no-interaction -vv --no-bundles;
|
||||
bin/console app:index-products;
|
||||
']
|
||||
env:
|
||||
- name: API_ENTRYPOINT_HOST
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-host
|
||||
- name: JWT_PASSPHRASE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-jwt-passphrase
|
||||
- name: JWT_PUBLIC_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-jwt-public-key
|
||||
- name: JWT_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-jwt-secret-key
|
||||
- name: TRUSTED_HOSTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-trusted-hosts
|
||||
- name: TRUSTED_PROXIES
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-trusted-proxies
|
||||
- name: APP_ENV
|
||||
value: "prod"
|
||||
- name: APP_DEBUG
|
||||
value: "0"
|
||||
- name: APP_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-app-secret
|
||||
- name: CORS_ALLOW_ORIGIN
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-cors-allow-origin
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: database-url
|
||||
- name: MERCURE_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: mercure-url
|
||||
- name: MERCURE_PUBLIC_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: mercure-public-url
|
||||
- name: MERCURE_JWT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: mercure-jwt-secret
|
||||
- name: STORAGE_BUCKET
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-storage-bucket
|
||||
- name: STORAGE_ENDPOINT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-storage-endpoint
|
||||
- name: STORAGE_REGION
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-storage-region
|
||||
- name: STORAGE_USE_PATH_STYLE_ENDPOINT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-storage-use-path-style-endpoint
|
||||
- name: STORAGE_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-storage-key
|
||||
- name: STORAGE_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "plateformcoop-ebs" . }}
|
||||
key: php-storage-secret
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command: ["/bin/sh", "-c", "/bin/sleep 1; kill -QUIT 1"]
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- docker-healthcheck
|
||||
failureThreshold: 40
|
||||
periodSeconds: 3
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- docker-healthcheck
|
||||
periodSeconds: 3
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- docker-healthcheck
|
||||
periodSeconds: 3
|
||||
resources:
|
||||
{{- toYaml .Values.resources.fixtures | nindent 16 }}
|
||||
{{- end }}
|
||||
Loading…
Reference in a new issue