(compose: Compose)
| 21 | import { encodeBase64 } from "./utils"; |
| 22 | |
| 23 | export 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 | |
| 45 | export const getComposePath = (compose: Compose) => { |
| 46 | const { COMPOSE_PATH } = paths(!!compose.serverId); |
no test coverage detected