Phase 1: Add ESLint/Prettier config + baseline auto-fixes
This commit is contained in:
@@ -37,7 +37,7 @@ module.exports = function(ctx, helpers) {
|
||||
return res.json({
|
||||
success: true,
|
||||
message: 'No services have deployment manifests to restore',
|
||||
results: []
|
||||
results: [],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ module.exports = function(ctx, helpers) {
|
||||
id: service.id,
|
||||
name: service.name,
|
||||
status: 'failed',
|
||||
error: error.message
|
||||
error: error.message,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ module.exports = function(ctx, helpers) {
|
||||
res.json({
|
||||
success: true,
|
||||
message: `Restore complete: ${succeeded} restored, ${skipped} skipped, ${failed} failed`,
|
||||
results
|
||||
results,
|
||||
});
|
||||
}, 'apps-restore-all'));
|
||||
|
||||
@@ -81,7 +81,7 @@ module.exports = function(ctx, helpers) {
|
||||
hasManifest: !!service.deploymentManifest,
|
||||
templateId: service.deploymentManifest?.templateId || service.appTemplate || null,
|
||||
deployedAt: service.deployedAt || null,
|
||||
containerRunning: false
|
||||
containerRunning: false,
|
||||
};
|
||||
|
||||
// Check if container is currently running
|
||||
@@ -125,7 +125,7 @@ module.exports = function(ctx, helpers) {
|
||||
name: service.name,
|
||||
status: 'restored',
|
||||
type: 'static',
|
||||
message: `Static site "${service.name}" config preserved`
|
||||
message: `Static site "${service.name}" config preserved`,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ module.exports = function(ctx, helpers) {
|
||||
id: service.id,
|
||||
name: service.name,
|
||||
status: 'skipped',
|
||||
message: 'Container already running'
|
||||
message: 'Container already running',
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -164,7 +164,7 @@ module.exports = function(ctx, helpers) {
|
||||
id: service.id,
|
||||
name: service.name,
|
||||
status: 'skipped',
|
||||
message: 'Container already running (found by name)'
|
||||
message: 'Container already running (found by name)',
|
||||
};
|
||||
}
|
||||
// Exists but not running — remove stale container
|
||||
@@ -178,7 +178,7 @@ module.exports = function(ctx, helpers) {
|
||||
id: service.id,
|
||||
name: service.name,
|
||||
status: 'failed',
|
||||
error: 'No container configuration in manifest'
|
||||
error: 'No container configuration in manifest',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ module.exports = function(ctx, helpers) {
|
||||
} catch (e) {
|
||||
// Check if image exists locally
|
||||
const images = await ctx.docker.client.listImages({
|
||||
filters: { reference: [manifest.container.image] }
|
||||
filters: { reference: [manifest.container.image] },
|
||||
});
|
||||
if (images.length === 0) {
|
||||
throw new Error(`Failed to pull image ${manifest.container.image}: ${e.message}`);
|
||||
@@ -206,7 +206,7 @@ module.exports = function(ctx, helpers) {
|
||||
PortBindings: {},
|
||||
Binds: manifest.container.volumes || [],
|
||||
RestartPolicy: { Name: 'unless-stopped' },
|
||||
LogConfig: DOCKER.LOG_CONFIG
|
||||
LogConfig: DOCKER.LOG_CONFIG,
|
||||
},
|
||||
Env: Object.entries(manifest.container.environment || {}).map(([k, v]) => `${k}=${v}`),
|
||||
Labels: {
|
||||
@@ -214,8 +214,8 @@ module.exports = function(ctx, helpers) {
|
||||
'sami.app': manifest.templateId,
|
||||
'sami.subdomain': manifest.config.subdomain,
|
||||
'sami.deployed': new Date().toISOString(),
|
||||
'sami.restored': 'true'
|
||||
}
|
||||
'sami.restored': 'true',
|
||||
},
|
||||
};
|
||||
|
||||
// Set up port bindings
|
||||
@@ -287,7 +287,7 @@ module.exports = function(ctx, helpers) {
|
||||
status: 'restored',
|
||||
type: 'container',
|
||||
containerId: container.id,
|
||||
message: `${service.name} restored successfully`
|
||||
message: `${service.name} restored successfully`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user