chore: improve DX scripts, fix test suite, and harden tooling
All checks were successful
Deploy to Production / test (push) Successful in 32s
All checks were successful
Deploy to Production / test (push) Successful in 32s
Scripts: - remote.sh: remove unused open_browser() function - deploy-remote.sh: add DB backup before deploy, --skip-backup flag, step numbering - db-backup.sh: fix macOS compat (xargs -r is GNU-only), use portable approach - db-restore.sh: add safety backup before restore, SQL file validation, file size display - logs.sh: default to no-follow with --tail=100, order-independent arg parsing - docker-cleanup.sh: add Docker health check, colored output - test-sequential.sh: exclude *.integration.test.ts by default, add --integration flag - simulate-ci.sh: pass --integration flag (has real DB) Tests: - db.test.ts: fix mock path from ./DrizzleClient to @shared/db/DrizzleClient - server.settings.test.ts: rewrite mocks for gameSettingsService (old config/saveConfig removed) - server.test.ts: add missing config.lootdrop and BotClient mocks, complete DrizzleClient chain - indexes.test.ts: rename to indexes.integration.test.ts (requires live DB) Config: - package.json: test script uses sequential runner, add test:ci and db:restore aliases - deploy.yml: use --integration flag in CI (has Postgres service)
This commit is contained in:
@@ -2,37 +2,53 @@
|
||||
# =============================================================================
|
||||
# Aurora Log Viewer
|
||||
# =============================================================================
|
||||
# Usage: ./logs.sh [app|db|all] [-f]
|
||||
# Default: app container, follow mode
|
||||
# Usage: ./logs.sh [app|db|all] [-f|--follow]
|
||||
# Default: app container, no follow (shows last 100 lines)
|
||||
#
|
||||
# Examples:
|
||||
# ./logs.sh # Last 100 lines of app logs
|
||||
# ./logs.sh -f # Follow app logs in real-time
|
||||
# ./logs.sh db -f # Follow db logs in real-time
|
||||
# ./logs.sh all # Last 100 lines of all logs
|
||||
# =============================================================================
|
||||
|
||||
SERVICE=${1:-app}
|
||||
FOLLOW="-f"
|
||||
SERVICE="app"
|
||||
FOLLOW=""
|
||||
TAIL_LINES="--tail=100"
|
||||
|
||||
if [[ "$1" == "-f" ]]; then
|
||||
SERVICE="app"
|
||||
FOLLOW="-f"
|
||||
elif [[ "$2" == "-f" ]]; then
|
||||
FOLLOW="-f"
|
||||
elif [[ "$2" == "--no-follow" ]]; then
|
||||
FOLLOW=""
|
||||
fi
|
||||
# Parse arguments (order-independent)
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
-f|--follow)
|
||||
FOLLOW="-f"
|
||||
TAIL_LINES="" # When following, start from current output
|
||||
;;
|
||||
app|db|all)
|
||||
SERVICE="$arg"
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option: $arg"
|
||||
echo "Usage: ./logs.sh [app|db|all] [-f|--follow]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "📋 Fetching logs for service: $SERVICE..."
|
||||
|
||||
case $SERVICE in
|
||||
app)
|
||||
docker compose logs $FOLLOW app
|
||||
docker compose logs $FOLLOW $TAIL_LINES app
|
||||
;;
|
||||
db)
|
||||
docker compose logs $FOLLOW db
|
||||
docker compose logs $FOLLOW $TAIL_LINES db
|
||||
;;
|
||||
all)
|
||||
docker compose logs $FOLLOW
|
||||
docker compose logs $FOLLOW $TAIL_LINES
|
||||
;;
|
||||
*)
|
||||
echo "Unknown service: $SERVICE"
|
||||
echo "Usage: ./logs.sh [app|db|all] [-f]"
|
||||
echo "Usage: ./logs.sh [app|db|all] [-f|--follow]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user