Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:

build:
runs-on: ubuntu-20.04
strategy:
matrix:
mysql: [ 5.7.32, 8.0.22 ]
tarantool: [ 1.10.8, 2.6.1 ]
steps:
- name: Print mysqldump version
run: |
Expand All @@ -34,7 +38,11 @@ jobs:
run: make build

- name: Test
run: |
make env_up
make run_tests
make env_down
env:
MYSQL_VERSION: ${{ matrix.mysql }}
TARANTOOL_VERSION: ${{ matrix.tarantool }}
run: make run_tests

- name: Cleanup
if: ${{ always() }}
run: make env_down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ run_tests: env_up
.PHONY: env_up
env_up:
docker-compose up -d
sleep 5
./docker/wait.sh
docker-compose ps

.PHONY: env_down
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It uses `mysqldump` to fetch the origin data at first, then syncs data increment
Create or use exist user with replication grants:

```sql
GRANT RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
GRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
FLUSH PRIVILEGES;
```

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: '3.4'

services:
mysql:
image: mysql:${MYSQL_VERSION:-5.7.21}
image: mysql:${MYSQL_VERSION:-8.0.22}
environment:
- MYSQL_DATABASE=city
- MYSQL_USER=repl
- MYSQL_PASSWORD=repl
- MYSQL_ROOT_PASSWORD=root_pwd
command: --bind-address=0.0.0.0 --ssl=0 --log-bin=mysql-bin --server-id=1 --enforce_gtid_consistency=ON --gtid_mode=ON
command: --bind-address=0.0.0.0 --ssl=0 --default-authentication-plugin=mysql_native_password --log-bin=mysql-bin --server-id=1 --enforce_gtid_consistency=ON --gtid_mode=ON
volumes:
- ./docker/mysql/init.d:/docker-entrypoint-initdb.d
ports:
Expand All @@ -18,6 +18,6 @@ services:
build:
context: ./docker/tarantool
args:
VERSION: ${TARANTOOL_VERSION:-2.6.0}
VERSION: ${TARANTOOL_VERSION:-2.6.1}
ports:
- '13301:3301'
2 changes: 1 addition & 1 deletion docker/mysql/init.d/init.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GRANT RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';
GRANT PROCESS, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%';

CREATE TABLE users
(
Expand Down
13 changes: 13 additions & 0 deletions docker/wait.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

__workdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
__rootdir=$(dirname "${__workdir}")

cd "${__rootdir}"

while ! docker-compose exec -T mysql mysql --user=root --password=root_pwd -e "status" &> /dev/stdout ; do
echo "Waiting for MySQL connection..."
sleep 1
done