gh-ost/script/cibuild-gh-ost-replica-tests
2018-02-26 14:00:23 +02:00

33 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
whoami
[ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git
find sandboxes -name "stop_all" | bash
mkdir -p sandbox/binary
rm -rf sandbox/binary/*
gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/5.7.21.tar.gz --unpack-version=5.7.21 --sandbox-binary ${PWD}/sandbox/binary
mkdir -p sandboxes
rm -rf sandboxes/*
gh-ost-ci-env/bin/linux/dbdeployer replication 5.7.21 --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
sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master
echo 'sandboxes/rsandbox_5_7_21/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master
sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica
echo 'sandboxes/rsandbox_5_7_21/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica
export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}"
gh-ost-test-mysql-master -uroot -e "grant all on *.* to 'gh-ost'@'%' identified by 'gh-ost'"
echo "# Running localtests"
./localtests/test.sh
sandboxes/rsandbox_5_7_21/stop_all