apiVersion: batch/v1
kind: Job
metadata:
  name: pvb-staff-migration
  labels:
    app: pvb-staff-migration
spec:
  completions: 1
  parallelism: 1
  template:
    spec:
      ttlSecondsAfterFinished: 30
      containers:
        - name: prison-visits-staff-migration
          image: 754256621582.dkr.ecr.eu-west-2.amazonaws.com/prison-visits-booking/prison-visits-staff:latest
          imagePullPolicy: Always
          command: ['sh', '-c', 'bundle exec rails db:migrate && bundle exec rails db:seed']
          envFrom:
            - configMapRef:
                name: shared-environment
            - secretRef:
                name: secrets
          env:
            - name: "DISABLE_PROMETHEUS_METRICS"
              value: "true"
          resources:
            limits:
              memory: "1Gi"
              cpu: "50m"
            requests:
              memory: "1Gi"
              cpu: "30m"
      restartPolicy: Never
  backoffLimit: 4
apiVersion: batch/v1
kind: Job
metadata:
  name: pvb-staff-migration
  labels:
    app: pvb-staff-migration
spec:
  completions: 1
  parallelism: 1
  template:
    spec:
      containers:
        - name: prison-visits-staff-migration
          image: 754256621582.dkr.ecr.eu-west-2.amazonaws.com/prison-visits-booking/prison-visits-staff:latest
          imagePullPolicy: Always
          command: ['sh', '-c', 'bundle exec rails db:migrate && bundle exec rails db:seed']
          envFrom:
            - configMapRef:
                name: shared-environment
            - secretRef:
                name: secrets
          env:
            - name: "DISABLE_PROMETHEUS_METRICS"
              value: "true"
          resources:
            limits:
              memory: "1Gi"
              cpu: "50m"
            requests:
              memory: "1Gi"
              cpu: "30m"
      restartPolicy: Never
  backoffLimit: 4
Revert "Delete the migration job on completion"
Revert "Delete the migration job on completion"
