fix(builder): created processed file in the same directory as main stack.yml

This commit is contained in:
xenonwellz 2024-11-11 02:22:48 +01:00
parent c9b570e469
commit 65ee0a3e22

View File

@ -154,7 +154,7 @@ export const createCommand = (compose: ComposeNested) => {
? "docker-compose.processed.yml"
: "docker-compose.yml"
: composeType === "stack"
? "docker-compose.processed.yml"
? join(dirname(compose.composePath), "docker-compose.processed.yml")
: compose.composePath;
const baseCommand =
@ -206,11 +206,17 @@ export const getProcessComposeFileCommand = (compose: ComposeNested) => {
const composePath =
sourceType === "raw" ? "docker-compose.yml" : compose.composePath;
const destinationPath =
sourceType === "raw"
? "docker-compose.processed.yml"
: join(dirname(compose.composePath), "docker-compose.processed.yml");
let command = "";
if (composeType === "stack") {
command = [
"export $(grep -v '^#' .env | xargs)",
`docker stack config -c ${composePath} > docker-compose.processed.yml`,
`docker stack config -c ${composePath} > ${destinationPath}`,
].join(" && ");
}