-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgerrit_backup.cfg
92 lines (74 loc) · 2.06 KB
/
gerrit_backup.cfg
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
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
[gerrit]
gerrit_path = /var/gerrit/review/
gerrit_username = gerrit
gerrit_group = gerrit
[backup]
ssh_username = vagrant
ssh_key_file = ~/.vagrant.d/insecure_private_key
ssh_hostname = gerrit-server
ssh_port = 22
[backup_api]
api_url = http://gerrit-server
api_verify_ssl = False
[restore]
ssh_username = vagrant
ssh_key_file = ~/.vagrant.d/insecure_private_key
ssh_hostname = gerrit-server
ssh_port = 22
[pre_tasks:stop_services]
services = gerrit,apache2
run_remotely = True
run_for_commands=backup,restore
[pre_tasks:command:gerrit_reindex]
command = java -jar ./bin/gerrit.war reindex
pwd = /var/gerrit/review
run_remotely = True
run_for_commands=backup
sleep = 5
[pre_tasks:database_command:read_only_mode]
command = FLUSH TABLES WITH READ LOCK; SET GLOBAL read_only = ON;
run_remotely = True
run_for_commands=backup
[pre_tasks:database_command:read_only_mode_check]
command = SELECT @@global.read_only;
run_remotely = True
run_for_commands=backup
[post_tasks:database_command:read_only_mode]
command = SET GLOBAL read_only = OFF; UNLOCK TABLES;
run_remotely = True
run_for_commands=backup,restore
[post_tasks:database_command:read_only_mode_check]
command = SELECT @@global.read_only;
run_remotely = True
run_for_commands=backup,restore
[post_tasks:command:chown]
command = chown -R gerrit:gerrit ./git
pwd = /var/gerrit/review
run_remotely = True
[post_tasks:command:gerrit_reindex]
command = java -jar ./bin/gerrit.war reindex
pwd = /var/gerrit/review
run_remotely = True
run_for_commands=restore
sleep = 25
[post_tasks:start_services]
services = gerrit,apache2
run_remotely = True
run_for_commands=backup,restore
sleep = 5
[backup_structure]
database_folder = database
repos_folder = repos
repos_list_folder = repos_list
[backup_folder]
backup_folder = /vagrant/gerrit_backup
[script]
repo_list_filename = gerrit_backup_repos.txt
script_python_filename = gerrit_backup.py
[database]
database_host = localhost
database_username = gerrit
database_password = gerrit
databases_name = gerrit
database_dump_file = gerrit_mysql_dump.sql