2024-11-22 15:29:25 +00:00
|
|
|
BINARY_NAME=envoid
|
|
|
|
VERSION=1.0.0-alpha
|
|
|
|
BUILD_FOLDER=build
|
|
|
|
|
|
|
|
GO_BUILD_LD_FLAGS=-ldflags="-s -w -X 'git.dayanhub.com/sagi/envoid/internal/variables.Commit=$(shell git rev-parse --short HEAD)' \
|
|
|
|
-X 'git.dayanhub.com/sagi/envoid/internal/variables.Version=${VERSION}'"
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
|
|
|
GOARCH=amd64 GOOS=linux go build ${GO_BUILD_LD_FLAGS} -o ${BUILD_FOLDER}/${BINARY_NAME}-linux main.go
|
|
|
|
GOARCH=amd64 GOOS=darwin go build ${GO_BUILD_LD_FLAGS} -o ${BUILD_FOLDER}/${BINARY_NAME}-darwin main.go
|
2024-12-16 18:22:58 +00:00
|
|
|
#GOARCH=amd64 GOOS=windows go build ${GO_BUILD_LD_FLAGS} -o ${BUILD_FOLDER}/${BINARY_NAME}-windows main.go
|
2024-11-22 15:29:25 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
go clean
|
|
|
|
rm -rf ${BUILD_FOLDER}
|
|
|
|
rm -rf ./docs
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
.PHONY: test_coverage
|
|
|
|
test_coverage:
|
|
|
|
go test ./... -coverprofile=coverage.out
|
|
|
|
|
|
|
|
.PHONY: dep
|
|
|
|
dep:
|
|
|
|
go mod tidy
|
|
|
|
go mod vendor
|
|
|
|
|
|
|
|
.PHONY: vet
|
|
|
|
vet:
|
|
|
|
go vet
|
|
|
|
|
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
golangci-lint run --enable-all
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: doc-gen
|
|
|
|
doc-gen:
|
|
|
|
rm -rf ./docs
|
|
|
|
mkdir ./docs
|
|
|
|
go run . doc
|
|
|
|
|