MCPcopy
hub / github.com/Dokploy/dokploy / cloneCompose

Function cloneCompose

packages/server/src/utils/docker/domain.ts:23–43  ·  view source on GitHub ↗
(compose: Compose)

Source from the content-addressed store, hash-verified

21import { encodeBase64 } from "./utils";
22
23export const cloneCompose = async (compose: Compose) => {
24 let command = "set -e;";
25 const entity = {
26 ...compose,
27 type: "compose" as const,
28 };
29 if (compose.sourceType === "github") {
30 command += await cloneGithubRepository(entity);
31 } else if (compose.sourceType === "gitlab") {
32 command += await cloneGitlabRepository(entity);
33 } else if (compose.sourceType === "bitbucket") {
34 command += await cloneBitbucketRepository(entity);
35 } else if (compose.sourceType === "git") {
36 command += await cloneGitRepository(entity);
37 } else if (compose.sourceType === "gitea") {
38 command += await cloneGiteaRepository(entity);
39 } else if (compose.sourceType === "raw") {
40 command += getCreateComposeFileCommand(compose);
41 }
42 return command;
43};
44
45export const getComposePath = (compose: Compose) => {
46 const { COMPOSE_PATH } = paths(!!compose.serverId);

Callers 3

loadServicesFunction · 0.90
compose.tsFile · 0.90

Calls 6

cloneGithubRepositoryFunction · 0.90
cloneGitlabRepositoryFunction · 0.90
cloneBitbucketRepositoryFunction · 0.90
cloneGitRepositoryFunction · 0.90
cloneGiteaRepositoryFunction · 0.90

Tested by

no test coverage detected