vegapokerbot/Makefile

38 lines
980 B
Makefile

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
APP_IMAGE=gitea.neur0tx.site/neur0toxine/vegapokerbot:latest
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 ${APP_IMAGE} --file Dockerfile .
docker_release:
@docker buildx build --push --platform linux/amd64 --tag ${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}