apiVersion: batch/v1
kind: CronJob
metadata:
  name: cron
spec:
  concurrencyPolicy: Forbid
  schedule: "0 21 * * *"
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            parent: "cronjobtranslate"
        spec:
          containers:
          - name: translate
            image: image-registry.openshift-image-registry.svc:5000/docstranslation/builder:latest
            args: 
            - "--clone_sources"
            - "--commit_l10n"
            - "--commit_tsources"
{%          if env == 'staging' %}
            - "--nopush"
{%          endif %}
            env: []
            volumeMounts: 
            - name: ssh-config-volume
              mountPath: /workspace/.ssh
              readOnly: true
            - name: mail-config-volume
              mountPath: /workspace/config.ini
              subPath: config.ini
              readOnly: true
          restartPolicy: Never
          startingDeadlineSeconds: 600
          volumes: 
          - name: ssh-config-volume
            secret:
              secretName: ssh-config
          - name: mail-config-volume
            configMap:
              name: mail-config
