apiVersion: batch/v1
kind: CronJob
metadata:
  name: cron-translated
spec:
  concurrencyPolicy: Forbid
  schedule: "0 23 * * *"
  startingDeadlineSeconds: 3600
  jobTemplate:
    spec:
      activeDeadlineSeconds: 86400
      template:
        metadata:
          labels:
            parent: "cronjobbuild"
        spec:
          containers:
          - name: build-translated
            image: image-registry.openshift-image-registry.svc:5000/docsbuilding/builder:latest
            env:
            - name: BUILD_ENV
              value: "{{ env_short }}"
            - name: BUILD_LANGS
              value: "translated"
            volumeMounts:
            - name: build-output
              mountPath: /antora/output
              readOnly: false
{%          if env == 'staging' %}
            - name: build-temp
              mountPath: /tmp
{%          endif %}
          restartPolicy: Never
          startingDeadlineSeconds: 600
          volumes:
          - name: build-output
            persistentVolumeClaim:
              claimName: docs-storage
{%        if env == 'staging' %}
          - name: build-temp
            emptyDir: {}
{%        endif %}
