44
55whoami
66
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+ }
1522
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+ }
2026
2127test_mysql_version () {
2228 local mysql_version
@@ -30,17 +36,18 @@ test_mysql_version() {
3036
3137 mkdir -p sandbox/binary
3238 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
3440
3541 mkdir -p sandboxes
3642 rm -rf sandboxes/*
3743
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
3946 gtid=" "
4047 else
4148 gtid=" --gtid"
4249 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
4451
4552 sed ' /sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master
4653 echo ' sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master
@@ -59,12 +66,19 @@ test_mysql_version() {
5966 find sandboxes -name " stop_all" | bash
6067}
6168
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