Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup makefiles. #6

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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