summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/script/promote-models.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/core/script/promote-models.ts')
-rwxr-xr-xpackages/console/core/script/promote-models.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/console/core/script/promote-models.ts b/packages/console/core/script/promote-models.ts
index 717813e40..0ff859df8 100755
--- a/packages/console/core/script/promote-models.ts
+++ b/packages/console/core/script/promote-models.ts
@@ -11,20 +11,21 @@ const root = path.resolve(process.cwd(), "..", "..", "..")
// read the secret
const ret = await $`bun sst secret list`.cwd(root).text()
-const value1 = ret
- .split("\n")
- .find((line) => line.startsWith("ZEN_MODELS1"))
- ?.split("=")[1]
-const value2 = ret
- .split("\n")
- .find((line) => line.startsWith("ZEN_MODELS2"))
- ?.split("=")[1]
+const lines = ret.split("\n")
+const value1 = lines.find((line) => line.startsWith("ZEN_MODELS1"))?.split("=")[1]
+const value2 = lines.find((line) => line.startsWith("ZEN_MODELS2"))?.split("=")[1]
+const value3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=")[1]
+const value4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1]
if (!value1) throw new Error("ZEN_MODELS1 not found")
if (!value2) throw new Error("ZEN_MODELS2 not found")
+if (!value3) throw new Error("ZEN_MODELS3 not found")
+if (!value4) throw new Error("ZEN_MODELS4 not found")
// validate value
-ZenData.validate(JSON.parse(value1 + value2))
+ZenData.validate(JSON.parse(value1 + value2 + value3 + value4))
// update the secret
await $`bun sst secret set ZEN_MODELS1 ${value1} --stage ${stage}`
await $`bun sst secret set ZEN_MODELS2 ${value2} --stage ${stage}`
+await $`bun sst secret set ZEN_MODELS3 ${value3} --stage ${stage}`
+await $`bun sst secret set ZEN_MODELS4 ${value4} --stage ${stage}`