From c3b7940f7d1c43eb1be8a83a6c8c5690a543efa6 Mon Sep 17 00:00:00 2001 From: Qian Li Date: Fri, 18 Oct 2024 18:40:52 -0700 Subject: [PATCH] Fix env substitution bug in deploy (#651) Need to substitute env variables when checking the config file during deploy. --- packages/dbos-cloud/applications/deploy-app-code.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/dbos-cloud/applications/deploy-app-code.ts b/packages/dbos-cloud/applications/deploy-app-code.ts index c510facc..4c74f02f 100644 --- a/packages/dbos-cloud/applications/deploy-app-code.ts +++ b/packages/dbos-cloud/applications/deploy-app-code.ts @@ -23,8 +23,9 @@ import fg from "fast-glob"; import chalk from "chalk"; import { registerApp } from "./register-app.js"; import { Logger } from "winston"; -import { loadConfigFile } from "../configutils.js"; import { chooseAppDBServer } from "../databases/databases.js"; +import YAML from "yaml"; +import { ConfigFile } from "../configutils.js"; type DeployOutput = { ApplicationName: string; @@ -130,7 +131,8 @@ export async function deployAppCode( const appRegistered = await isAppRegistered(logger, host, appName, userCredentials); // If the app is not registered, register it. - const dbosConfig = loadConfigFile(dbosConfigFilePath); + const interpolatedConfig = readInterpolatedConfig(dbosConfigFilePath, logger); + const dbosConfig = YAML.parse(interpolatedConfig) as ConfigFile; if (appRegistered === undefined) { userDBName = await chooseAppDBServer(logger, host, userCredentials, userDBName);