mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-27 18:15:23 +02: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,
|
||||
execAsync,
|
||||
findServerById,
|
||||
getDokployImage,
|
||||
getDokployImageTag,
|
||||
getLogCleanupStatus,
|
||||
getUpdateData,
|
||||
@@ -22,7 +21,6 @@ import {
|
||||
paths,
|
||||
prepareEnvironmentVariables,
|
||||
processLogs,
|
||||
pullLatestRelease,
|
||||
readConfig,
|
||||
readConfigInPath,
|
||||
readDirectory,
|
||||
@@ -406,18 +404,17 @@ export const settingsRouter = createTRPCRouter({
|
||||
return true;
|
||||
}
|
||||
|
||||
await pullLatestRelease();
|
||||
|
||||
// This causes restart of dokploy, thus it will not finish executing properly, so don't await it
|
||||
// Status after restart is checked via frontend /api/health endpoint
|
||||
void spawnAsync("docker", [
|
||||
"service",
|
||||
"update",
|
||||
"--force",
|
||||
"--image",
|
||||
getDokployImage(),
|
||||
"dokploy",
|
||||
]);
|
||||
const data = await getUpdateData(packageInfo.version);
|
||||
if (data.updateAvailable) {
|
||||
void spawnAsync("docker", [
|
||||
"service",
|
||||
"update",
|
||||
"--force",
|
||||
"--image",
|
||||
`dokploy/dokploy:${data.latestVersion}`,
|
||||
"dokploy",
|
||||
]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user