-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (19 loc) · 939 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (19 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
IMAGE := ghcr.io/gifi71/ocserv-docker
TAG ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo latest)
PLATFORM := linux/amd64,linux/arm64
.DEFAULT_GOAL := help
.PHONY: help build build-multiarch push lint test clean
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-18s %s\n", $$1, $$2}'
build: ## Build the Docker image (local)
docker buildx build --progress=plain --pull --load -t $(IMAGE):$(TAG) .
build-multiarch: ## Build multi-platform and push
docker buildx build --progress=plain --pull --platform $(PLATFORM) --push -t $(IMAGE):$(TAG) .
push: ## Push the image to GHCR
docker push $(IMAGE):$(TAG)
lint: ## Run all linters via pre-commit
pre-commit run --all-files
test: build ## Run integration tests
IMAGE=$(IMAGE) TAG=$(TAG) tests/run.sh
clean: ## Remove the built image
docker rmi $(IMAGE):$(TAG) 2>/dev/null || true