apiVersion: batch/v1
kind: CronJob
metadata:
  name: release-notes-generation
  namespace: production
spec:
  schedule: "59 23 * * 5" # every friday at 2350hrs
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      activeDeadlineSeconds: 3600
      backoffLimit: 1
      template:
        spec:
          containers:
            - name: wavtool-server
              imagePullPolicy: Always
              image: 035363416972.dkr.ecr.us-east-1.amazonaws.com/wavtool-server:$DEPLOY_TAG
              env:
                - name: ENVIRONMENT
                  value: "production"
                - name: NODE_ENV
                  value: "production"
              envFrom:
                - configMapRef:
                    name: wavtool-server-config-production
                - secretRef:
                    name: wavtool-server-secret
                - secretRef:
                    name: wavtool-server-secret-production
              command:
                - node
                - built/src/cron/generateReleaseNotes.js
          restartPolicy: Never
