Add production deployment targets to Makefile
make deploy — full pipeline (push, pull, rebuild) make deploy-status / deploy-logs for monitoring
This commit is contained in:
parent
6f3c203898
commit
015a664893
@ -1,10 +1,10 @@
|
||||
.PHONY: dev prod build up down logs clean
|
||||
.PHONY: dev prod build up down logs clean local static deploy deploy-pull deploy-rebuild
|
||||
|
||||
# Development mode with hot reload
|
||||
dev:
|
||||
MODE=development DEV_MOUNT=./src docker compose up --build
|
||||
|
||||
# Production mode
|
||||
# Production mode (local)
|
||||
prod:
|
||||
MODE=production docker compose up -d --build
|
||||
|
||||
@ -35,3 +35,34 @@ local:
|
||||
# Build static site
|
||||
static:
|
||||
npm run build
|
||||
|
||||
# --- Production Deployment (forrest.warehack.ing) ---
|
||||
# Remote: warehack.ing (149.28.126.25)
|
||||
# User: warehack-ing (requires SSH agent forwarding for git pull)
|
||||
# Path: /home/warehack-ing/forrest-mims-library/site
|
||||
|
||||
PROD_HOST = warehack-ing@warehack.ing
|
||||
PROD_PATH = /home/warehack-ing/forrest-mims-library
|
||||
|
||||
# Full deploy: push, pull remote, rebuild container
|
||||
deploy: deploy-push deploy-pull deploy-rebuild
|
||||
|
||||
# Push local commits to Gitea
|
||||
deploy-push:
|
||||
git push origin main
|
||||
|
||||
# Pull latest on production server
|
||||
deploy-pull:
|
||||
ssh -A $(PROD_HOST) "cd $(PROD_PATH) && git pull origin main"
|
||||
|
||||
# Rebuild and restart production container
|
||||
deploy-rebuild:
|
||||
ssh -A $(PROD_HOST) "cd $(PROD_PATH)/site && MODE=production docker compose up -d --build"
|
||||
|
||||
# Check production container status
|
||||
deploy-status:
|
||||
ssh $(PROD_HOST) "docker ps --filter name=mims-library --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'"
|
||||
|
||||
# View production logs
|
||||
deploy-logs:
|
||||
ssh $(PROD_HOST) "docker logs mims-library --tail 20"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user