-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
153 lines (108 loc) · 4.19 KB
/
Copy pathMakefile
File metadata and controls
153 lines (108 loc) · 4.19 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.PHONY: help setup up down restart logs build clean health status validate
# Default target
.DEFAULT_GOAL := help
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
setup: ## Run complete setup
@./scripts/setup.sh
setup-env: ## Setup environment (.env)
@./scripts/setup-env.sh
setup-client: ## Setup Matrix Client config
@./scripts/setup-client.sh
setup-interface: ## Setup Interface API config
@./scripts/setup-interface.sh
setup-authy: ## Setup Authy API config
@./scripts/setup-authy.sh
fetch-defaults: ## Fetch fresh default configs from upstream repos
@./scripts/fetch-defaults.sh
clean-config: ## Remove all generated configs
@rm -f config/client/conf.yaml config/interface-api/.env config/authy-api/.env .env
@echo "[OK] All configs removed"
clean-config-client: ## Remove Matrix Client config
@rm -f config/client/conf.yaml
@echo "[OK] Client config removed"
clean-config-interface: ## Remove Interface API config
@rm -f config/interface-api/.env
@echo "[OK] Interface API config removed"
clean-config-authy: ## Remove Authy API config
@rm -f config/authy-api/.env
@echo "[OK] Authy API config removed"
clean-config-env: ## Remove root .env
@rm -f .env
@echo "[OK] Root .env removed"
validate: ## Validate docker-compose configuration
@docker compose config > /dev/null && echo "[OK] Configuration is valid"
up: ## Start services
@docker compose up -d
down: ## Stop all services
@docker compose down
down-volumes: ## Stop all services and remove volumes (WARNING: deletes data)
@docker compose down -v
restart: ## Restart all services
@docker compose restart
restart-shortmesh: ## Restart ShortMesh services (client, interface-api, authy-api)
@docker compose restart matrix-client interface-api authy-api
logs: ## View logs from all services
@docker compose logs -f
logs-shortmesh: ## View logs from ShortMesh services only
@docker compose logs -f matrix-client interface-api authy-api
build: ## Build all services
@docker compose build
build-no-cache: ## Build all services without cache
@docker compose build --no-cache
rebuild: ## Rebuild and restart all services
@docker compose up -d --build
rebuild-shortmesh: ## Rebuild ShortMesh services
@docker compose build matrix-client interface-api authy-api
@docker compose up -d matrix-client interface-api authy-api
health: ## Check health of all services
@docker compose ps
status: ## Show status of all containers
@docker compose ps -a
clean: ## Remove stopped containers and unused images
@docker compose down
@docker system prune -f
clean-all: ## Remove everything including volumes (WARNING: deletes all data)
@docker compose down -v
@docker system prune -a -f
pull: ## Pull latest images
@docker compose pull
migrate-interface: ## Run Interface API migrations
@docker compose run --rm interface-api-migrate
migrate-authy: ## Run Authy API migrations
@docker compose run --rm authy-api-migrate
# Individual service management
start-client: ## Start Matrix Client
@docker compose up -d matrix-client
start-interface: ## Start Interface API
@docker compose up -d interface-api
start-authy: ## Start Authy API
@docker compose up -d authy-api
# Logs for individual services
logs-client: ## View Matrix Client logs
@docker compose logs -f matrix-client
logs-interface: ## View Interface API logs
@docker compose logs -f interface-api
logs-authy: ## View Authy API logs
@docker compose logs -f authy-api
logs-rabbitmq: ## View RabbitMQ logs
@docker compose logs -f rabbitmq
# Shell access
shell-interface: ## Access Interface API shell
@docker compose exec interface-api sh
shell-authy: ## Access Authy API shell
@docker compose exec authy-api sh
shell-client: ## Access Matrix Client shell
@docker compose exec matrix-client sh
# Backup and restore
backup: ## Backup configurations
@tar -czf shortmesh-config-backup-$$(date +%Y%m%d-%H%M%S).tar.gz config/ .env 2>/dev/null || true
@echo "[OK] Configuration backed up"
# Monitoring
stats: ## Show resource usage statistics
@docker stats --no-stream
watch-health: ## Continuously watch service health
@watch -n 2 'docker compose ps'