Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat(deploy): inject assembler service env from workspaces table (#1315)

Brad Barbin4d9987e44fb1
diff --git a/ci/src/deploy.ts b/ci/src/deploy.ts
index 1532a0c56e..f324ffd767 100644
--- a/ci/src/deploy.ts
+++ b/ci/src/deploy.ts
@@ -107,6 +107,8 @@ async function deploy(): Promise<void> {
console.log(`✅ 🥚 Migrating ${workspace.id}`);
const {
anon_key,
+ assembler_api_key,
+ assembler_domain,
auth_providers,
aws_account_id,
aws_region,
@@ -254,12 +256,22 @@ async function deploy(): Promise<void> {
console.log(`✅ 🔑 Setting up environment for ${workspace.id}`);
+ // Normalize the assembler domain into a full URL, tolerating a value that
+ // already includes a scheme (avoids "https://https://...").
+ const assembler_service_url = assembler_domain
+ ? /^https?:\/\//.test(assembler_domain)
+ ? assembler_domain
+ : `https://${assembler_domain}`
+ : undefined;
+
const $$ = $({
// @ts-ignore
env: {
AWS_ACCOUNT_ID: aws_account_id,
AWS_REGION: aws_region,
IMAGE_TAG: imageTag,
+ ASSEMBLER_SERVICE_API_KEY: assembler_api_key ?? undefined,
+ ASSEMBLER_SERVICE_URL: assembler_service_url,
AUTH_PROVIDERS: auth_providers ?? undefined,
CARBON_EDITION: carbon_edition ?? "enterprise",
CERT_ARN_ERP: cert_arn_erp,
diff --git a/sst.config.ts b/sst.config.ts
index 8c6f7b8864..eea37721ce 100644
--- a/sst.config.ts
+++ b/sst.config.ts
@@ -44,6 +44,8 @@ export default $config({
memoryUtilization: 80,
},
environment: {
+ ASSEMBLER_SERVICE_API_KEY: process.env.ASSEMBLER_SERVICE_API_KEY,
+ ASSEMBLER_SERVICE_URL: process.env.ASSEMBLER_SERVICE_URL,
AUTH_PROVIDERS: process.env.AUTH_PROVIDERS,
CARBON_EDITION: process.env.CARBON_EDITION,
CLOUDFLARE_TURNSTILE_SECRET_KEY:
@@ -141,6 +143,8 @@ export default $config({
memoryUtilization: 80,
},
environment: {
+ ASSEMBLER_SERVICE_API_KEY: process.env.ASSEMBLER_SERVICE_API_KEY,
+ ASSEMBLER_SERVICE_URL: process.env.ASSEMBLER_SERVICE_URL,
AUTH_PROVIDERS: process.env.AUTH_PROVIDERS,
CARBON_EDITION: process.env.CARBON_EDITION,
CLOUDFLARE_TURNSTILE_SECRET_KEY: