From 9676c5a79351cde52cb39f43f869f7e56e93630d Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Thu, 17 Aug 2023 17:42:14 +0300 Subject: [PATCH] Cleanup makefiles. Signed-off-by: s3rj1k --- Makefile | 2 +- Makefile.common | 17 ++--------------- Makefile.docker | 5 +++-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index f53d821..0d73653 100644 --- a/Makefile +++ b/Makefile @@ -22,4 +22,4 @@ all: check build # Run all checks. .PHONY: check -check: clean tidy verify lint test check-git-clean +check: clean tidy lint test check-git-clean diff --git a/Makefile.common b/Makefile.common index 74e8a1f..26144ed 100644 --- a/Makefile.common +++ b/Makefile.common @@ -29,9 +29,6 @@ else GOBIN = $(shell $(GO_BIN) env GOBIN) endif -# Build version variables. -BUILD_VERSION ?= $(shell $(GIT_BIN) describe --always --dirty --broken --abbrev=8) - # Build flags. GO_BUILD_ENV = CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=$(GOPROXY) GO_BUILD_FLAGS ?= --tags "netgo osusergo static_build" @@ -88,20 +85,10 @@ lint-n-fix: golangci-lint test: $(GO_BIN) test -v -failfast ./... -# Update golang dependencies. +# Tidy golang dependencies. .PHONY: tidy tidy: - $(TEST_BIN) -d vendor || $(GO_BIN) mod tidy -v -compat=$(GO_MOD_COMPAT_VERSION) - -# Update vendor directory. -.PHONY: vendor -vendor: - $(GO_BIN) mod vendor -v && $(GIT_BIN) status -s - -# Verify golang dependencies. -.PHONY: verify -verify: - $(TEST_BIN) -d vendor || $(GO_BIN) mod verify + $(GO_BIN) mod tidy -v -compat=$(GO_MOD_COMPAT_VERSION) # Create artifacts directory. .PHONY: artifacts-dir diff --git a/Makefile.docker b/Makefile.docker index daaf1c9..7e4d66e 100644 --- a/Makefile.docker +++ b/Makefile.docker @@ -3,10 +3,11 @@ DOCKER_BUILDKIT_PROGRESS := auto # Set common utilities environs. DOCKER_BIN := $(or $(DOCKER_BIN),docker) -ENV_BIN := $(or $(ENV_BIN),env) -ID_BIN := $(or $(ID_BIN),id) SSH_ADD_BIN := $(or $(SSH_ADD_BIN),ssh-add) +# Build version variables. +BUILD_VERSION ?= $(shell $(GIT_BIN) describe --always --dirty --broken --abbrev=8) + # Default image name. IMAGE_NAME ?= $(IMAGE_DEFAULT_NAME)