fix: filter undefined values in config and update build files (#5610)

This commit is contained in:
Mir Arif Hasan 2025-11-24 19:55:08 +06:00 committed by GitHub
parent 904a1b0405
commit 92031c84c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View file

@ -7,6 +7,7 @@
"license": "UNLICENSED",
"files": [
"prisma",
"prisma.config.ts",
"dist",
"src/mailer/templates"
],
@ -22,7 +23,7 @@
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"postinstall": "prisma generate && pnpm run generate-gql-sdl",
"postinstall": "cross-env DATABASE_URL=postgresql://placeholder:placeholder@localhost:5432/placeholder prisma generate && pnpm run generate-gql-sdl",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",

View file

@ -525,10 +525,12 @@ export class InfraConfigService implements OnModuleInit {
const onboardingRecoveryToken = crypto.randomUUID();
const configEntries: InfraConfigArgs[] = [
...Object.entries(dto).map(([key, value]) => ({
name: key as InfraConfigEnum,
value,
})),
...Object.entries(dto)
.filter(([_, value]) => value !== undefined)
.map(([key, value]) => ({
name: key as InfraConfigEnum,
value,
})),
{
name: InfraConfigEnum.ONBOARDING_COMPLETED,
value: 'true',

View file

@ -83,6 +83,7 @@ RUN apk add --no-cache python3 make g++ zlib-dev brotli-dev c-ares-dev nghttp2-d
WORKDIR /usr/src/app
ENV HOPP_ALLOW_RUNTIME_ENV=true
ENV DATABASE_URL="postgresql://placeholder:placeholder@localhost:5432/placeholder"
COPY pnpm-lock.yaml .
RUN pnpm fetch
@ -94,6 +95,7 @@ RUN pnpm install -f --prefer-offline
FROM base_builder AS backend_builder
WORKDIR /usr/src/app/packages/hoppscotch-backend
ENV DATABASE_URL="postgresql://placeholder:placeholder@localhost:5432/placeholder"
RUN pnpm exec prisma generate
RUN pnpm run build
RUN pnpm --filter=hoppscotch-backend deploy /dist/backend --prod --legacy