manual-approval/Makefile
2025-06-02 21:13:19 +05:30

30 lines
569 B
Makefile

IMAGE_REPO=ghcr.io/trstringer/manual-approval
TARGET_PLATFORM?=linux/amd64
.PHONY: tidy
tidy:
go mod tidy
.PHONY: build
build:
@if [ -z "$(VERSION)" ]; then \
echo "VERSION is required"; \
exit 1; \
fi
docker build --platform $(TARGET_PLATFORM) -t $(IMAGE_REPO):$$VERSION .
.PHONY: push
push:
@if [ -z "$(VERSION)" ]; then \
echo "VERSION is required"; \
exit 1; \
fi
docker push $(IMAGE_REPO):$(VERSION)
.PHONY: test
test:
go test -v .
.PHONY: lint
lint:
docker run --rm -v $$(pwd):/app -w /app golangci/golangci-lint:v2.1.6 golangci-lint run -v