export GO111MODULE := on
GOOS := $(if $(GOOS),$(GOOS),linux)
GOARCH := $(if $(GOARCH),$(GOARCH),amd64)
GOENV  := CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH)
GO     := $(GOENV) go
GO_BUILD := $(GO) build -trimpath -mod=vendor

COMMIT := $(shell git rev-parse --short HEAD)
TAG := $(shell git describe --abbrev=0 --tags ${COMMIT} 2>/dev/null || echo ${COMMIT})
DATE := $(shell git log -1 --format=%cd --date=format:"%Y%m%d")
REPO ?= gcr.io/pingcap-public
VERSION := $(TAG)-$(DATE)
ifneq ($(shell git status --porcelain),)
    VERSION := $(VERSION)-dirty
endif

overlay-test:
	docker run --pull always --rm -v $(CURDIR):/go/src/github.com/tidbcloud/tidb-configuration \
		-w /go/src/github.com/tidbcloud/tidb-configuration \
		--entrypoint="" \
		gcr.io/pingcap-public/overlay:latest \
		./overlay.sh --meta --git-pr-num 9527 --git-pr-created-by fake-author --git-commit fake-commit-id --git-commit-msg fake-comit-msg
