Start/stop deployments
This commit is contained in:
@@ -164,3 +164,20 @@ export async function deployApp(
|
||||
fs.rmSync(deployPath, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
|
||||
export async function toggleDeployment(
|
||||
containerId: string,
|
||||
action: "start" | "stop",
|
||||
) {
|
||||
const container = docker.getContainer(containerId);
|
||||
|
||||
try {
|
||||
if (action === "start") {
|
||||
await container.start();
|
||||
} else {
|
||||
await container.stop();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Failed to ${action} container ${containerId}:`, err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user