-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (52 loc) · 1.71 KB
/
Makefile
File metadata and controls
62 lines (52 loc) · 1.71 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
CORE_SERVICES = traefik pocket-id adguard vaultwarden home-assistant tailscale
MEDIA_SERVICES = qbittorrent arr jellyfin navidrome metube grafana pinchflat
PHOTO_SERVICES = icloud-photos-downloader immich
UTILITIES_SERVICES = forgejo karakeep booklore searxng open-webui orbi umami
ALL_SERVICES = $(CORE_SERVICES) $(PHOTO_SERVICES) $(MEDIA_SERVICES) $(UTILITIES_SERVICES)
check-missing-services:
@echo "Checking for service names without corresponding directories..."; \
extra=0; \
for service in $(ALL_SERVICES); do \
if [ ! -d "$$service" ]; then \
echo "Service '$$service' is listed but directory does not exist"; \
extra=1; \
fi; \
done; \
if [ $$extra -eq 0 ]; then \
echo "No missing service directories found."; \
fi
check-extra-services:
@echo "Checking for directories not listed in any service list..."; \
missing=0; \
dirs=$$(find . -maxdepth 1 -type d ! -name "." ! -name ".*" | sed 's|^./||'); \
for dir in $$dirs; do \
if ! echo "$(ALL_SERVICES)" | grep -qw "$$dir"; then \
echo "Directory '$$dir' is not listed in any service list"; \
missing=1; \
fi; \
done; \
if [ $$missing -eq 0 ]; then \
echo "No extra directories found."; \
fi
check-services: check-missing-services check-extra-services
start-%:
@echo "Starting $*..."; \
cd $*/ && docker compose up -d; \
stop-%:
@echo "Stopping $*..."; \
cd $*/ && docker compose down; \
restart-%:
@echo "Restarting $*..."; \
cd $*/ && docker compose down && docker compose up -d; \
start-all:
@for service in $(ALL_SERVICES); do \
$(MAKE) start-$$service; \
done
stop-all:
@for service in $(ALL_SERVICES); do \
$(MAKE) stop-$$service; \
done
restart-all:
@for service in $(ALL_SERVICES); do \
$(MAKE) restart-$$service; \
done