-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (38 loc) · 1.26 KB
/
Copy pathMakefile
File metadata and controls
48 lines (38 loc) · 1.26 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
.DEFAULT_GOAL := start
# Check if the 's' flag (silent/quiet mode) is present in MAKEFLAGS
ifeq ($(findstring s,$(MAKEFLAGS)),s)
QUIET_MODE := true
DOCKER_COMPOSE := docker compose --progress=quiet
else
QUIET_MODE := false
DOCKER_COMPOSE := docker compose
endif
# targets
start:
@[ -f .env ] || { echo "Error: .env not found — run: cp .env.example .env"; exit 1; }
@./update-versions.sh > /dev/null 2>&1
$(DOCKER_COMPOSE) up --detach --remove-orphans --quiet-pull
ifeq ($(QUIET_MODE),false)
@echo "Done! Upload your self-hosted network configuration file ${CURDIR}/etc/client.yml into the client app"
@echo "See: https://doc.anytype.io/anytype-docs/data-and-security/self-hosting#switching-between-networks"
endif
stop:
$(DOCKER_COMPOSE) stop
clean:
docker system prune --all --volumes
pull:
$(DOCKER_COMPOSE) pull
down:
$(DOCKER_COMPOSE) down --remove-orphans
logs:
$(DOCKER_COMPOSE) logs --follow
# build with "plain" log for debug
build:
$(DOCKER_COMPOSE) build --no-cache --progress plain
restart: down start
update: pull down start
upgrade: down clean start
STORAGE_DIR := $(shell grep -m1 '^STORAGE_DIR=' .env 2>/dev/null | cut -d= -f2- | tr -d '"')
STORAGE_DIR := $(if $(STORAGE_DIR),$(STORAGE_DIR),./storage)
cleanEtcStorage:
rm -rf etc/ $(STORAGE_DIR)