diff --git a/npm-packages/convex/src/cli/configure.ts b/npm-packages/convex/src/cli/configure.ts index e0942057..89adde3f 100644 --- a/npm-packages/convex/src/cli/configure.ts +++ b/npm-packages/convex/src/cli/configure.ts @@ -110,6 +110,7 @@ export async function deploymentCredentialsOrConfigure( teamSlug, projectSlug, deploymentOptions, + partitionId, }); await updateEnvAndConfigForDeploymentSelection(ctx, { url, @@ -423,6 +424,7 @@ async function ensureDeploymentProvisioned( teamSlug: string; projectSlug: string; deploymentOptions: DeploymentOptions; + partitionId: number | undefined; }, ): Promise { switch (options.deploymentOptions.kind) { @@ -433,6 +435,7 @@ async function ensureDeploymentProvisioned( ctx, { teamSlug: options.teamSlug, projectSlug: options.projectSlug }, options.deploymentOptions.kind, + options.partitionId, ); return { ...credentials, diff --git a/npm-packages/convex/src/cli/deploy.ts b/npm-packages/convex/src/cli/deploy.ts index 1cf29bd3..6ea130a6 100644 --- a/npm-packages/convex/src/cli/deploy.ts +++ b/npm-packages/convex/src/cli/deploy.ts @@ -118,6 +118,7 @@ export const deploy = new Command("deploy") .conflicts("preview-create"), ) .addOption(new Option("--live-component-sources").hideHelp()) + .addOption(new Option("--partition-id ").hideHelp()) .showHelpAfterError() .action(async (cmdOptions) => { const ctx = oneoffContext(); @@ -284,6 +285,7 @@ async function deployToExistingDeployment( url?: string | undefined; writePushRequest?: string | undefined; liveComponentSources?: boolean | undefined; + partitionId?: string | undefined; }, ) { const deploymentSelection = deploymentSelectionFromOptions({ diff --git a/npm-packages/convex/src/cli/lib/api.ts b/npm-packages/convex/src/cli/lib/api.ts index 3503cf79..98840edc 100644 --- a/npm-packages/convex/src/cli/lib/api.ts +++ b/npm-packages/convex/src/cli/lib/api.ts @@ -132,7 +132,7 @@ export type DeploymentSelection = | { kind: "deployKey" } | { kind: "previewName"; previewName: string } | { kind: "deploymentName"; deploymentName: string } - | { kind: "ownProd" } + | { kind: "ownProd"; partitionId?: number | undefined } | { kind: "ownDev" } | { kind: "urlWithAdminKey"; url: string; adminKey: string } | { kind: "urlWithLogin"; url: string }; @@ -154,6 +154,7 @@ export type DeploymentSelectionOptions = { deploymentName?: string | undefined; url?: string | undefined; adminKey?: string | undefined; + partitionId?: string | undefined; }; export function deploymentSelectionFromOptions( @@ -176,7 +177,13 @@ export function deploymentSelectionFromOptions( if (adminKey !== undefined) { return { kind: "deployKey" }; } - return { kind: options.prod === true ? "ownProd" : "ownDev" }; + const partitionId = options.partitionId + ? parseInt(options.partitionId) + : undefined; + return { + kind: options.prod === true ? "ownProd" : "ownDev", + partitionId, + }; } // Deploy @@ -342,6 +349,7 @@ async function fetchDeploymentCredentialsWithinCurrentProjectInner( url: "deployment/authorize_prod", data: { deploymentName: configuredDeployment, + partitionId: deploymentSelection.partitionId, }, }); case "previewName": @@ -514,6 +522,7 @@ export async function fetchDeploymentCredentialsProvisioningDevOrProdMaybeThrows ctx: Context, { teamSlug, projectSlug }: { teamSlug: string; projectSlug: string }, deploymentType: DeploymentType, + partitionId: number | undefined, ): Promise<{ deploymentName: string; deploymentUrl: string; @@ -527,6 +536,7 @@ export async function fetchDeploymentCredentialsProvisioningDevOrProdMaybeThrows teamSlug, projectSlug, deploymentType, + partitionId, }, }); const deploymentName = data.deploymentName;