---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: cron-github
spec:
  schedule: "0 */1 * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: github
              image: quay.io/oshoval/github:latest
              command:
                - /bin/sh
                - -ce
                - |
                  source /app/secret.txt
                  git clone https://github.com/oshoval/github2jira.git
                  ./github2jira/main.py
              volumeMounts:
                - name: configs
                  mountPath: /app/secret.txt
                  subPath: secret.txt
          restartPolicy: Never
          volumes:
            - name: configs
              configMap:
                name: github2jira-secret
