apiVersion: batch/v1
kind: Job
metadata:
  name: db-seed
spec:
  template:
    metadata:
      name: db-seed
    spec:
      restartPolicy: Never
      containers:
        - name: cccd-job
          image: 754256621582.dkr.ecr.eu-west-2.amazonaws.com/laa-get-paid/cccd:app-latest
          command:
            - bundle
            - exec
            - rake
            - db:seed

          envFrom:
            - configMapRef:
                name: cccd-app-config
            - secretRef:
                name: cccd-secrets

          env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: cccd-rds
                  key: url
