---
apiVersion: batch/v1
kind: Job
metadata:
  name: sqitch-migrate
spec:
  parallelism: 1
  completions: 1
  template:
    metadata:
      name: sqitch-migrate
    spec:
      containers:
      - name: sqitch-migrate
        image: havengrc-docker.jfrog.io/kindlyops/havensqitch:latest
        command:
          - "sqitch --target db:pg://$DATABASE_USERNAME:$SQITCHPASSWORD@$DATABASE_HOST/$DATABASE_NAME staging deploy"
        env:
          - name: DATABASE_NAME
            value: "havenstage"
          - name: DATABASE_HOST
            value: "db"
          - name: DATABASE_USERNAME
            valueFrom:
              secretKeyRef:
                name: haven-database-credentials
                key: username
          - name: SQITCHPASSWORD
            valueFrom:
              secretKeyRef:
                name: haven-database-credentials
                key: password
      restartPolicy: Never

---
apiVersion: batch/v1
kind: Job
metadata:
  name: sqitch-migrate
spec:
  parallelism: 1
  completions: 1
  template:
    metadata:
      name: sqitch-migrate
    spec:
      containers:
      - name: sqitch-migrate
        image: havengrc-docker.jfrog.io/kindlyops/havensqitch:latest
        command:
          - "/usr/local/bin/run-sqitch.sh"
          - "plan"
        env:
          - name: DATABASE_NAME
            value: "havenstage"
          - name: DATABASE_HOST
            value: "db"
          - name: DATABASE_USERNAME
            valueFrom:
              secretKeyRef:
                name: haven-database-credentials
                key: username
          - name: SQITCHPASSWORD
            valueFrom:
              secretKeyRef:
                name: haven-database-credentials
                key: password
      restartPolicy: Never

Adjust k8s job to use array form of command
Adjust k8s job to use array form of command

Signed-off-by: Elliot Murphy <014ce8fab4ab9f8a957bfe9f974379093994de97@users.noreply.github.com>
