task-postgresql-create-databases-users.yaml
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: task-postgresql-create-databases-users
spec:
params:
- name: databases
type: array
- name: users
type: array
- name: POSTGRESQL_HOST
type: string
- name: postgresql-image
type: string
default: bitnami/postgresql:14.1.0-debian-10-r66
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: create-databases-users
image: $(params.postgresql-image)
command: ["/scripts/create-databases-users.sh"]
args: ["--databases", "$(params.databases[*])", "--users", "$(params.users[*])"]
env:
- name: POSTGRESQL_HOST
value: $(params.POSTGRESQL_HOST)
volumeMounts:
- name: task-postgresql-scripts
mountPath: /scripts
---