feat(deployment): implement recovery for interrupted rebuilds
This commit is contained in:
1 parent
f6ff607777
commit
0a16bd9b17
4 files changed
+229
-4
No files matched your search
@@ -42,6 +42,7 @@ import {
|
||||
startDeploymentLockHeartbeat,
|
||||
} from "../services/deployment-lock.service";
|
||||
import { sanitizeDeploymentError } from "../services/deployment-error.service";
|
||||
import { reconcileInterruptedRebuild } from "../services/deployment-recovery.service";
|
||||
import {
|
||||
formatDockerInspectMountBindings,
|
||||
type DockerInspectMount as DockerInspectRuntimeMount,
|
||||
@@ -1766,7 +1767,7 @@ export async function containerRoutes(app: FastifyInstance) {
|
||||
);
|
||||
const container = await prisma.container.findFirst({
|
||||
where: { id, server: { organizationId: req.organizationId! } },
|
||||
select: { id: true },
|
||||
include: { server: true },
|
||||
});
|
||||
if (!container) {
|
||||
return reply
|
||||
@@ -1774,6 +1775,11 @@ export async function containerRoutes(app: FastifyInstance) {
|
||||
.send({ success: false, error: "Container not found" });
|
||||
}
|
||||
|
||||
await reconcileInterruptedRebuild({
|
||||
container,
|
||||
inspectRuntime: ssh.dockerInspect,
|
||||
});
|
||||
|
||||
const data = await listDeployments({
|
||||
containerId: id,
|
||||
organizationId: req.organizationId!,
|
||||
@@ -3805,6 +3811,11 @@ export async function containerRoutes(app: FastifyInstance) {
|
||||
let gitAccessToken: string | undefined;
|
||||
|
||||
try {
|
||||
await reconcileInterruptedRebuild({
|
||||
container,
|
||||
inspectRuntime: ssh.dockerInspect,
|
||||
});
|
||||
|
||||
if (container.sourceType === "APP_INSTALLER") {
|
||||
const install = await prisma.appInstall.findFirst({
|
||||
where: {
|
||||
|
||||
Reference in new issue
Block a user