Skip to content

Commit

Permalink
Merge branch 'master' into replication_server_version_string
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Oct 26, 2024
2 parents 12028e5 + 51292e4 commit 39fc319
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
all: build

GO111MODULE=on
MYSQL_VERSION ?= 8.0
GO ?= go

build:
go build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go
go build -o bin/go-mysqldump cmd/go-mysqldump/main.go
go build -o bin/go-canal cmd/go-canal/main.go
go build -o bin/go-binlogparser cmd/go-binlogparser/main.go
${GO} build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go
${GO} build -o bin/go-mysqldump cmd/go-mysqldump/main.go
${GO} build -o bin/go-canal cmd/go-canal/main.go
${GO} build -o bin/go-binlogparser cmd/go-binlogparser/main.go

test:
go test --race -timeout 2m ./...
${GO} test --race -timeout 2m ./...

MYSQL_VERSION ?= 8.0
test-local:
docker run --rm -d --network=host --name go-mysql-server \
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \
-e MYSQL_DATABASE=test \
-v $${PWD}/docker/resources/replication.cnf:/etc/mysql/conf.d/replication.cnf \
mysql:$(MYSQL_VERSION)
docker/resources/waitfor.sh 127.0.0.1 3306 \
&& go test -race -v -timeout 2m ./...
&& ${GO} test -race -v -timeout 2m ./...
docker stop go-mysql-server

fmt:
golangci-lint run --fix

clean:
go clean -i ./...
${GO} clean -i ./...
@rm -rf ./bin

0 comments on commit 39fc319

Please sign in to comment.