feat: optimize development tasks for better workflow and reduced Docker overhead
- Streamlined task structure with clear recommendations - Added dev:up as main development task (replaces dev:full) - Added dev:build for explicit container building - Improved cleanup tasks: - dev:clean: Safe cleanup preserving network/proxy - dev:nuke: Full cleanup when network is corrupted - Added dev:restart for quick service restart - Added help task with clear task documentation - Removed redundant/conflicting tasks Benefits: - ✅ Reduced Docker download overhead (smart building) - ✅ Preserved network/proxy configuration (safe cleanup) - ✅ Simpler, more intuitive workflow - ✅ Clear task recommendations - ✅ Better separation of concerns between tasks Usage: - task dev:up # Start development (recommended) - task dev:build # Build containers (when dependencies change) - task dev:clean # Safe cleanup - task dev:nuke # Full cleanup (when network issues occur)
This commit is contained in:
69
Taskfile.yml
69
Taskfile.yml
@@ -8,6 +8,24 @@ vars:
|
|||||||
# ── Production ────────────────────────────────────────────────────────────────
|
# ── Production ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
help:
|
||||||
|
desc: Show available tasks
|
||||||
|
cmds:
|
||||||
|
- echo "Available tasks:"
|
||||||
|
- echo " dev:up - Start complete development server (recommended)"
|
||||||
|
- echo " dev:build - Build development containers"
|
||||||
|
- echo " dev:clean - Safe cleanup (preserves network)"
|
||||||
|
- echo " dev:nuke - Full cleanup (removes everything)"
|
||||||
|
- echo " dev:restart - Restart development services"
|
||||||
|
- echo " dev:down - Stop development environment"
|
||||||
|
- echo " dev:logs - Follow logs from all services"
|
||||||
|
- echo " api:logs - Follow API service logs"
|
||||||
|
- echo " web:logs - Follow Web service logs"
|
||||||
|
- echo " db:migrate - Run database migrations"
|
||||||
|
- echo " db:seed - Seed database with test data"
|
||||||
|
- echo " test:e2e - Run end-to-end tests"
|
||||||
|
- echo " test:unit - Run unit tests"
|
||||||
|
|
||||||
up:
|
up:
|
||||||
desc: Start all services (production)
|
desc: Start all services (production)
|
||||||
cmds:
|
cmds:
|
||||||
@@ -52,15 +70,20 @@ tasks:
|
|||||||
cmds:
|
cmds:
|
||||||
- npm run dev
|
- npm run dev
|
||||||
|
|
||||||
dev:full:
|
dev:up:
|
||||||
desc: Start complete development server (backend + frontend) with follow logs
|
desc: Start complete development server (recommended)
|
||||||
|
cmds:
|
||||||
|
- echo "Starting development environment..."
|
||||||
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} up -d {{.DEV_SERVICES}}"
|
||||||
|
- echo "Following logs... (Ctrl+C to stop)"
|
||||||
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} logs -f api web audio-worker nc-watcher"
|
||||||
|
|
||||||
|
dev:build:
|
||||||
|
desc: Build development containers (only when dependencies change)
|
||||||
cmds:
|
cmds:
|
||||||
- echo "Building development containers..."
|
- echo "Building development containers..."
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} build api web"
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} build --pull api web"
|
||||||
- echo "Starting development environment..."
|
- echo "Containers built successfully"
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} up -d {{.DEV_SERVICES}} web"
|
|
||||||
- echo "Following all logs... (Ctrl+C to stop)"
|
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} logs -f api web audio-worker nc-watcher"
|
|
||||||
|
|
||||||
dev:logs:
|
dev:logs:
|
||||||
desc: Follow logs in dev mode
|
desc: Follow logs in dev mode
|
||||||
@@ -73,22 +96,30 @@ tasks:
|
|||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} restart {{.SERVICE}}"
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} restart {{.SERVICE}}"
|
||||||
|
|
||||||
dev:clean:
|
dev:clean:
|
||||||
desc: Clean up development environment and rebuild
|
desc: Safe cleanup (preserves network/proxy, removes containers/volumes)
|
||||||
cmds:
|
cmds:
|
||||||
- echo "Stopping development services..."
|
- echo "Stopping development services..."
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} down -v"
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} down"
|
||||||
- echo "Removing old containers and volumes..."
|
- echo "Removing development volumes..."
|
||||||
- docker system prune -f
|
- docker volume rm -f $(docker volume ls -q | grep rehearsalhub) || true
|
||||||
- echo "Development environment cleaned"
|
- echo "Development environment cleaned (network preserved)"
|
||||||
|
|
||||||
dev:audio-debug:
|
dev:nuke:
|
||||||
desc: Start development with audio debugging enabled
|
desc: Full cleanup (removes everything including network - use when network is corrupted)
|
||||||
cmds:
|
cmds:
|
||||||
- echo "Starting development with audio debugging..."
|
- echo "WARNING: This will remove ALL rehearsalhub containers, networks, and volumes"
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} build api web"
|
- echo "Press Enter to continue or Ctrl+C to cancel"
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} up -d {{.DEV_SERVICES}}"
|
- read dummy
|
||||||
- echo "Audio service logs with debugging..."
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} down -v"
|
||||||
- "{{.COMPOSE}} {{.DEV_FLAGS}} logs -f api web"
|
- docker system prune -f --volumes
|
||||||
|
- echo "Complete cleanup performed"
|
||||||
|
|
||||||
|
dev:restart:
|
||||||
|
desc: Restart development services (preserves build cache)
|
||||||
|
cmds:
|
||||||
|
- echo "Restarting development services..."
|
||||||
|
- "{{.COMPOSE}} {{.DEV_FLAGS}} restart {{.DEV_SERVICES}}"
|
||||||
|
- echo "Services restarted"
|
||||||
|
|
||||||
# ── Database ──────────────────────────────────────────────────────────────────
|
# ── Database ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user