2024-05-07 21:49:09 +03:00
|
|
|
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)
|
|
|
|
|
2024-05-10 12:10:25 +03:00
|
|
|
docker:
|
2024-05-10 12:12:42 +03:00
|
|
|
@docker buildx build --platform linux/amd64 --tag $CI_APP_IMAGE --file Dockerfile .
|
2024-05-10 12:10:25 +03:00
|
|
|
|
|
|
|
docker_release:
|
2024-05-10 12:12:42 +03:00
|
|
|
@docker buildx build --push --platform linux/amd64 --tag $CI_APP_IMAGE --file Dockerfile .
|
2024-05-10 12:10:25 +03:00
|
|
|
|
2024-05-07 21:49:09 +03:00
|
|
|
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}
|