apiVersion: batch/v1
kind: CronJob
metadata:
  name: polling-harvest-job-and-update-video
spec:
  schedule: "*/3 * * * *"
  startingDeadlineSeconds: 120
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: dreamkast
              image: 607167088920.dkr.ecr.ap-northeast-1.amazonaws.com/dreamkast-ecs:main
              command:
                - /bin/sh
                - -c
                - bundle exec rake util:polling_harvest_job_and_update_video
              env:
                - name: RAILS_ENV
                  value: "production"
                - name: MYSQL_HOST
                  value: "dreamkast-mysql"
                - name: REDIS_URL
                  value: "redis://dreamkast-redis:6379"
                - name: SENTRY_DSN
                  value: "https://443f0535beb64cd8b2e995d001e0903b@o414348.ingest.sentry.io/5350644"
                - name: S3_BUCKET
                  value: "dreamkast-test-bucket"
                - name: S3_REGION
                  value: ap-northeast-1
                - name: SQS_FIFO_QUEUE_URL
                  value: "https://sqs.ap-northeast-1.amazonaws.com/607167088920/devFifoQueue.fifo"
                - name: SLACK_WEBHOOK_URL
                  valueFrom:
                    secretKeyRef:
                      name: dreamkast-secret
                      key: SLACK_WEBHOOK_URL_FOR_HARVEST_JOB_NOTIFICATION
                - name: SLACK_CHANNEL
                  valueFrom:
                    secretKeyRef:
                      name: dreamkast-secret
                      key: SLACK_CHANNEL_FOR_HARVEST_JOB_NOTIFICATION
                - name: AWS_REGION
                  value: ap-northeast-1
                - name: DREAMKAST_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: RAILS_MASTER_KEY
                  valueFrom:
                    secretKeyRef:
                      name: rails-app-secret
                      key: rails-app-secret
                - name: AUTH0_CLIENT_ID
                  valueFrom:
                    secretKeyRef:
                      name: dreamkast-secret
                      key: AUTH0_CLIENT_ID
                - name: AUTH0_CLIENT_SECRET
                  valueFrom:
                    secretKeyRef:
                      name: dreamkast-secret
                      key: AUTH0_CLIENT_SECRET
                - name: AUTH0_DOMAIN
                  valueFrom:
                    secretKeyRef:
                      name: dreamkast-secret
                      key: AUTH0_DOMAIN
                - name: REVIEW_APP
                  valueFrom:
                    secretKeyRef:
                      name: dreamkast-secret
                      key: REVIEW_APP
          restartPolicy: OnFailure
