Files
orca/config/build-plugins/cloud-build-defaults.ts
T

14 lines
702 B
TypeScript

import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
/** Integration-branch backends baked into main (packaged builds read no shell env); build-time env overrides the file. */
export function cloudBuildDefaultsDefine(env: NodeJS.ProcessEnv = process.env): string {
const file: { billingApiUrl?: string; cloudSandboxUrl?: string; allowDevSigning?: boolean } =
JSON.parse(readFileSync(resolve('config/cloud-build-defaults.json'), 'utf8'))
return JSON.stringify({
billingApiUrl: env.ORCA_BUILD_BILLING_API_URL || file.billingApiUrl,
cloudSandboxUrl: env.ORCA_BUILD_CLOUD_SANDBOX_URL || file.cloudSandboxUrl,
allowDevSigning: file.allowDevSigning === true
})
}