---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: e2e-couchbase-
  namespace: e2e
spec:
  template:
    metadata:
      name: e2e
      labels:
        app: couchbase-deployment-e2e

    spec:
      serviceAccountName: e2e
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: IfNotPresent

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            value: default

          - name: PROVIDER_STORAGE_CLASS
            # Supported values: openebs-standard, local-storage
            value: openebs-standalone

          - name: APP_PVC
            value: openebs-couchbase

            # Application label
          - name: APP_LABEL
            value: 'app=couchbase'

            # Application namespace
          - name: APP_NAMESPACE
            value: app-couch-ns 

            # Application replica
          - name: APP_REPLICA
            value: 'replicas=1'

          - name: DEPLOY_TYPE
            value: statefulset

          # Use 'deprovision' for app-clean up
          - name: ACTION
            value: provision

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./apps/couchbase/deployers/test.yml -i /etc/ansible/hosts -v; exit 0"]

