Skip to content

Commit

Permalink
Cleanup makefiles.
Browse files Browse the repository at this point in the history
Signed-off-by: s3rj1k <[email protected]>
  • Loading branch information
s3rj1k committed Aug 17, 2023
1 parent cd0cbd8 commit 474f899
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 2 additions & 15 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 474f899

Please sign in to comment.