mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-21 07:05:21 +02:00
refactor(compose): streamline command generation in deployCompose function
- Removed redundant command initialization and ensured proper command structure for deployment. - Enhanced clarity by consolidating command building logic, improving maintainability of the deployCompose function.
This commit is contained in:
@@ -248,7 +248,7 @@ export const deployCompose = async ({
|
||||
} else {
|
||||
await execAsync(commandWithLog);
|
||||
}
|
||||
|
||||
command = "set -e;";
|
||||
if (compose.sourceType !== "raw") {
|
||||
command += await generateApplyPatchesCommand({
|
||||
id: compose.composeId,
|
||||
@@ -257,7 +257,6 @@ export const deployCompose = async ({
|
||||
});
|
||||
}
|
||||
|
||||
command = "set -e;";
|
||||
command += await getBuildComposeCommand(entity);
|
||||
commandWithLog = `(${command}) >> ${deployment.logPath} 2>&1`;
|
||||
if (compose.serverId) {
|
||||
|
||||
@@ -146,7 +146,6 @@ export const generateApplyPatchesCommand = async ({
|
||||
const codePath = join(basePath, entity.appName, "code");
|
||||
|
||||
const resultPatches = await findPatchesByEntityId(id, type);
|
||||
|
||||
const patches = resultPatches.filter((p) => p.enabled);
|
||||
|
||||
let command = `echo "Applying ${patches.length} patch(es)...";`;
|
||||
@@ -159,7 +158,6 @@ export const generateApplyPatchesCommand = async ({
|
||||
rm -f "${filePath}";
|
||||
`;
|
||||
} else {
|
||||
// create and update: write file
|
||||
command += `
|
||||
file="${filePath}"
|
||||
dir="$(dirname "$file")"
|
||||
|
||||
Reference in New Issue
Block a user