mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-08 05:47:03 +09:00
Makefile: added QUIET_MODE support
This commit is contained in:
parent
d609b657c3
commit
fb836ea10f
1 changed files with 22 additions and 6 deletions
28
Makefile
28
Makefile
|
@ -1,33 +1,49 @@
|
||||||
.DEFAULT_GOAL := start
|
.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
|
||||||
generate_env:
|
generate_env:
|
||||||
|
ifeq ($(QUIET_MODE),true)
|
||||||
|
docker buildx build --quiet --load --tag generateconfig-env --file Dockerfile-generateconfig-env . >/dev/null
|
||||||
|
else
|
||||||
docker buildx build --load --tag generateconfig-env --file Dockerfile-generateconfig-env .
|
docker buildx build --load --tag generateconfig-env --file Dockerfile-generateconfig-env .
|
||||||
|
endif
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--volume ${CURDIR}/:/code/ \
|
--volume ${CURDIR}/:/code/ \
|
||||||
generateconfig-env
|
generateconfig-env
|
||||||
|
|
||||||
start: generate_env
|
start: generate_env
|
||||||
docker compose up --detach --remove-orphans
|
$(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 "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"
|
@echo "See: https://doc.anytype.io/anytype-docs/data-and-security/self-hosting#switching-between-networks"
|
||||||
|
endif
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
docker compose stop
|
$(DOCKER_COMPOSE) stop
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
docker system prune --all --volumes
|
docker system prune --all --volumes
|
||||||
|
|
||||||
pull:
|
pull:
|
||||||
docker compose pull
|
$(DOCKER_COMPOSE) pull
|
||||||
|
|
||||||
down:
|
down:
|
||||||
docker compose down --remove-orphans
|
$(DOCKER_COMPOSE) down --remove-orphans
|
||||||
logs:
|
logs:
|
||||||
docker compose logs --follow
|
$(DOCKER_COMPOSE) logs --follow
|
||||||
|
|
||||||
# build with "plain" log for debug
|
# build with "plain" log for debug
|
||||||
build:
|
build:
|
||||||
docker compose build --no-cache --progress plain
|
$(DOCKER_COMPOSE) build --no-cache --progress plain
|
||||||
|
|
||||||
restart: down start
|
restart: down start
|
||||||
update: pull down start
|
update: pull down start
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue