MCPcopy
hub / github.com/apify/crawlee / pushActor

Function pushActor

test/e2e/tools.mjs:71–104  ·  view source on GitHub ↗
(client, dirName)

Source from the content-addressed store, hash-verified

69}
70
71export async function pushActor(client, dirName) {
72 await copyPackages(dirName);
73 try {
74 // Capture all stdio (default would inherit stderr and flood the runner
75 // with the platform's Docker/npm build output on every test). The
76 // catch block below re-prints stdout/stderr if the push itself fails,
77 // so failure diagnostics stay intact. maxBuffer bumped because the
78 // build log can be tens of MB.
79 execSync('apify push', {
80 cwd: dirName,
81 env: { ...process.env, GIT_CEILING_DIRECTORIES: dirname(dirName) },
82 stdio: 'pipe',
83 maxBuffer: 50 * 1024 * 1024,
84 });
85 } catch (err) {
86 console.error(colors.red(`Failed to push actor to the Apify platform. (signal ${colors.yellow(err.signal)})`));
87
88 if (err.stdout) {
89 console.log(colors.grey(` STDOUT: `), err.stdout);
90 }
91
92 if (err.stderr) {
93 console.log(colors.red(` STDERR: `), err.stderr);
94 }
95
96 throw err;
97 }
98
99 const actorName = await getActorName(dirName);
100 const { items: actors } = await client.actors().list();
101 const { id } = actors.find((actor) => actor.name === actorName);
102
103 return id;
104}
105
106export async function startActorOnPlatform(client, id, input, inputContentType = 'application/json', memory = 4096) {
107 const gotClient = got.extend({

Callers 2

test.mjsFile · 0.90
runActorFunction · 0.85

Calls 6

copyPackagesFunction · 0.85
execSyncFunction · 0.85
getActorNameFunction · 0.85
logMethod · 0.80
findMethod · 0.80
listMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…