in ide/deploy/deploy.js [79:125]
export function deployAction(artifact) {
let pkg = '', name='', typ = '';
if (activeDeployments.has(artifact)) {
queue.push(artifact);
return;
}
activeDeployments.set(artifact, true);
const indexInQueue = queue.indexOf(artifact);
if (indexInQueue>-1) {
console.log(`> Deploying ${artifact} (from queue: ${indexInQueue})`);
}
try {
const sp = artifact.split("/");
const spData = sp[sp.length - 1].split(".");
name = spData[0];
typ = spData[1];
pkg = sp[1];
} catch {
console.log("! cannot deploy", artifact);
return;
}
deployPackage(pkg);
let toInspect;
if (typ === "zip") {
const base = artifact.slice(0, -4);
toInspect = MAINS.map((m) => `${base}/${m}`);
} else {
toInspect = [artifact];
}
const args = extractArgs(toInspect).join(" ");
const actionName = `${pkg}/${name}`;
exec(`$OPS action update ${actionName} ${artifact} ${args}`);
activeDeployments.delete(artifact);
if (queue.length > 0) {
const nextArtifact = queue.shift();
console.debug(`deploying from queue artifact ${nextArtifact}`);
deploy(nextArtifact);
}
}