Skip to content

Commit a25f63a

Browse files
merge tar-xz-dbdeployer-upgrade
1 parent 2634534 commit a25f63a

File tree

1 file changed

+47
-26
lines changed

1 file changed

+47
-26
lines changed

script/cibuild-gh-ost-replica-tests

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,30 @@ set -e
44

55
whoami
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 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+
}
1527

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+
}
2031

2132
test_mysql_version() {
2233
local mysql_version
@@ -30,7 +41,7 @@ test_mysql_version() {
3041

3142
mkdir -p sandbox/binary
3243
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
3445

3546
mkdir -p sandboxes
3647
rm -rf sandboxes/*
@@ -59,16 +70,26 @@ test_mysql_version() {
5970
find sandboxes -name "stop_all" | bash
6071
}
6172

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

Comments
 (0)