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 tar-xz-binaries | 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
+ (
21
+ cd gh-ost-ci-env
22
+ git fetch origin tar-xz-binaries
23
+ git checkout tar-xz-binaries
24
+ )
25
+ fi
26
+ }
15
27
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
28
+ test_dbdeployer () {
29
+ gh-ost-ci-env/bin/linux/dbdeployer --version
30
+ }
20
31
21
32
test_mysql_version () {
22
33
local mysql_version
@@ -30,7 +41,7 @@ test_mysql_version() {
30
41
31
42
mkdir -p sandbox/binary
32
43
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
44
+ gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/" $mysql_version " .tar.xz --sandbox-binary ${PWD} /sandbox/binary
34
45
35
46
mkdir -p sandboxes
36
47
rm -rf sandboxes/*
@@ -59,16 +70,26 @@ test_mysql_version() {
59
70
find sandboxes -name " stop_all" | bash
60
71
}
61
72
62
- # TEST_MYSQL_VERSION is set by the replica-tests CI job
63
- if [ -z " $TEST_MYSQL_VERSION " ]; then
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
71
- else
72
- echo " found MySQL version: $TEST_MYSQL_VERSION "
73
- test_mysql_version " $TEST_MYSQL_VERSION "
74
- fi
73
+ main () {
74
+ fetch_ci_env
75
+ test_dbdeployer
76
+
77
+ echo " Building..."
78
+ . script/build
79
+
80
+ # TEST_MYSQL_VERSION is set by the replica-tests CI job
81
+ if [ -z " $TEST_MYSQL_VERSION " ]; then
82
+ # Test all versions:
83
+ 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
84
+ echo " found MySQL version: $mysql_version "
85
+ done
86
+ 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
87
+ test_mysql_version " $mysql_version "
88
+ done
89
+ else
90
+ echo " found MySQL version: $TEST_MYSQL_VERSION "
91
+ test_mysql_version " $TEST_MYSQL_VERSION "
92
+ fi
93
+ }
94
+
95
+ main
0 commit comments