(compose: ComposeNested)
| 78 | }; |
| 79 | |
| 80 | export const createCommand = (compose: ComposeNested) => { |
| 81 | const { composeType, appName, sourceType } = compose; |
| 82 | if (compose.command) { |
| 83 | return `${sanitizeCommand(compose.command)}`; |
| 84 | } |
| 85 | |
| 86 | const path = |
| 87 | sourceType === "raw" ? "docker-compose.yml" : compose.composePath; |
| 88 | let command = ""; |
| 89 | |
| 90 | if (composeType === "docker-compose") { |
| 91 | command = `compose -p ${appName} -f ${path} up -d --build --remove-orphans`; |
| 92 | } else if (composeType === "stack") { |
| 93 | command = `stack deploy -c ${path} ${appName} --prune --with-registry-auth`; |
| 94 | } |
| 95 | |
| 96 | return command; |
| 97 | }; |
| 98 | |
| 99 | export const getCreateEnvFileCommand = (compose: ComposeNested) => { |
| 100 | const { COMPOSE_PATH } = paths(!!compose.serverId); |
no test coverage detected