mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-18 22:36:19 +00:00
fix: implement atomic deployment rollbacks and custom scrollbar UI
This commit is contained in:
@@ -1083,8 +1083,14 @@ app.post('/api/templates/deploy', async (req: Request, res: Response) => {
|
||||
await fsPromises.writeFile(defaultEnvPath, envString, 'utf-8');
|
||||
}
|
||||
|
||||
// 4. Deploy the stack
|
||||
await composeService.deployStack(stackName, terminalWs || undefined);
|
||||
// 4. Deploy the stack with atomic rollback
|
||||
try {
|
||||
await composeService.deployStack(stackName, terminalWs || undefined);
|
||||
} catch (deployError) {
|
||||
// ATOMIC ROLLBACK: If Docker fails, delete the folder we just created
|
||||
await fileSystemService.deleteStack(stackName);
|
||||
throw deployError; // Pass error to outer catch block
|
||||
}
|
||||
|
||||
res.json({ success: true, message: 'Template deployed successfully' });
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user