task-postgresql-export.yaml 1.11 KB
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: task-postgresql-export
spec:
  params:
    - name: exports
      type: array
    - name: POSTGRESQL_HOST
      type: string
    - name: postgresql-image
      type: string
      default: bitnami/postgresql:14.1.0-debian-10-r66
  workspaces:
    - name: exports
      description: The database exports will be placed in this workspace.
  volumes:
    - name: task-postgresql-scripts
      configMap:
        name: task-postgresql-scripts
        defaultMode: 0755
  steps:
    - name: wait-for-start
      image: $(params.postgresql-image)
      command: ["/scripts/wait-for-postgresql.sh"]
      env:
        - name: POSTGRESQL_HOST
          value: $(params.POSTGRESQL_HOST)
      volumeMounts:
        - name: task-postgresql-scripts
          mountPath: /scripts
    - name: exports
      image: $(params.postgresql-image)
      command: ["/scripts/export-dumps.sh", "$(params.exports[*])"]
      env:
        - name: POSTGRESQL_HOST
          value: $(params.POSTGRESQL_HOST)
      volumeMounts:
        - name: task-postgresql-scripts
          mountPath: /scripts

---