test: add detailed environment and connection testing
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m6s

This commit is contained in:
liquidrinu 2025-05-26 16:37:41 +02:00
parent 03f615bf57
commit 7e132608d7

@ -16,16 +16,13 @@ spec:
command: ["/bin/sh", "-c"]
args:
- |
echo "Environment variables:"
echo "POSTGRES_NAME: $POSTGRES_NAME"
echo "POSTGRES_HOSTNAME: $POSTGRES_HOSTNAME"
echo "POSTGRES_PORT: $POSTGRES_PORT"
echo "POSTGRES_USER: $POSTGRES_USER"
echo "Testing direct connection with psql..."
echo "=== Environment Variables ==="
env | grep POSTGRES
echo "=== Testing Direct Connection ==="
PGPASSWORD=$POSTGRES_PASSWORD psql -h $POSTGRES_HOSTNAME -p $POSTGRES_PORT -U $POSTGRES_USER -d $POSTGRES_NAME -c "SELECT 1"
echo "Testing direct connection with connection string..."
echo "=== Testing Connection String ==="
PGPASSWORD=$POSTGRES_PASSWORD psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOSTNAME:$POSTGRES_PORT/$POSTGRES_NAME" -c "SELECT 1"
echo "Testing MikroORM connection..."
echo "=== Testing MikroORM Connection ==="
node -e "
const { PostgreSqlDriver } = require('@mikro-orm/postgresql');
const { MikroORM } = require('@mikro-orm/core');
@ -49,8 +46,9 @@ spec:
process.exit(1);
});
"
echo "Running migrations and seeds..."
echo "=== Running Migrations ==="
npx mikro-orm migration:up
echo "=== Running Seeds ==="
npm run seed
env:
{{- range $key, $val := .Values.backend.env }}