-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into replication_server_version_string
- Loading branch information
Showing
1 changed file
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |