mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-26 08:15:25 +02:00
refactor(patch): simplify patch repository management and enhance git configuration handling
- Removed redundant helper functions for retrieving git configurations for applications and composes, streamlining the codebase. - Updated the `ensurePatchRepo` function to directly handle repository cloning based on the application or compose type, improving clarity and maintainability. - Refactored patch creation logic to eliminate unnecessary checks and streamline the process of creating patches. - Enhanced the handling of output paths in repository cloning functions across different git providers, ensuring consistent behavior.
This commit is contained in:
@@ -107,6 +107,7 @@ interface CloneGitlabRepository {
|
||||
enableSubmodules: boolean;
|
||||
serverId: string | null;
|
||||
type?: "application" | "compose";
|
||||
outputPathOverride?: string;
|
||||
}
|
||||
|
||||
export const cloneGitlabRepository = async ({
|
||||
@@ -121,6 +122,7 @@ export const cloneGitlabRepository = async ({
|
||||
gitlabPathNamespace,
|
||||
enableSubmodules,
|
||||
serverId,
|
||||
outputPathOverride,
|
||||
} = entity;
|
||||
const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(!!serverId);
|
||||
|
||||
@@ -141,7 +143,7 @@ export const cloneGitlabRepository = async ({
|
||||
}
|
||||
|
||||
const basePath = type === "compose" ? COMPOSE_PATH : APPLICATIONS_PATH;
|
||||
const outputPath = join(basePath, appName, "code");
|
||||
const outputPath = outputPathOverride ?? join(basePath, appName, "code");
|
||||
command += `rm -rf ${outputPath};`;
|
||||
command += `mkdir -p ${outputPath};`;
|
||||
const repoClone = getGitlabRepoClone(gitlab, gitlabPathNamespace);
|
||||
|
||||
Reference in New Issue
Block a user