feat(core): add deployment_bundle artifact type and fromBundle deployment flag

Schema groundwork for pre-bundled deploys: the CLI bundles locally and
uploads the build context as a deployment_bundle artifact; fromBundle on
the initialize request and BuildServerMetadata signals that the build
server should skip install/bundle and only run the container build.
This commit is contained in:
Saadi Myftija
2026-07-21 18:22:13 +02:00
parent d04467018e
commit 81c5d4ed74
+8 -2
View File
@@ -654,6 +654,7 @@ export const BuildServerMetadata = z.object({
skipPromotion: z.boolean().optional(),
configFilePath: z.string().optional(),
skipEnqueue: z.boolean().optional(),
fromBundle: z.boolean().optional(),
});
export type BuildServerMetadata = z.infer<typeof BuildServerMetadata>;
@@ -720,7 +721,7 @@ export const UpsertBranchResponseBody = z.object({
export type UpsertBranchResponseBody = z.infer<typeof UpsertBranchResponseBody>;
export const CreateArtifactRequestBody = z.object({
type: z.enum(["deployment_context"]).default("deployment_context"),
type: z.enum(["deployment_context", "deployment_bundle"]).default("deployment_context"),
contentType: z.string().default("application/gzip"),
contentLength: z.number().optional(),
});
@@ -784,6 +785,7 @@ type NativeBuildOutput = BaseOutput & {
artifactKey?: string;
configFilePath?: string;
skipEnqueue?: boolean;
fromBundle?: boolean;
};
type NonNativeBuildOutput = BaseOutput & {
@@ -792,6 +794,7 @@ type NonNativeBuildOutput = BaseOutput & {
artifactKey?: never;
configFilePath?: never;
skipEnqueue?: never;
fromBundle?: never;
};
const InitializeDeploymentRequestBodyFull = InitializeDeploymentRequestBodyBase.extend({
@@ -800,6 +803,9 @@ const InitializeDeploymentRequestBodyFull = InitializeDeploymentRequestBodyBase.
artifactKey: z.string().optional(),
configFilePath: z.string().optional(),
skipEnqueue: z.boolean().optional().default(false),
// The uploaded artifact is a pre-built bundle (local install + bundle already done);
// the build server should skip install/bundle and only run the container build.
fromBundle: z.boolean().optional(),
}).superRefine((data, ctx) => {
if (data.force && !data.externalId) {
ctx.addIssue({
@@ -815,7 +821,7 @@ export const InitializeDeploymentRequestBody = InitializeDeploymentRequestBodyFu
if (data.isNativeBuild) {
return { ...data, isNativeBuild: true as const };
}
const { skipPromotion, artifactKey, configFilePath, skipEnqueue, ...rest } = data;
const { skipPromotion, artifactKey, configFilePath, skipEnqueue, fromBundle, ...rest } = data;
return { ...rest, isNativeBuild: false as const };
}
);