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 install-credential-helper \
6 develop develop-detached develop-down dev
7
8.DEFAULT_GOAL := help
9
10help: ## Show this help message
11 @echo "ATCR Build Targets:"
12 @echo ""
13 @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)
14
15all: generate build ## Generate assets and build all binaries (default)
16
17# Generated asset files
18GENERATED_ASSETS = \
19 pkg/appview/static/js/htmx.min.js \
20 pkg/appview/static/js/lucide.min.js \
21 pkg/appview/licenses/spdx-licenses.json
22
23generate: $(GENERATED_ASSETS) ## Run go generate to download vendor assets
24
25$(GENERATED_ASSETS):
26 @echo "→ Generating vendor assets and code..."
27 go generate ./...
28
29##@ Build Targets
30
31build: build-appview build-hold build-credential-helper ## Build all binaries
32
33build-appview: $(GENERATED_ASSETS) ## Build appview binary only
34 @echo "→ Building appview..."
35 @mkdir -p bin
36 go build -o bin/atcr-appview ./cmd/appview
37
38build-hold: $(GENERATED_ASSETS) ## Build hold binary only
39 @echo "→ Building hold..."
40 @mkdir -p bin
41 go build -o bin/atcr-hold ./cmd/hold
42
43build-credential-helper: $(GENERATED_ASSETS) ## Build credential helper only
44 @echo "→ Building credential helper..."
45 @mkdir -p bin
46 go build -o bin/docker-credential-atcr ./cmd/credential-helper
47
48build-oauth-helper: $(GENERATED_ASSETS) ## Build OAuth helper only
49 @echo "→ Building OAuth helper..."
50 @mkdir -p bin
51 go build -o bin/oauth-helper ./cmd/oauth-helper
52
53##@ Test Targets
54
55test: ## Run all tests
56 @echo "→ Running tests..."
57 go test -cover ./...
58
59test-race: ## Run tests with race detector
60 @echo "→ Running tests with race detector..."
61 go test -race ./...
62
63test-verbose: ## Run tests with verbose output
64 @echo "→ Running tests with verbose output..."
65 go test -v ./...
66
67##@ Quality Targets
68
69.PHONY: check-golangci-lint
70check-golangci-lint:
71 @which golangci-lint > /dev/null || (echo "→ Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
72
73lint: check-golangci-lint ## Run golangci-lint
74 @echo "→ Running golangci-lint..."
75 golangci-lint run ./...
76
77##@ Install Targets
78
79install-credential-helper: build-credential-helper ## Install credential helper to /usr/local/sbin
80 @echo "→ Installing credential helper to /usr/local/sbin..."
81 install -m 755 bin/docker-credential-atcr /usr/local/sbin/docker-credential-atcr
82 @echo "✓ Installed docker-credential-atcr to /usr/local/sbin/"
83
84##@ Development Targets
85
86dev: $(GENERATED_ASSETS) ## Run AppView locally with Air hot reload
87 @which air > /dev/null || (echo "→ Installing Air..." && go install github.com/air-verse/air@latest)
88 air -c .air.toml
89
90##@ Docker Targets
91
92develop: ## Build and start docker-compose with Air hot reload
93 @echo "→ Building Docker images..."
94 docker-compose build
95 @echo "→ Starting docker-compose with hot reload..."
96 docker-compose up
97
98develop-detached: ## Build and start docker-compose with hot reload (detached)
99 @echo "→ Building Docker images..."
100 docker-compose build
101 @echo "→ Starting docker-compose with hot reload (detached)..."
102 docker-compose up -d
103 @echo "✓ Services started in background with hot reload"
104 @echo " AppView: http://localhost:5000"
105 @echo " Hold: http://localhost:8080"
106
107develop-down: ## Stop docker-compose services
108 @echo "→ Stopping docker-compose..."
109 docker-compose down
110
111##@ Utility Targets
112
113clean: ## Remove built binaries and generated assets
114 @echo "→ Cleaning build artifacts..."
115 rm -rf bin/
116 rm -f pkg/appview/static/js/htmx.min.js
117 rm -f pkg/appview/static/js/lucide.min.js
118 rm -f pkg/appview/licenses/spdx-licenses.json
119 @echo "✓ Clean complete"