SHELL = /bin/bash -o pipefail export PATH := $(shell go env GOPATH)/bin:$(PATH) ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) BIN=$(ROOT_DIR)/build/vegapokerbot GO_VERSION=$(shell go version | sed -e 's/go version //') BIN_DIR=$(ROOT_DIR)/build build: deps fmt @echo "> building with ${GO_VERSION}" @CGO_ENABLED=0 go build -buildvcs=false -tags=release -o $(BIN) . @echo $(BIN) docker: @docker buildx build --platform linux/amd64 --tag $CI_APP_IMAGE --file Dockerfile . run: @${BIN} run fmt: @echo "> fmt" @gofmt -l -s -w `go list -buildvcs=false -f '{{.Dir}}' ${ROOT_DIR}/... | grep -v /vendor/` deps: @echo "> deps" @go mod tidy @go mod vendor .PHONY: clean: @rm -rf $(BIN_DIR) @mkdir -p $(BIN_DIR) @touch $(BIN_DIR)/.gitkeep @rm -rf coverage.out test-report.{txt,xml}