Model the build on mozimo and target emily

- Makefile: PLATFORMS, tags :<commit> and :main, build-check with --pull.
- deploy.sh: push, guards, git pull --ff-only, optional --prune, image_tag.
- Replace .containerignore with .dockerignore.
- Add the opt-in image prune to the hops role.
- Tag the Caddyfile task so --skip-tags caddy works before DNS cutover.
- Trim comments and rewrite build and deploy text in plain prose.
This commit is contained in:
tanshu committed 2026-10-20 17:47:49 +05:30
1 parent 7366596a87
commit a7c9324170
14 files changed
+194 -357

No files matched your search

+15 -27
View File
@@ -1,42 +1,30 @@
# Hops n Grains — container image builds.
#
# Built with Podman/Buildah, not Docker, from the committed tree
# (`git archive HEAD`) and tagged with that commit, so a deploy ships exactly
# what git knows about. deploy.sh pushes first and refuses a dirty tree.
COMMIT ?= $(shell git rev-parse --short HEAD)
# The deploy host (emily) is aarch64, so that is the default target: the image
# is built for the machine it runs on, not the one running make. Podman carries
# no built-in QEMU (unlike docker buildx), so a foreign platform needs binfmt
# handlers on this host — qemu-user-binfmt is installed here. Override with e.g.
# `make build-production PLATFORM=linux/amd64`.
PLATFORM ?= linux/arm64
# emily is aarch64, so that is the default target. A foreign platform needs
# the host's binfmt handlers, because podman has no built-in QEMU.
PLATFORMS ?= linux/arm64
IMAGE ?= registry.tanshu.com/hops
.PHONY: build-production
build-production: ## Build HEAD with podman, tag :$(COMMIT) + :latest, and push
@echo "==> podman build --platform $(PLATFORM) → $(IMAGE):$(COMMIT) + :latest"
build-production: ## Build HEAD with podman, push :$(COMMIT) and :main
@echo "==> podman build --platform $(PLATFORMS) -> $(IMAGE):$(COMMIT) + :main"
@git archive --format=tar HEAD | podman build \
--platform $(PLATFORM) \
--platform $(PLATFORMS) \
--tag $(IMAGE):$(COMMIT) \
--tag $(IMAGE):latest \
--pull=always \
--tag $(IMAGE):main \
- || { \
echo "✗ podman build failed."; \
echo " Cross-platform builds need binfmt on this host (podman has no built-in QEMU):"; \
echo " sudo apt install qemu-user-binfmt # or qemu-user-static"; \
echo "podman build failed."; \
echo "Cross-platform builds need binfmt on this host (podman has no built-in QEMU):"; \
echo " sudo apt install qemu-user-static # on an x86_64 host, for $(PLATFORMS)"; \
exit 1; \
}
podman push $(IMAGE):$(COMMIT)
podman push $(IMAGE):latest
podman push $(IMAGE):main
.PHONY: build-check
build-check: ## Compile check from HEAD with podman, nothing pushed
@echo "==> podman build --platform $(PLATFORM) (no push)"
git archive --format=tar HEAD | podman build \
--platform $(PLATFORM) \
--tag localhost/hops:check \
--pull=always \
@git archive --format=tar HEAD | podman build \
--platform $(PLATFORMS) \
--tag hops:check \
--pull \
-