A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
atcr.io
docker
container
atproto
go
1# ATCR Makefile
2# Build targets for the ATProto Container Registry
3
4.PHONY: all build build-appview build-hold build-credential-helper build-oauth-helper \
5 generate test test-race test-verbose lint clean help
6
7.DEFAULT_GOAL := help
8
9help: ## Show this help message
10 @echo "ATCR Build Targets:"
11 @echo ""
12 @awk 'BEGIN {FS = ":.*##"; printf ""} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-28s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
13
14all: generate build ## Generate assets and build all binaries (default)
15
16# Generated asset files
17GENERATED_ASSETS = \
18 pkg/appview/static/js/htmx.min.js \
19 pkg/appview/static/js/lucide.min.js \
20 pkg/appview/licenses/spdx-licenses.json
21
22generate: $(GENERATED_ASSETS) ## Run go generate to download vendor assets
23
24$(GENERATED_ASSETS):
25 @echo "→ Generating vendor assets and code..."
26 go generate ./...
27
28##@ Build Targets
29
30build: build-appview build-hold build-credential-helper ## Build all binaries
31
32build-appview: $(GENERATED_ASSETS) ## Build appview binary only
33 @echo "→ Building appview..."
34 @mkdir -p bin
35 go build -o bin/atcr-appview ./cmd/appview
36
37build-hold: $(GENERATED_ASSETS) ## Build hold binary only
38 @echo "→ Building hold..."
39 @mkdir -p bin
40 go build -o bin/atcr-hold ./cmd/hold
41
42build-credential-helper: $(GENERATED_ASSETS) ## Build credential helper only
43 @echo "→ Building credential helper..."
44 @mkdir -p bin
45 go build -o bin/docker-credential-atcr ./cmd/credential-helper
46
47build-oauth-helper: $(GENERATED_ASSETS) ## Build OAuth helper only
48 @echo "→ Building OAuth helper..."
49 @mkdir -p bin
50 go build -o bin/oauth-helper ./cmd/oauth-helper
51
52##@ Test Targets
53
54test: ## Run all tests
55 @echo "→ Running tests..."
56 go test -cover ./...
57
58test-race: ## Run tests with race detector
59 @echo "→ Running tests with race detector..."
60 go test -race ./...
61
62test-verbose: ## Run tests with verbose output
63 @echo "→ Running tests with verbose output..."
64 go test -v ./...
65
66##@ Quality Targets
67
68.PHONY: check-golangci-lint
69check-golangci-lint:
70 @which golangci-lint > /dev/null || (echo "→ Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
71
72lint: check-golangci-lint ## Run golangci-lint
73 @echo "→ Running golangci-lint..."
74 golangci-lint run ./...
75
76##@ Utility Targets
77
78clean: ## Remove built binaries and generated assets
79 @echo "→ Cleaning build artifacts..."
80 rm -rf bin/
81 rm -f pkg/appview/static/js/htmx.min.js
82 rm -f pkg/appview/static/js/lucide.min.js
83 rm -f pkg/appview/licenses/spdx-licenses.json
84 @echo "✓ Clean complete"