diff --git a/osm-seed/templates/osmcha-app/cronJob.yaml b/osm-seed/templates/osmcha-app/cronJob.yaml index 3d1c25c8..acb11030 100644 --- a/osm-seed/templates/osmcha-app/cronJob.yaml +++ b/osm-seed/templates/osmcha-app/cronJob.yaml @@ -26,6 +26,42 @@ spec: - -c - | python manage.py fetchchangesets + envFrom: + - configMapRef: + name: {{ .Release.Name }}-osmcha-common-env + restartPolicy: Never + {{- if .Values.osmchaApi.nodeSelector.enabled }} + nodeSelector: + {{ .Values.osmchaApi.nodeSelector.label_key }} : {{ .Values.osmchaApi.nodeSelector.label_value }} + {{- end }} + +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ .Release.Name }}-osmcha-process-changesets-cronjob + labels: + app: {{ template "osm-seed.name" . }} + component: osmcha-app-deployment + environment: {{ .Values.environment }} + release: {{ .Release.Name }} +spec: + schedule: "0 * * * *" + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 2 + failedJobsHistoryLimit: 2 + jobTemplate: + spec: + template: + spec: + containers: + - name: {{ .Release.Name }}-osmcha-process-changesets + image: "{{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}" + imagePullPolicy: IfNotPresent + command: + - /bin/sh + - -c + - | python manage.py backfill_changesets $(date -d "yesterday" +%Y-%m-%d) $(date +%Y-%m-%d) envFrom: - configMapRef: