Standardize Makefile docker/push targets for MCR

Add MCR and VERSION variables. Tag images with full MCR registry URL
and version. Add push target that builds then pushes to MCR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-27 14:31:57 -07:00
parent d0568110d7
commit d4d65eb522

View File

@@ -1,6 +1,8 @@
.PHONY: build test vet lint clean docker all devserver .PHONY: build test vet lint clean docker push all devserver
LDFLAGS := -trimpath -ldflags="-s -w -X main.version=$(shell git describe --tags --always --dirty)" MCR := mcr.svc.mcp.metacircular.net:8443
VERSION := $(shell git describe --tags --always --dirty)
LDFLAGS := -trimpath -ldflags="-s -w -X main.version=$(VERSION)"
mcdoc: mcdoc:
CGO_ENABLED=0 go build $(LDFLAGS) -o mcdoc ./cmd/mcdoc CGO_ENABLED=0 go build $(LDFLAGS) -o mcdoc ./cmd/mcdoc
@@ -21,7 +23,10 @@ clean:
rm -f mcdoc rm -f mcdoc
docker: docker:
docker build --build-arg VERSION=$(shell git describe --tags --always --dirty) -t mcdoc -f Dockerfile . docker build --build-arg VERSION=$(VERSION) -t $(MCR)/mcdoc:$(VERSION) -f Dockerfile .
push: docker
docker push $(MCR)/mcdoc:$(VERSION)
devserver: mcdoc devserver: mcdoc
@mkdir -p srv @mkdir -p srv