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:
parent
fdb3c132de
commit
bfddd203ca
|
|
@ -509,13 +509,19 @@ stop_service() {
|
||||||
|
|
||||||
rebuild_service() {
|
rebuild_service() {
|
||||||
local service="$1"
|
local service="$1"
|
||||||
|
local no_cache="$2"
|
||||||
if [ -z "$service" ]; then
|
if [ -z "$service" ]; then
|
||||||
log_error "Please specify a service name"
|
log_error "Please specify a service name"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_info "Rebuilding $service..."
|
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"
|
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d "$service"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -570,7 +576,7 @@ case "${1:-}" in
|
||||||
stop_service "$2"
|
stop_service "$2"
|
||||||
;;
|
;;
|
||||||
rebuild-svc)
|
rebuild-svc)
|
||||||
rebuild_service "$2"
|
rebuild_service "$2" "$3"
|
||||||
;;
|
;;
|
||||||
infra-up)
|
infra-up)
|
||||||
infra_up
|
infra_up
|
||||||
|
|
@ -610,7 +616,7 @@ case "${1:-}" in
|
||||||
echo "Single Service Commands:"
|
echo "Single Service Commands:"
|
||||||
echo " start-svc <name> - Start a specific service"
|
echo " start-svc <name> - Start a specific service"
|
||||||
echo " stop-svc <name> - Stop 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 ""
|
||||||
echo "Infrastructure Commands:"
|
echo "Infrastructure Commands:"
|
||||||
echo " infra-up - Start infrastructure (postgres, redis, kafka)"
|
echo " infra-up - Start infrastructure (postgres, redis, kafka)"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue