mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-26 21:58:45 +00:00
refactor(settings): update dokploy image handling during service update
- Removed the deprecated getDokployImage function and replaced it with dynamic image retrieval based on available updates. - The service update now checks for available updates and uses the latest version from the update data, enhancing deployment efficiency.
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
|||||||
DEFAULT_UPDATE_DATA,
|
DEFAULT_UPDATE_DATA,
|
||||||
execAsync,
|
execAsync,
|
||||||
findServerById,
|
findServerById,
|
||||||
getDokployImage,
|
|
||||||
getDokployImageTag,
|
getDokployImageTag,
|
||||||
getLogCleanupStatus,
|
getLogCleanupStatus,
|
||||||
getUpdateData,
|
getUpdateData,
|
||||||
@@ -22,7 +21,6 @@ import {
|
|||||||
paths,
|
paths,
|
||||||
prepareEnvironmentVariables,
|
prepareEnvironmentVariables,
|
||||||
processLogs,
|
processLogs,
|
||||||
pullLatestRelease,
|
|
||||||
readConfig,
|
readConfig,
|
||||||
readConfigInPath,
|
readConfigInPath,
|
||||||
readDirectory,
|
readDirectory,
|
||||||
@@ -406,18 +404,17 @@ export const settingsRouter = createTRPCRouter({
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
await pullLatestRelease();
|
const data = await getUpdateData(packageInfo.version);
|
||||||
|
if (data.updateAvailable) {
|
||||||
// This causes restart of dokploy, thus it will not finish executing properly, so don't await it
|
void spawnAsync("docker", [
|
||||||
// Status after restart is checked via frontend /api/health endpoint
|
"service",
|
||||||
void spawnAsync("docker", [
|
"update",
|
||||||
"service",
|
"--force",
|
||||||
"update",
|
"--image",
|
||||||
"--force",
|
`dokploy/dokploy:${data.latestVersion}`,
|
||||||
"--image",
|
"dokploy",
|
||||||
getDokployImage(),
|
]);
|
||||||
"dokploy",
|
}
|
||||||
]);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user