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>
37 lines
811 B
Makefile
37 lines
811 B
Makefile
.PHONY: build test vet lint clean docker push all devserver
|
|
|
|
MCR := mcr.svc.mcp.metacircular.net:8443
|
|
VERSION := $(shell git describe --tags --always --dirty)
|
|
LDFLAGS := -trimpath -ldflags="-s -w -X main.version=$(VERSION)"
|
|
|
|
mcdoc:
|
|
CGO_ENABLED=0 go build $(LDFLAGS) -o mcdoc ./cmd/mcdoc
|
|
|
|
build:
|
|
go build ./...
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
vet:
|
|
go vet ./...
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
clean:
|
|
rm -f mcdoc
|
|
|
|
docker:
|
|
docker build --build-arg VERSION=$(VERSION) -t $(MCR)/mcdoc:$(VERSION) -f Dockerfile .
|
|
|
|
push: docker
|
|
docker push $(MCR)/mcdoc:$(VERSION)
|
|
|
|
devserver: mcdoc
|
|
@mkdir -p srv
|
|
@if [ ! -f srv/mcdoc.toml ]; then cp deploy/examples/mcdoc.toml srv/mcdoc.toml; echo "Created srv/mcdoc.toml from example — edit before running."; fi
|
|
./mcdoc server --config srv/mcdoc.toml
|
|
|
|
all: vet lint test mcdoc
|