-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (49 loc) · 2.55 KB
/
Copy pathMakefile
File metadata and controls
74 lines (49 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Include shared container runtime detection
include ./containers.mk
# Hosting profile (anubis is included when ANUBIS_ENABLED=true)
# Reads one profile per line from configs/hosting-profile.txt, renders as --profile flags
HOSTING_PROFILE = $(shell cat configs/hosting-profile.txt 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$$//;/^$$/d;s/^/--profile /' | tr '\n' ' ' || echo '--profile hosting')
.PHONY: setup setup-dry-run run-hosting watch-hosting run-mirroring pull-mirror run-mirroring-indexed run-indexer purge-indexing obfuscate clean logs help
##@ Setup
setup: ## Generate configuration files from templates
bash scripts/setup.sh
setup-dry-run: ## Show what would be generated without writing files
bash scripts/setup.sh --dry-run
##@ Running services
run-hosting: ## Start public-inbox and nginx (hosting profile)
$(COMPOSE) $(HOSTING_PROFILE) up -d
watch-hosting: ## Start public-inbox and nginx (hosting profile)
$(COMPOSE) $(HOSTING_PROFILE) up
run-mirroring: ## Start grokmirror daemon (mirroring profile, detached)
$(COMPOSE) --profile mirroring up -d
pull-mirror: ## Run grokmirror once, pull and exit (mirroring profile)
$(COMPOSE) --profile mirroring run --rm grokmirror grok-pull -v -c /config/grokmirror.conf
run-mirroring-indexed: ## Start grokmirror with indexing hooks
GROKMIRROR_MODE=indexed $(COMPOSE) --profile mirroring up -d
run-indexer: ## Run manual indexing of cloned repos
$(COMPOSE) --profile manual run --rm indexer
purge-indexing: ## Purge public-inbox indexing data (preserves grokmirror clones)
$(COMPOSE) --profile manual run --rm indexer bash /scripts/purge-indexing.sh -d /data
run-all: setup run-mirroring run-hosting ## Setup, mirror, and host everything
##@ Utilities
obfuscate: ## Add obfuscate = true to all publicinbox sections missing it
bash scripts/obfuscate.sh
logs: ## Show logs for all services
$(COMPOSE) logs -f
logs-hosting: ## Show logs for hosting services
$(COMPOSE) $(HOSTING_PROFILE) logs -f
logs-mirroring: ## Show logs for mirroring services
$(COMPOSE) --profile mirroring logs -f
stop: ## Stop all services
$(COMPOSE) down
stop-hosting: ## Stop hosting services
$(COMPOSE) $(HOSTING_PROFILE) down
stop-mirroring: ## Stop mirroring services
$(COMPOSE) --profile mirroring down
clean: ## Remove generated build files
rm -rf build/
##@ Help
help: ## Show this help
@echo "Usage: make [target]"
@echo ""
@awk 'BEGIN {FS = ":.*##"; printf "Targets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)