apiVersion: batch/v1
kind: Job
metadata:
  name: nxtgauge-db-migrate
  namespace: nxtgauge
  labels:
    app: nxtgauge-db-migrate
spec:
  ttlSecondsAfterFinished: 300
  backoffLimit: 3
  template:
    metadata:
      labels:
        app: nxtgauge-db-migrate
    spec:
      restartPolicy: OnFailure
      imagePullSecrets:
        - name: forgejo-regcred
      containers:
        - name: migrate
          image: ci.nxtgauge.com/ashwin/nxtgauge-db-migrate:high-performance-latest
          imagePullPolicy: Always
          envFrom:
            - secretRef:
                name: nxtgauge-backend-rust-secrets
          env:
            - name: MIGRATIONS_DIR
              value: "/migrations"
          resources:
            requests:
              memory: "64Mi"
              cpu: "50m"
            limits:
              memory: "256Mi"
              cpu: "500m"
