refactor(devops): reorganize rebuild targets for clarity
-- Rename 'build' to 'rebuild' for clarity (rebuilds all containers) -- Rename 'build-force' to 'rebuild-force' for consistency -- Add 'rebuild-app-force' target for app-only rebuild without cache -- Add 'rebuild-force-db' target that DELETES database for clean rebuild -- Improve help text to clarify what each target does -- Remove circular dependency (rebuild no longer depends on clean) -- All rebuild targets now preserve database unless explicitly stated
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
.PHONY: help test test-integration test-all build build-force clean rebuild rebuild-app restart up down logs ps test-env-up test-env-down verify-guidelines verify-quick
|
.PHONY: help test test-integration test-all rebuild rebuild-force rebuild-app rebuild-app-force rebuild-force-db clean restart up down logs ps test-env-up test-env-down verify-guidelines verify-quick
|
||||||
|
|
||||||
# Include .env file for environment variables (single source of truth)
|
# Include .env file for environment variables (single source of truth)
|
||||||
# Ignore if .env doesn't exist yet
|
# Ignore if .env doesn't exist yet
|
||||||
@@ -12,13 +12,15 @@ help:
|
|||||||
@echo "Available targets:"
|
@echo "Available targets:"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Development:"
|
@echo "Development:"
|
||||||
@echo " make up - Start containers (if already built)"
|
@echo " make up - Start containers (if already built)"
|
||||||
@echo " make build - Build and start all containers"
|
@echo " make rebuild - Rebuild all containers (database preserved)"
|
||||||
@echo " make rebuild-app - Rebuild app container only (fast, for development)"
|
@echo " make rebuild-force - Rebuild all containers, no cache (database preserved)"
|
||||||
@echo " make restart - Restart app container (preserves db)"
|
@echo " make rebuild-app - Rebuild app container only (fast, database preserved)"
|
||||||
@echo " make down - Stop all containers"
|
@echo " make rebuild-app-force - Rebuild app container only, no cache (database preserved)"
|
||||||
@echo " make rebuild - Clean, rebuild, and start all containers"
|
@echo " make rebuild-force-db - Rebuild all containers, no cache (DELETES database)"
|
||||||
@echo " make build-force - Force rebuild without cache (slow, use if needed)"
|
@echo " make restart - Restart app container (preserves db)"
|
||||||
|
@echo " make down - Stop all containers (preserves volumes)"
|
||||||
|
@echo " make clean - Stop and remove all containers and volumes"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Status & Logs:"
|
@echo "Status & Logs:"
|
||||||
@echo " make ps - Show container status"
|
@echo " make ps - Show container status"
|
||||||
@@ -66,22 +68,44 @@ test-integration:
|
|||||||
# Run all tests
|
# Run all tests
|
||||||
test-all: test test-integration
|
test-all: test test-integration
|
||||||
|
|
||||||
# Build and start containers
|
# Rebuild app container only (preserve DB, with cache)
|
||||||
build:
|
rebuild-app:
|
||||||
podman compose up --build --force-recreate -d
|
@echo "Rebuilding app container (database stays running)..."
|
||||||
|
podman compose up --build --force-recreate -d app
|
||||||
|
@echo "✓ App container rebuilt and restarted"
|
||||||
|
|
||||||
# Force rebuild without cache (slow, use if needed)
|
# Rebuild app container only (preserve DB, no cache)
|
||||||
build-force:
|
rebuild-app-force:
|
||||||
|
@echo "Force rebuilding app container (database stays running, no cache)..."
|
||||||
|
podman compose build --no-cache app
|
||||||
|
podman compose up --force-recreate -d app
|
||||||
|
@echo "✓ App container rebuilt and restarted"
|
||||||
|
|
||||||
|
# Rebuild all containers (preserve DB, with cache)
|
||||||
|
rebuild:
|
||||||
|
@echo "Rebuilding all containers (database preserved)..."
|
||||||
|
podman compose up --build --force-recreate -d
|
||||||
|
@echo "✓ All containers rebuilt and restarted"
|
||||||
|
|
||||||
|
# Rebuild all containers (preserve DB, no cache)
|
||||||
|
rebuild-force:
|
||||||
|
@echo "Force rebuilding all containers (database preserved, no cache)..."
|
||||||
podman compose build --no-cache
|
podman compose build --no-cache
|
||||||
podman compose up --force-recreate -d
|
podman compose up --force-recreate -d
|
||||||
|
@echo "✓ All containers rebuilt and restarted"
|
||||||
|
|
||||||
|
# Rebuild all containers (remove DB, no cache)
|
||||||
|
rebuild-force-db:
|
||||||
|
@echo "Force rebuilding all containers (database will be DELETED, no cache)..."
|
||||||
|
podman compose down -v
|
||||||
|
podman compose build --no-cache
|
||||||
|
podman compose up --force-recreate -d
|
||||||
|
@echo "✓ All containers rebuilt and restarted"
|
||||||
|
|
||||||
# Stop and remove containers
|
# Stop and remove containers
|
||||||
clean:
|
clean:
|
||||||
podman compose down -v
|
podman compose down -v
|
||||||
|
|
||||||
# Clean rebuild (remove volumes, rebuild, start)
|
|
||||||
rebuild: clean build
|
|
||||||
|
|
||||||
# Quick start (if already built)
|
# Quick start (if already built)
|
||||||
up:
|
up:
|
||||||
podman compose up -d
|
podman compose up -d
|
||||||
@@ -90,12 +114,6 @@ up:
|
|||||||
down:
|
down:
|
||||||
podman compose down
|
podman compose down
|
||||||
|
|
||||||
# Rebuild app container only (fast, for development)
|
|
||||||
rebuild-app:
|
|
||||||
@echo "Rebuilding app container only (database stays running)..."
|
|
||||||
podman compose up --build --force-recreate -d app
|
|
||||||
@echo "✓ App container rebuilt and restarted"
|
|
||||||
|
|
||||||
# Restart app container (preserves database)
|
# Restart app container (preserves database)
|
||||||
restart:
|
restart:
|
||||||
@echo "Restarting app container (database stays running)..."
|
@echo "Restarting app container (database stays running)..."
|
||||||
|
|||||||
Reference in New Issue
Block a user