lhm-shopify 3.4.0 → 3.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +24 -15
- data/.gitignore +1 -6
- data/Appraisals +24 -0
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +66 -0
- data/README.md +55 -4
- data/Rakefile +11 -0
- data/dev.yml +31 -6
- data/docker-compose.yml +58 -0
- data/gemfiles/activerecord_5.2.gemfile +9 -0
- data/gemfiles/activerecord_5.2.gemfile.lock +65 -0
- data/gemfiles/activerecord_6.0.gemfile +7 -0
- data/gemfiles/activerecord_6.0.gemfile.lock +67 -0
- data/gemfiles/activerecord_6.1.gemfile +7 -0
- data/gemfiles/activerecord_6.1.gemfile.lock +66 -0
- data/gemfiles/activerecord_7.0.0.alpha2.gemfile +7 -0
- data/gemfiles/activerecord_7.0.0.alpha2.gemfile.lock +64 -0
- data/lhm.gemspec +7 -3
- data/lib/lhm/atomic_switcher.rb +5 -11
- data/lib/lhm/chunk_insert.rb +7 -10
- data/lib/lhm/chunker.rb +21 -10
- data/lib/lhm/cleanup/current.rb +9 -12
- data/lib/lhm/connection.rb +108 -0
- data/lib/lhm/entangler.rb +8 -13
- data/lib/lhm/invoker.rb +6 -4
- data/lib/lhm/locked_switcher.rb +2 -0
- data/lib/lhm/migrator.rb +2 -0
- data/lib/lhm/printer.rb +10 -6
- data/lib/lhm/proxysql_helper.rb +10 -0
- data/lib/lhm/sql_retry.rb +129 -10
- data/lib/lhm/throttler/slave_lag.rb +19 -2
- data/lib/lhm/version.rb +1 -1
- data/lib/lhm.rb +41 -16
- data/scripts/helpers/wait-for-dbs.sh +21 -0
- data/scripts/mysql/reader/create_replication.sql +10 -0
- data/scripts/mysql/writer/create_test_db.sql +1 -0
- data/scripts/mysql/writer/create_users.sql +6 -0
- data/scripts/proxysql/proxysql.cnf +117 -0
- data/spec/integration/atomic_switcher_spec.rb +53 -17
- data/spec/integration/chunk_insert_spec.rb +3 -2
- data/spec/integration/chunker_spec.rb +18 -16
- data/spec/integration/cleanup_spec.rb +49 -38
- data/spec/integration/database.yml +25 -0
- data/spec/integration/entangler_spec.rb +7 -5
- data/spec/integration/integration_helper.rb +25 -10
- data/spec/integration/lhm_spec.rb +114 -40
- data/spec/integration/lock_wait_timeout_spec.rb +2 -2
- data/spec/integration/locked_switcher_spec.rb +4 -4
- data/spec/integration/proxysql_spec.rb +34 -0
- data/spec/integration/sql_retry/db_connection_helper.rb +52 -0
- data/spec/integration/sql_retry/lock_wait_spec.rb +8 -6
- data/spec/integration/sql_retry/lock_wait_timeout_test_helper.rb +17 -4
- data/spec/integration/sql_retry/proxysql_helper.rb +22 -0
- data/spec/integration/sql_retry/retry_with_proxysql_spec.rb +109 -0
- data/spec/integration/table_spec.rb +11 -19
- data/spec/integration/toxiproxy_helper.rb +40 -0
- data/spec/test_helper.rb +24 -0
- data/spec/unit/atomic_switcher_spec.rb +4 -6
- data/spec/unit/chunk_insert_spec.rb +7 -2
- data/spec/unit/chunker_spec.rb +47 -42
- data/spec/unit/connection_spec.rb +111 -0
- data/spec/unit/entangler_spec.rb +85 -22
- data/spec/unit/intersection_spec.rb +4 -4
- data/spec/unit/lhm_spec.rb +23 -6
- data/spec/unit/locked_switcher_spec.rb +13 -18
- data/spec/unit/migrator_spec.rb +17 -19
- data/spec/unit/printer_spec.rb +14 -26
- data/spec/unit/sql_helper_spec.rb +8 -12
- data/spec/unit/table_spec.rb +5 -5
- data/spec/unit/throttler/slave_lag_spec.rb +14 -9
- data/spec/unit/throttler_spec.rb +12 -12
- data/spec/unit/unit_helper.rb +13 -0
- metadata +85 -14
- data/bin/.gitkeep +0 -0
- data/dbdeployer/config.json +0 -32
- data/dbdeployer/install.sh +0 -64
- data/gemfiles/ar-2.3_mysql.gemfile +0 -6
- data/gemfiles/ar-3.2_mysql.gemfile +0 -5
- data/gemfiles/ar-3.2_mysql2.gemfile +0 -5
- data/gemfiles/ar-4.0_mysql2.gemfile +0 -5
- data/gemfiles/ar-4.1_mysql2.gemfile +0 -5
- data/gemfiles/ar-4.2_mysql2.gemfile +0 -5
- data/gemfiles/ar-5.0_mysql2.gemfile +0 -5
data/spec/unit/throttler_spec.rb
CHANGED
@@ -23,11 +23,11 @@ describe Lhm::Throttler do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'instantiates the time throttle' do
|
26
|
-
@mock.throttler.class.must_equal Lhm::Throttler::Time
|
26
|
+
value(@mock.throttler.class).must_equal Lhm::Throttler::Time
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'returns 2 seconds as time' do
|
30
|
-
@mock.throttler.timeout_seconds.must_equal 2
|
30
|
+
value(@mock.throttler.timeout_seconds).must_equal 2
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -37,11 +37,11 @@ describe Lhm::Throttler do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'instantiates the slave_lag throttle' do
|
40
|
-
@mock.throttler.class.must_equal Lhm::Throttler::SlaveLag
|
40
|
+
value(@mock.throttler.class).must_equal Lhm::Throttler::SlaveLag
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'returns 20 seconds as allowed_lag' do
|
44
|
-
@mock.throttler.allowed_lag.must_equal 20
|
44
|
+
value(@mock.throttler.allowed_lag).must_equal 20
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -58,11 +58,11 @@ describe Lhm::Throttler do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'returns the instace given' do
|
61
|
-
@mock.throttler.must_equal @instance
|
61
|
+
value(@mock.throttler).must_equal @instance
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'returns 0 seconds as time' do
|
65
|
-
@mock.throttler.timeout_seconds.must_equal 0
|
65
|
+
value(@mock.throttler.timeout_seconds).must_equal 0
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -78,11 +78,11 @@ describe Lhm::Throttler do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
it 'returns the instace given' do
|
81
|
-
@mock.throttler.must_equal @instance
|
81
|
+
value(@mock.throttler).must_equal @instance
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'returns 0 seconds as time' do
|
85
|
-
@mock.throttler.timeout_seconds.must_equal 0
|
85
|
+
value(@mock.throttler.timeout_seconds).must_equal 0
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -94,7 +94,7 @@ describe Lhm::Throttler do
|
|
94
94
|
end
|
95
95
|
|
96
96
|
it 'has the same class as given' do
|
97
|
-
@mock.throttler.class.must_equal @klass
|
97
|
+
value(@mock.throttler.class).must_equal @klass
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -106,7 +106,7 @@ describe Lhm::Throttler do
|
|
106
106
|
end
|
107
107
|
|
108
108
|
it 'has the same class as given' do
|
109
|
-
@mock.throttler.class.must_equal @klass
|
109
|
+
value(@mock.throttler.class).must_equal @klass
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
@@ -114,11 +114,11 @@ describe Lhm::Throttler do
|
|
114
114
|
describe '#throttler' do
|
115
115
|
|
116
116
|
it 'returns the default Time based' do
|
117
|
-
@mock.throttler.class.must_equal Lhm::Throttler::Time
|
117
|
+
value(@mock.throttler.class).must_equal Lhm::Throttler::Time
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'should default to 100 milliseconds' do
|
121
|
-
@mock.throttler.timeout_seconds.must_equal 0.1
|
121
|
+
value(@mock.throttler.timeout_seconds).must_equal 0.1
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
data/spec/unit/unit_helper.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require 'test_helper'
|
4
4
|
|
5
5
|
module UnitHelper
|
6
|
+
LOG_EXPRESSION = /([\w]+),\s+\[([^\]\s]+)\s+#([^\]]+)]\s+(\w+)\s+--\s+(\w+)?:\s+(.+)/
|
7
|
+
|
6
8
|
def fixture(name)
|
7
9
|
File.read $fixtures.join(name)
|
8
10
|
end
|
@@ -10,4 +12,15 @@ module UnitHelper
|
|
10
12
|
def strip(sql)
|
11
13
|
sql.strip.gsub(/\n */, "\n")
|
12
14
|
end
|
15
|
+
|
16
|
+
def log_expression_message(msg)
|
17
|
+
msg.gsub(LOG_EXPRESSION) do |match|
|
18
|
+
severity = $1
|
19
|
+
date = $2
|
20
|
+
pid = $3
|
21
|
+
label = $4
|
22
|
+
app = $5
|
23
|
+
message = $6
|
24
|
+
end
|
25
|
+
end
|
13
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhm-shopify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SoundCloud
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: retriable
|
@@ -28,6 +28,20 @@ dependencies:
|
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 3.0.0
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: activerecord
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
31
45
|
- !ruby/object:Gem::Dependency
|
32
46
|
name: minitest
|
33
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -57,7 +71,7 @@ dependencies:
|
|
57
71
|
- !ruby/object:Gem::Version
|
58
72
|
version: '0'
|
59
73
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
74
|
+
name: after_do
|
61
75
|
requirement: !ruby/object:Gem::Requirement
|
62
76
|
requirements:
|
63
77
|
- - ">="
|
@@ -71,7 +85,7 @@ dependencies:
|
|
71
85
|
- !ruby/object:Gem::Version
|
72
86
|
version: '0'
|
73
87
|
- !ruby/object:Gem::Dependency
|
74
|
-
name:
|
88
|
+
name: rake
|
75
89
|
requirement: !ruby/object:Gem::Requirement
|
76
90
|
requirements:
|
77
91
|
- - ">="
|
@@ -112,6 +126,48 @@ dependencies:
|
|
112
126
|
- - ">="
|
113
127
|
- !ruby/object:Gem::Version
|
114
128
|
version: '0'
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: toxiproxy
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: appraisal
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: byebug
|
159
|
+
requirement: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
type: :development
|
165
|
+
prerelease: false
|
166
|
+
version_requirements: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
115
171
|
description: Migrate large tables without downtime by copying to a temporary table
|
116
172
|
in chunks. The old table is not dropped. Instead, it is moved to timestamp_table_name
|
117
173
|
for verification.
|
@@ -124,22 +180,23 @@ files:
|
|
124
180
|
- ".gitignore"
|
125
181
|
- ".rubocop.yml"
|
126
182
|
- ".travis.yml"
|
183
|
+
- Appraisals
|
127
184
|
- CHANGELOG.md
|
128
185
|
- Gemfile
|
186
|
+
- Gemfile.lock
|
129
187
|
- LICENSE
|
130
188
|
- README.md
|
131
189
|
- Rakefile
|
132
|
-
- bin/.gitkeep
|
133
|
-
- dbdeployer/config.json
|
134
|
-
- dbdeployer/install.sh
|
135
190
|
- dev.yml
|
136
|
-
-
|
137
|
-
- gemfiles/
|
138
|
-
- gemfiles/
|
139
|
-
- gemfiles/
|
140
|
-
- gemfiles/
|
141
|
-
- gemfiles/
|
142
|
-
- gemfiles/
|
191
|
+
- docker-compose.yml
|
192
|
+
- gemfiles/activerecord_5.2.gemfile
|
193
|
+
- gemfiles/activerecord_5.2.gemfile.lock
|
194
|
+
- gemfiles/activerecord_6.0.gemfile
|
195
|
+
- gemfiles/activerecord_6.0.gemfile.lock
|
196
|
+
- gemfiles/activerecord_6.1.gemfile
|
197
|
+
- gemfiles/activerecord_6.1.gemfile.lock
|
198
|
+
- gemfiles/activerecord_7.0.0.alpha2.gemfile
|
199
|
+
- gemfiles/activerecord_7.0.0.alpha2.gemfile.lock
|
143
200
|
- lhm.gemspec
|
144
201
|
- lib/lhm-shopify.rb
|
145
202
|
- lib/lhm.rb
|
@@ -149,6 +206,7 @@ files:
|
|
149
206
|
- lib/lhm/chunker.rb
|
150
207
|
- lib/lhm/cleanup/current.rb
|
151
208
|
- lib/lhm/command.rb
|
209
|
+
- lib/lhm/connection.rb
|
152
210
|
- lib/lhm/entangler.rb
|
153
211
|
- lib/lhm/intersection.rb
|
154
212
|
- lib/lhm/invoker.rb
|
@@ -156,6 +214,7 @@ files:
|
|
156
214
|
- lib/lhm/migration.rb
|
157
215
|
- lib/lhm/migrator.rb
|
158
216
|
- lib/lhm/printer.rb
|
217
|
+
- lib/lhm/proxysql_helper.rb
|
159
218
|
- lib/lhm/railtie.rb
|
160
219
|
- lib/lhm/sql_helper.rb
|
161
220
|
- lib/lhm/sql_retry.rb
|
@@ -168,6 +227,11 @@ files:
|
|
168
227
|
- lib/lhm/throttler/time.rb
|
169
228
|
- lib/lhm/timestamp.rb
|
170
229
|
- lib/lhm/version.rb
|
230
|
+
- scripts/helpers/wait-for-dbs.sh
|
231
|
+
- scripts/mysql/reader/create_replication.sql
|
232
|
+
- scripts/mysql/writer/create_test_db.sql
|
233
|
+
- scripts/mysql/writer/create_users.sql
|
234
|
+
- scripts/proxysql/proxysql.cnf
|
171
235
|
- shipit.rubygems.yml
|
172
236
|
- spec/.lhm.example
|
173
237
|
- spec/README.md
|
@@ -188,20 +252,27 @@ files:
|
|
188
252
|
- spec/integration/chunk_insert_spec.rb
|
189
253
|
- spec/integration/chunker_spec.rb
|
190
254
|
- spec/integration/cleanup_spec.rb
|
255
|
+
- spec/integration/database.yml
|
191
256
|
- spec/integration/entangler_spec.rb
|
192
257
|
- spec/integration/integration_helper.rb
|
193
258
|
- spec/integration/invoker_spec.rb
|
194
259
|
- spec/integration/lhm_spec.rb
|
195
260
|
- spec/integration/lock_wait_timeout_spec.rb
|
196
261
|
- spec/integration/locked_switcher_spec.rb
|
262
|
+
- spec/integration/proxysql_spec.rb
|
263
|
+
- spec/integration/sql_retry/db_connection_helper.rb
|
197
264
|
- spec/integration/sql_retry/lock_wait_spec.rb
|
198
265
|
- spec/integration/sql_retry/lock_wait_timeout_test_helper.rb
|
266
|
+
- spec/integration/sql_retry/proxysql_helper.rb
|
267
|
+
- spec/integration/sql_retry/retry_with_proxysql_spec.rb
|
199
268
|
- spec/integration/table_spec.rb
|
269
|
+
- spec/integration/toxiproxy_helper.rb
|
200
270
|
- spec/test_helper.rb
|
201
271
|
- spec/unit/atomic_switcher_spec.rb
|
202
272
|
- spec/unit/chunk_finder_spec.rb
|
203
273
|
- spec/unit/chunk_insert_spec.rb
|
204
274
|
- spec/unit/chunker_spec.rb
|
275
|
+
- spec/unit/connection_spec.rb
|
205
276
|
- spec/unit/entangler_spec.rb
|
206
277
|
- spec/unit/intersection_spec.rb
|
207
278
|
- spec/unit/lhm_spec.rb
|
data/bin/.gitkeep
DELETED
File without changes
|
data/dbdeployer/config.json
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": "1.8.0",
|
3
|
-
"sandbox-home": "./dbdeployer/sandboxes",
|
4
|
-
"sandbox-binary": "./dbdeployer/binaries",
|
5
|
-
"use-sandbox-catalog": true,
|
6
|
-
"master-slave-base-port": 11000,
|
7
|
-
"group-replication-base-port": 12000,
|
8
|
-
"group-replication-sp-base-port": 13000,
|
9
|
-
"fan-in-replication-base-port": 14000,
|
10
|
-
"all-masters-replication-base-port": 15000,
|
11
|
-
"multiple-base-port": 16000,
|
12
|
-
"group-port-delta": 125,
|
13
|
-
"mysqlx-port-delta": 10000,
|
14
|
-
"master-name": "master",
|
15
|
-
"master-abbr": "m",
|
16
|
-
"node-prefix": "node",
|
17
|
-
"slave-prefix": "slave",
|
18
|
-
"slave-abbr": "s",
|
19
|
-
"sandbox-prefix": "msb_",
|
20
|
-
"master-slave-prefix": "rsandbox_",
|
21
|
-
"group-prefix": "group_msb_",
|
22
|
-
"group-sp-prefix": "group_sp_msb_",
|
23
|
-
"multiple-prefix": "multi_msb_",
|
24
|
-
"fan-in-prefix": "fan_in_msb_",
|
25
|
-
"all-masters-prefix": "all_masters_msb_",
|
26
|
-
"reserved-ports": [
|
27
|
-
1186,
|
28
|
-
3306,
|
29
|
-
33060
|
30
|
-
],
|
31
|
-
"timestamp": "Mon Jul 16 17:36:55 AST 2018"
|
32
|
-
}
|
data/dbdeployer/install.sh
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
set -e
|
2
|
-
mkdir -p ./dbdeployer/sandboxes
|
3
|
-
mkdir -p ./dbdeployer/binaries
|
4
|
-
|
5
|
-
if [ -z "$(uname | grep Darwin)" ]; then
|
6
|
-
OS=linux
|
7
|
-
set -x
|
8
|
-
else
|
9
|
-
OS=osx
|
10
|
-
fi
|
11
|
-
|
12
|
-
echo "Checking if dbdeployer is installed"
|
13
|
-
if ! [ -x "$(command -v ./bin/dbdeployer)" ]; then
|
14
|
-
echo "Not installed...starting install"
|
15
|
-
VERSION=1.56.0
|
16
|
-
origin=https://github.com/datacharmer/dbdeployer/releases/download/v$VERSION
|
17
|
-
filename=dbdeployer-$VERSION.$OS
|
18
|
-
wget -q $origin/$filename.tar.gz
|
19
|
-
tar -xzf $filename.tar.gz
|
20
|
-
chmod +x $filename
|
21
|
-
sudo mv $filename ./bin/dbdeployer
|
22
|
-
rm $filename.tar.gz
|
23
|
-
else
|
24
|
-
echo "Installation found!"
|
25
|
-
fi
|
26
|
-
|
27
|
-
|
28
|
-
echo "Checking if mysql 5.7.22 is available for dbdeployer"
|
29
|
-
if [ -z "$(./bin/dbdeployer --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" available | grep 5.7.22)" ]; then
|
30
|
-
echo "Not found..."
|
31
|
-
|
32
|
-
if [ "$OS" = "linux" ]; then
|
33
|
-
MYSQL_FILE=mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
|
34
|
-
else
|
35
|
-
MYSQL_FILE=mysql-5.7.22-macos10.13-x86_64.tar.gz
|
36
|
-
fi
|
37
|
-
|
38
|
-
if [ ! -f $MYSQL_FILE ]; then
|
39
|
-
echo "Downloading $MYSQL_FILE...(this may take a while)"
|
40
|
-
wget -q "https://dev.mysql.com/get/Downloads/MySQL-5.7/$MYSQL_FILE"
|
41
|
-
fi
|
42
|
-
|
43
|
-
echo "Setting up..."
|
44
|
-
./bin/dbdeployer unpack $MYSQL_FILE --verbosity 0 --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries"
|
45
|
-
rm $MYSQL_FILE
|
46
|
-
else
|
47
|
-
echo "mysql 5.7.22 found!"
|
48
|
-
fi
|
49
|
-
|
50
|
-
echo "Forcing new replication setup..."
|
51
|
-
./bin/dbdeployer deploy replication 5.7.22 --nodes 2 --force --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" --sandbox-home "./dbdeployer/sandboxes"
|
52
|
-
./bin/dbdeployer global status --config ./dbdeployer/config.json --sandbox-binary "./dbdeployer/binaries" --sandbox-home "./dbdeployer/sandboxes"
|
53
|
-
|
54
|
-
echo "Setting up database.yml"
|
55
|
-
DATABASE_YML=spec/integration/database.yml
|
56
|
-
echo "master:" > $DATABASE_YML
|
57
|
-
cat ./dbdeployer/sandboxes/rsandbox_5_7_22/master/my.sandbox.cnf | grep -A 4 client | tail -n 4 | sed -e 's/ * = /: /' -e 's/^/ /' >> $DATABASE_YML
|
58
|
-
|
59
|
-
echo "slave:" >> $DATABASE_YML
|
60
|
-
cat ./dbdeployer/sandboxes/rsandbox_5_7_22/node1/my.sandbox.cnf | grep -A 4 client | tail -n 4 | sed -e 's/ * = /: /' -e 's/^/ /' >> $DATABASE_YML
|
61
|
-
|
62
|
-
cat $DATABASE_YML
|
63
|
-
|
64
|
-
echo "You are ready to run the integration test suite..."
|