MCPcopy Create free account
hub / github.com/vercel/vercel / continueDeployment

Function continueDeployment

packages/client/src/continue.ts:19–183  ·  view source on GitHub ↗
(options: {
  agent?: Agent;
  apiUrl?: string;
  debug?: boolean;
  deploymentId: string;
  path: string;
  teamId?: string;
  token: string;
  userAgent?: string;
  vercelOutputDir?: string;
  archive?: ArchiveFormat;
})

Source from the content-addressed store, hash-verified

17 * events early.
18 */
19export async function* continueDeployment(options: {
20 agent?: Agent;
21 apiUrl?: string;
22 debug?: boolean;
23 deploymentId: string;
24 path: string;
25 teamId?: string;
26 token: string;
27 userAgent?: string;
28 vercelOutputDir?: string;
29 archive?: ArchiveFormat;
30}): AsyncIterableIterator<{ type: DeploymentEventType; payload: any }> {
31 const debug = createDebug(options.debug);
32 debug(`Continuing deployment: ${options.deploymentId}`);
33 const outputDir =
34 options.vercelOutputDir || join(options.path, '.vercel', 'output');
35
36 /**
37 * We need to ensure that the output directory exists before proceeding with
38 * the continuation. This is important because we only allow continuing for
39 * prebuilt deployments.
40 */
41 if (!(await fs.pathExists(outputDir))) {
42 return yield {
43 type: 'error',
44 payload: new DeploymentError({
45 code: 'output_dir_not_found',
46 message: `Output directory not found at ${outputDir}. Run 'vercel build' first.`,
47 }),
48 };
49 }
50
51 const { fileList } = await buildFileTree(
52 options.path,
53 { isDirectory: true, prebuilt: true, vercelOutputDir: outputDir },
54 debug
55 );
56
57 /**
58 * Files that must be sent individually (outside the tar archive) so the
59 * API can inspect them before the build starts.
60 */
61 const provisionJsonPath = join(outputDir, 'provision.json');
62 const unbundledFiles = fileList.filter(f => f === provisionJsonPath);
63
64 let files: FilesMap;
65 if (options.archive === 'tgz') {
66 files = await createTgzFiles(options.path, fileList, debug, unbundledFiles);
67 // Hash excluded files individually and merge them into the FilesMap
68 if (unbundledFiles.length > 0) {
69 const individualFiles = await hashes(unbundledFiles);
70 for (const [sha, entry] of individualFiles) {
71 files.set(sha, entry);
72 }
73 }
74 } else {
75 files = await hashes(fileList);
76 }

Callers 2

handleContinueDeploymentFunction · 0.90

Calls 14

createDebugFunction · 0.90
buildFileTreeFunction · 0.90
createTgzFilesFunction · 0.90
hashesFunction · 0.90
mapToObjectFunction · 0.90
uploadFilesFunction · 0.90
isReadyFunction · 0.90
isAliasAssignedFunction · 0.90
checkDeploymentStatusFunction · 0.90
postContinueFunction · 0.85
filterMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected