mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-07 12:32:16 +00:00
refactor(patch): unify patch retrieval and application logic
- Consolidated patch retrieval for applications and composes into a single query method, improving code clarity and reducing redundancy. - Updated the ShowPatches component to utilize the new unified query, simplifying data fetching logic. - Refactored patch application commands to streamline the process for both application and compose types, enhancing maintainability and consistency across the codebase.
This commit is contained in:
@@ -44,10 +44,7 @@ import {
|
||||
issueCommentExists,
|
||||
updateIssueComment,
|
||||
} from "./github";
|
||||
import {
|
||||
findPatchesByApplicationId,
|
||||
generateApplyPatchesCommand,
|
||||
} from "./patch";
|
||||
import { generateApplyPatchesCommand } from "./patch";
|
||||
import {
|
||||
findPreviewDeploymentById,
|
||||
updatePreviewDeployment,
|
||||
@@ -206,20 +203,12 @@ export const deployApplication = async ({
|
||||
command += await buildRemoteDocker(application);
|
||||
}
|
||||
|
||||
// Apply patches after cloning (for non-docker sources only)
|
||||
if (application.sourceType !== "docker") {
|
||||
const patches = await findPatchesByApplicationId(
|
||||
application.applicationId,
|
||||
);
|
||||
const enabledPatches = patches.filter((p) => p.enabled);
|
||||
if (enabledPatches.length > 0) {
|
||||
command += generateApplyPatchesCommand({
|
||||
appName: application.appName,
|
||||
type: "application",
|
||||
serverId,
|
||||
patches: enabledPatches,
|
||||
});
|
||||
}
|
||||
command += await generateApplyPatchesCommand({
|
||||
id: application.applicationId,
|
||||
type: "application",
|
||||
serverId,
|
||||
});
|
||||
}
|
||||
|
||||
command += await getBuildCommand(application);
|
||||
|
||||
Reference in New Issue
Block a user