This commit is contained in:
@@ -107,6 +107,57 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════════
|
||||||
|
# LOGGING: Smoke Test Phase
|
||||||
|
# ═══════════════════════════════════════════════════════════════════════════════
|
||||||
|
- name: 🧪 Run Smoke Test
|
||||||
|
run: |
|
||||||
|
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
|
||||||
|
echo "║ Step: Smoke Test ║"
|
||||||
|
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
|
||||||
|
echo ""
|
||||||
|
echo "🧪 Starting local smoke test to verify build integrity..."
|
||||||
|
|
||||||
|
# Start the application in the background
|
||||||
|
# We use the standalone output which is what runs in production
|
||||||
|
# We need to provide minimal env vars for it to start
|
||||||
|
export PORT=3001
|
||||||
|
export NODE_ENV=production
|
||||||
|
export NEXT_PUBLIC_BASE_URL="http://localhost:3001"
|
||||||
|
|
||||||
|
node .next/standalone/server.js &
|
||||||
|
APP_PID=$!
|
||||||
|
|
||||||
|
echo "⏳ Waiting for application to start on port 3001 (PID: $APP_PID)..."
|
||||||
|
|
||||||
|
# Wait for health check to pass
|
||||||
|
MAX_RETRIES=10
|
||||||
|
RETRY_COUNT=0
|
||||||
|
SUCCESS=false
|
||||||
|
|
||||||
|
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
|
||||||
|
if curl -s http://localhost:3001/health > /dev/null; then
|
||||||
|
SUCCESS=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo " • Waiting... ($((RETRY_COUNT + 1))/$MAX_RETRIES)"
|
||||||
|
sleep 3
|
||||||
|
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$SUCCESS" = true ]; then
|
||||||
|
echo "✅ Smoke test passed: Application started successfully"
|
||||||
|
kill $APP_PID
|
||||||
|
else
|
||||||
|
echo "❌ Smoke test failed: Application failed to start or health check timed out"
|
||||||
|
echo "🔍 Application Logs:"
|
||||||
|
# Try to get some logs before killing
|
||||||
|
kill -0 $APP_PID 2>/dev/null && sleep 2
|
||||||
|
kill $APP_PID
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
# ═══════════════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════════════
|
||||||
# LOGGING: Deployment Phase
|
# LOGGING: Deployment Phase
|
||||||
# ═══════════════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════════════
|
||||||
|
|||||||
@@ -37,13 +37,6 @@ RUN npx tsx scripts/validate-env.ts
|
|||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Smoke test during build to catch runtime errors early
|
|
||||||
# We start the app in the background, wait for it to be ready, and run the smoke test
|
|
||||||
RUN (node .next/standalone/server.js &) && \
|
|
||||||
npx wait-on -t 30000 http://localhost:3000/health && \
|
|
||||||
npx tsx scripts/smoke-test.ts http://localhost:3000/health && \
|
|
||||||
pkill -f "node .next/standalone/server.js"
|
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
1
lib/services/cache/redis-cache-service.ts
vendored
1
lib/services/cache/redis-cache-service.ts
vendored
@@ -1,6 +1,5 @@
|
|||||||
import { createClient, type RedisClientType } from 'redis';
|
import { createClient, type RedisClientType } from 'redis';
|
||||||
import type { CacheService, CacheSetOptions } from './cache-service';
|
import type { CacheService, CacheSetOptions } from './cache-service';
|
||||||
import { getServerAppServices } from '../create-services.server';
|
|
||||||
|
|
||||||
export type RedisCacheServiceOptions = {
|
export type RedisCacheServiceOptions = {
|
||||||
url: string;
|
url: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user