4
4
5
5
whoami
6
6
7
- # Clone gh-ost-ci-env
8
- # Only clone if not already running locally at latest commit
9
- remote_commit=$( git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1)
10
- local_commit=" unknown"
11
- [ -d " gh-ost-ci-env" ] && local_commit=$( cd gh-ost-ci-env && git log --format=" %H" -n 1)
12
-
13
- echo " remote commit is: $remote_commit "
14
- echo " local commit is: $local_commit "
7
+ fetch_ci_env () {
8
+ # Clone gh-ost-ci-env
9
+ # Only clone if not already running locally at latest commit
10
+ remote_commit=$( git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1)
11
+ local_commit=" unknown"
12
+ [ -d " gh-ost-ci-env" ] && local_commit=$( cd gh-ost-ci-env && git log --format=" %H" -n 1)
13
+
14
+ echo " remote commit is: $remote_commit "
15
+ echo " local commit is: $local_commit "
16
+
17
+ if [ " $remote_commit " != " $local_commit " ] ; then
18
+ rm -rf ./gh-ost-ci-env
19
+ git clone https://github.com/github/gh-ost-ci-env.git
20
+ fi
21
+ }
15
22
16
- if [ " $remote_commit " != " $local_commit " ] ; then
17
- rm -rf ./gh-ost-ci-env
18
- git clone https://github.com/github/gh-ost-ci-env.git
19
- fi
23
+ test_dbdeployer () {
24
+ gh-ost-ci-env/bin/linux/dbdeployer --version
25
+ }
20
26
21
27
test_mysql_version () {
22
28
local mysql_version
@@ -30,17 +36,18 @@ test_mysql_version() {
30
36
31
37
mkdir -p sandbox/binary
32
38
rm -rf sandbox/binary/*
33
- gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/" $mysql_version " .tar.gz --unpack-version= " $mysql_version " --sandbox-binary ${PWD} /sandbox/binary
39
+ gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/" $mysql_version " .tar.xz --sandbox-binary ${PWD} /sandbox/binary
34
40
35
41
mkdir -p sandboxes
36
42
rm -rf sandboxes/*
37
43
38
- if echo " $mysql_version " | egrep " 5[.]5[.]" ; then
44
+ local mysql_version_num=${mysql_version#* -}
45
+ if echo " $mysql_version_num " | egrep " 5[.]5[.]" ; then
39
46
gtid=" "
40
47
else
41
48
gtid=" --gtid"
42
49
fi
43
- gh-ost-ci-env/bin/linux/dbdeployer deploy replication " $mysql_version " --nodes 2 --sandbox-binary ${PWD} /sandbox/binary --sandbox-home ${PWD} /sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox
50
+ gh-ost-ci-env/bin/linux/dbdeployer deploy replication " $mysql_version_num " --nodes 2 --sandbox-binary ${PWD} /sandbox/binary --sandbox-home ${PWD} /sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox
44
51
45
52
sed ' /sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master
46
53
echo ' sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master
@@ -59,12 +66,19 @@ test_mysql_version() {
59
66
find sandboxes -name " stop_all" | bash
60
67
}
61
68
62
- echo " Building..."
63
- . script/build
64
- # Test all versions:
65
- find gh-ost-ci-env/mysql-tarballs/ -name " *.tar.gz" | while read f ; do basename $f " .tar.gz" ; done | sort -r | while read mysql_version ; do
66
- echo " found MySQL version: $mysql_version "
67
- done
68
- find gh-ost-ci-env/mysql-tarballs/ -name " *.tar.gz" | while read f ; do basename $f " .tar.gz" ; done | sort -r | while read mysql_version ; do
69
- test_mysql_version " $mysql_version "
70
- done
69
+ main () {
70
+ fetch_ci_env
71
+ test_dbdeployer
72
+
73
+ echo " Building..."
74
+ . script/build
75
+ # Test all versions:
76
+ find gh-ost-ci-env/mysql-tarballs/ -name " *.tar.xz" | while read f ; do basename $f " .tar.xz" ; done | sort -r | while read mysql_version ; do
77
+ echo " found MySQL version: $mysql_version "
78
+ done
79
+ find gh-ost-ci-env/mysql-tarballs/ -name " *.tar.xz" | while read f ; do basename $f " .tar.xz" ; done | sort -r | while read mysql_version ; do
80
+ test_mysql_version " $mysql_version "
81
+ done
82
+ }
83
+
84
+ main
0 commit comments