vegapokerbot/Makefile
Neur0toxine d75a0f1c6c
Some checks are pending
continuous-integration/drone/push Build is pending
unhardcode image name
2024-05-10 12:12:42 +03:00

37 lines
921 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
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 .
docker_release:
@docker buildx build --push --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}