apiVersion: batch/v1
kind: Job
metadata:
  name: pre-deploy
spec:
  template:
    metadata:
      labels:
        app: api
        aadpodidbinding: api-identity
    spec:
      restartPolicy: OnFailure
      containers:
        - name: main
          image: taoregistry.azurecr.io/azure-aks-django:#{Build.BuildId}#
          command: ["/bin/sh", "-c"]
          args: ["/app/deploy/pre-deploy.sh"]
          env:
            - name: CORS_DEFAULT_ALLOWED_ORIGIN
              value: "http://localhost:8000"
            - name: SECRET_KEY
              value: insecure
            - name: DEBUG
              value: "false"
            - name: DATABASE_HOST
              value: "tao-test-db.postgres.database.azure.com"
            - name: DATABASE_NAME
              value: "data"
            - name: DATABASE_USER
              value: "writer@tao-test-db"
