feat(services): add --no-cache option to rebuild-svc command

Usage: ./deploy.sh rebuild-svc <name> --no-cache

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-07 08:46:00 -08:00
parent fdb3c132de
commit bfddd203ca
1 changed files with 9 additions and 3 deletions

View File

@ -509,13 +509,19 @@ stop_service() {
rebuild_service() {
local service="$1"
local no_cache="$2"
if [ -z "$service" ]; then
log_error "Please specify a service name"
exit 1
fi
log_info "Rebuilding $service..."
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" build "$service"
if [ "$no_cache" = "--no-cache" ]; then
log_info "Building without cache..."
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" build --no-cache "$service"
else
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" build "$service"
fi
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d "$service"
}
@ -570,7 +576,7 @@ case "${1:-}" in
stop_service "$2"
;;
rebuild-svc)
rebuild_service "$2"
rebuild_service "$2" "$3"
;;
infra-up)
infra_up
@ -610,7 +616,7 @@ case "${1:-}" in
echo "Single Service Commands:"
echo " start-svc <name> - Start a specific service"
echo " stop-svc <name> - Stop a specific service"
echo " rebuild-svc <name> - Rebuild and restart a specific service"
echo " rebuild-svc <name> [--no-cache] - Rebuild and restart a specific service"
echo ""
echo "Infrastructure Commands:"
echo " infra-up - Start infrastructure (postgres, redis, kafka)"