Files
container-base/Makefile
T
unkin-agent 63cf28c90e
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
Replace pre-commit.sh with the pre-commit framework and drop the test harness
The hand-rolled pre-commit.sh reimplemented what upstream hooks already do.
Move to pre-commit.com with the estate's usual pre-commit-hooks set plus
hadolint and shellcheck, and keep the one check with no upstream equivalent
(distros/ vs the Woodpecker matrices) as a repo: local hook.

The test harness goes; tests will be reintroduced differently.

- add .pre-commit-config.yaml and ci/check-distros.sh
- delete pre-commit.sh, test.sh and .woodpecker/test.yaml
- run uvx pre-commit run --all-files from .woodpecker/pre-commit.yaml and make pre-commit
- drop the Dockerfile test stage and the make test targets
2026-09-27 20:17:04 +10:00

40 lines
1.4 KiB
Makefile

REGISTRY := artifactapi.k8s.syd1.au.unkin.net/docker-internal
DISTROS := $(notdir $(wildcard distros/*))
VERSION ?= $(patsubst v%,%,$(or $(shell git describe --tags --exact-match 2>/dev/null),0.1.0-dev))
.PHONY: build clean pre-commit patch minor major
build: $(addprefix build-,$(DISTROS))
clean: $(addprefix clean-,$(DISTROS))
pre-commit:
@uvx pre-commit run --all-files
# Not .PHONY: GNU make skips implicit-rule search for phony targets.
build-%:
@set -eu; . ./distros/$*/distro.env; \
docker build --build-arg "BASE_IMAGE=$$BASE_IMAGE" --build-arg "DISTRO=$*" \
-t "$(REGISTRY)/$$IMAGE:$(VERSION)" .
clean-%:
@set -eu; . ./distros/$*/distro.env; \
docker rmi "$(REGISTRY)/$$IMAGE:$(VERSION)" 2>/dev/null || true
_LATEST := $(shell git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$$' | head -1)
_BASE := $(if $(_LATEST),$(_LATEST),v0.0.0)
_MAJ := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f1)
_MIN := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f2)
_PAT := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f3)
patch:
@NEW=v$(_MAJ).$(_MIN).$(shell expr $(_PAT) + 1); \
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
minor:
@NEW=v$(_MAJ).$(shell expr $(_MIN) + 1).0; \
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
major:
@NEW=v$(shell expr $(_MAJ) + 1).0.0; \
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW