-
Notifications
You must be signed in to change notification settings - Fork 12
/
gosync.yml
219 lines (195 loc) · 5.03 KB
/
gosync.yml
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---
#########################
## Sync
#########################
sync:
production: &production
## Base path for sync
path: "./test/"
connection:
ssh: [email protected]
#########################
## Filesystem rsync
#########################
filesystem:
## Sync /tmp/remote/path to ./test/ (defined before)
- path: /tmp/remote/path
filter:
exclude:
- .git
- node_modules/
## Sync /tmp/remote/other/path to ./other/
- path: /tmp/remote/other/path
local: ./other/
filter:
exclude:
- .git
- node_modules/
## Create file stubs for /tmp/remote/other/path-big-files to ./other-stubs/
- path: /tmp/remote/other/path-big-files
local: ./other-stubs/
options:
generate-stubs: true
rsync:
- "--iconv=UTF8-MAC,UTF8"
## Sync /tmp/remote/other/path-other-files to ./other2/ with custom rsync options
- path: /tmp/remote/other/path-other-files
local: ./other2/
options:
rsync:
- "--iconv=UTF8-MAC,UTF8"
#########################
## Database
#########################
database:
## NORMAL MYSQL
## Sync database typo3 to local test-local (without cache tables)
##
## remote: connect via ssh and get dump from local installed mysql
## local: connect via mysql to a database server "mysql.example.com"
- type: mysql
database: application1
user: mysql-user
password: mysql-password
filter:
exclude:
- "^cache_.*"
include:
local:
## use plain mysql connection
database: test-application1
user: root
password: dev
port: 13306
hostname: mysql.example.com
options:
# custom mysqldump options (for local)
mysqldump:
# custom mysql options (for local)
mysql:
options:
## clear database before restore
## (delete all tables inside)
clear-database: true
# custom mysqldump options (for remote)
mysqldump:
# custom mysql options (for remote)
mysql:
## DOCKER
## Sync database typo3 to local test-local into a docker container
##
## remote: connect via ssh and get dump from local installed mysql
## local: use docker container "2713f9093bed" for restore
- type: mysql
database: application2
user: mysql-user
password: mysql-password
filter:
exclude:
include:
local:
database: test-application2
user: root
password: dev
connection:
docker: 2713f9093bed
options:
## clear database before restore
## (delete all tables inside)
clear-database: true
## DOCKER-COMPOSE
## Sync database typo3 to local test-local into a docker-compose container
##
## docker-compose.yml has to be in the same or parent directory!
##
## remote: connect via ssh and get dump from local installed mysql
## local: use docker-compose container "mysql" for restore
- type: mysql
database: application3
user: mysql-user
password: mysql-password
filter:
exclude:
include:
local:
database: test-application3
user: root
password: dev
connection:
docker: compose:mysql
options:
## clear database before restore
## (delete all tables inside)
clear-database: true
#########################
## Execute
#########################
exec-startup:
## Execute date on local system
- type: local
command: date +%s
## Execute date on local system (alternative style)
- type: local
command:
- date
- +%s
## Execute date with workdir
- type: local
command:
- date
workdir: /
## Execute remote date with workdir
- type: remote
command: date
workdir: /
## Execute remote date with workdir and custom environment settings
- type: remote
command: date
workdir: /
environment:
- name: FOOBAR
value: barfoo
exec-finish:
## Execute remote date with workdir
- type: remote
command: date
workdir: /
#########################
## Deploy
#########################
deploy:
production: &foobar
path: "./test/"
connection:
ssh: [email protected]
filesystem:
- path: /tmp/path
filter:
exclude:
- .git
- node_modules/
- path: /tmp/other/path
local: ./other/
filter:
exclude:
- .git
- node_modules/
database:
- type: mysql
database: foobar
user: mysql-user
password: mysql-password
filter:
exclude:
include:
local:
database: test
user: root
password: dev
connection:
docker: compose:mysql
ssh: [email protected]
options:
clear-database: true
production2:
<<: *foobar