thread-master/deploy/Makefile

61 lines
1.3 KiB
Makefile
Raw Normal View History

2026-07-10 12:54:45 +00:00
# Harbor Desk deploy helpers
2026-07-13 01:15:30 +00:00
# 用法make -C deploy restart
2026-07-10 12:54:45 +00:00
2026-07-13 01:15:30 +00:00
.PHONY: env redeploy redeploy-keep restart wipe infra migrate build start stop status nginx help
2026-07-10 12:54:45 +00:00
SCRIPTS := ./scripts
help:
2026-07-13 01:15:30 +00:00
@echo "常用:"
@echo " make restart # 只重編+重開 gateway/worker/web保留資料★ 日常開發"
@echo " make status # 看埠 / pid / 健康"
@echo " make stop | start # 只停 / 只起 app"
@echo " make build # 只編譯"
@echo ""
@echo "重裝(會動 infra"
@echo " make redeploy-keep # 保留 DB重跑 migrate+build+start"
@echo " make redeploy # 清 volume + 全重建(危險)"
@echo " make wipe | infra | migrate | env | nginx"
2026-07-10 12:54:45 +00:00
env:
@if [ ! -f .env.dev ]; then \
cp .env.example .env.dev; \
echo "created deploy/.env.dev — 請改密鑰"; \
else \
echo "deploy/.env.dev already exists"; \
fi
2026-07-13 01:15:30 +00:00
# 日常開發:不動 Mongo/Redis/MinIO 資料
restart:
$(SCRIPTS)/restart.sh
2026-07-10 12:54:45 +00:00
redeploy:
$(SCRIPTS)/redeploy.sh --yes --kill-orphan
redeploy-keep:
$(SCRIPTS)/redeploy.sh --yes --keep-data
wipe:
$(SCRIPTS)/wipe.sh --yes --kill-orphan
infra:
$(SCRIPTS)/up-infra.sh
migrate:
$(SCRIPTS)/migrate.sh
build:
$(SCRIPTS)/build.sh
start:
$(SCRIPTS)/start.sh
stop:
$(SCRIPTS)/stop.sh
status:
$(SCRIPTS)/status.sh
nginx:
$(SCRIPTS)/install-nginx.sh