mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-16 08:55:18 +00:00
Refactor Bitbucket repository cloning logic: remove unused parameter and enhance error handling by retrieving Bitbucket provider directly within the function.
This commit is contained in:
@@ -87,7 +87,6 @@ interface CloneBitbucketRepository {
|
|||||||
bitbucketOwner: string | null;
|
bitbucketOwner: string | null;
|
||||||
bitbucketBranch: string | null;
|
bitbucketBranch: string | null;
|
||||||
bitbucketId: string | null;
|
bitbucketId: string | null;
|
||||||
bitbucket: Bitbucket | null;
|
|
||||||
enableSubmodules: boolean;
|
enableSubmodules: boolean;
|
||||||
serverId: string | null;
|
serverId: string | null;
|
||||||
type?: "application" | "compose";
|
type?: "application" | "compose";
|
||||||
@@ -104,7 +103,6 @@ export const cloneBitbucketRepository = async ({
|
|||||||
bitbucketOwner,
|
bitbucketOwner,
|
||||||
bitbucketBranch,
|
bitbucketBranch,
|
||||||
bitbucketId,
|
bitbucketId,
|
||||||
bitbucket,
|
|
||||||
enableSubmodules,
|
enableSubmodules,
|
||||||
serverId,
|
serverId,
|
||||||
} = entity;
|
} = entity;
|
||||||
@@ -114,7 +112,12 @@ export const cloneBitbucketRepository = async ({
|
|||||||
command += `echo "Error: ❌ Bitbucket Provider not found"; exit 1;`;
|
command += `echo "Error: ❌ Bitbucket Provider not found"; exit 1;`;
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
const bitbucket = await findBitbucketById(bitbucketId);
|
||||||
|
|
||||||
|
if (!bitbucket) {
|
||||||
|
command += `echo "Error: ❌ Bitbucket Provider not found"; exit 1;`;
|
||||||
|
return command;
|
||||||
|
}
|
||||||
const basePath = type === "compose" ? COMPOSE_PATH : APPLICATIONS_PATH;
|
const basePath = type === "compose" ? COMPOSE_PATH : APPLICATIONS_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
command += `rm -rf ${outputPath};`;
|
command += `rm -rf ${outputPath};`;
|
||||||
|
|||||||
Reference in New Issue
Block a user