pipeline-postgresql-transformer.yaml
3.23 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: pipeline-postgresql-transformer
spec:
params:
- name: databases
type: array
- name: users
type: array
- name: exports
type: array
- name: auth-config-map
type: string
default: ""
- name: auth-secret
type: string
default: ""
- name: s3-items
type: array
default: []
- name: postgresql-image
type: string
default: bitnami/postgresql:14.1.0-debian-10-r66
workspaces:
- name: imports
description: Place any input database dump files here
- name: exports
description: The database exports will be placed in this workspace.
- name: transformations
description: The location that transformation scripts are placed.
tasks:
- name: download-from-s3
taskRef:
name: task-s5cmd-download
workspaces:
- name: files
workspace: imports
params:
- name: auth-config-map
value: $(params.auth-config-map)
- name: auth-secret
value: $(params.auth-secret)
- name: items
value: ["$(params.s3-items[*])"]
- name: postgresql-service
taskRef:
name: task-postgresql-service
- name: create-databases-users
taskRef:
name: task-postgresql-create-databases-users
params:
- name: databases
value: ["$(params.databases)"]
- name: users
value: ["$(params.users)"]
- name: postgresql-image
value: $(params.postgresql-image)
- name: POSTGRESQL_HOST
value: $(tasks.postgresql-service.results.service-name)
- name: import
runAfter:
- create-databases-users
- download-from-s3
taskRef:
name: task-postgresql-import
params:
- name: postgresql-image
value: $(params.postgresql-image)
- name: POSTGRESQL_HOST
value: $(tasks.postgresql-service.results.service-name)
workspaces:
- name: imports
workspace: imports
- name: transform
runAfter:
- import
taskRef:
name: task-postgresql-transformer
params:
- name: postgresql-image
value: $(params.postgresql-image)
- name: POSTGRESQL_HOST
value: $(tasks.postgresql-service.results.service-name)
workspaces:
- name: transformations
workspace: transformations
- name: export
runAfter:
- transform
taskRef:
name: task-postgresql-export
params:
- name: exports
value: ["$(params.exports)"]
- name: postgresql-image
value: $(params.postgresql-image)
- name: POSTGRESQL_HOST
value: $(tasks.postgresql-service.results.service-name)
workspaces:
- name: exports
workspace: exports
- name: upload-to-s3
runAfter:
- export
taskRef:
name: task-s5cmd-upload
workspaces:
- name: files
workspace: exports
params:
- name: auth-config-map
value: $(params.auth-config-map)
- name: auth-secret
value: $(params.auth-secret)
- name: items
value: ["$(params.exports[*])"]