Skip to content

Commit

Permalink
No progress but docker ps
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Sep 18, 2024
1 parent a51258e commit 52279d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/executor/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ class DockerExecutor {
} else {
composeObject.services = services;
}
composeObject.services = this.rewriteServices(composeObject.services, domain);
composeObject.services = await this.rewriteServices(composeObject.services, domain);
let composeFile = yaml.stringify(composeObject);
await executeLock('compose', () => {
return new Promise((resolve, reject) => {
ShellString(composeFile).to(filename)
ShellString(composeFile).to(tmpFile)
spawnSudoUtil('COMPOSE_SET', [filename]).then(resolve).catch(reject);
});
});
Expand Down
8 changes: 8 additions & 0 deletions src/executor/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export default async function runConfig(config, domain, writer, sandbox = false)
sshExec = ( /** @type {string} */ cmd, write = true) => {
return new Promise(function (resolve, reject) {
if (!ssh) return reject("shell has terminated already");
let first = true;
cb = (/** @type {string} */ chunk, code) => {
if (!ssh) {
if (code) {
Expand All @@ -159,10 +160,17 @@ export default async function runConfig(config, domain, writer, sandbox = false)
}
resolve();
return true;
} else if (first && chunk.startsWith("<")) {
// stdin line skips
if (chunk.includes("\n")) {
first = false;
}
return false;
} else {
if (write && chunk) {
writer(chunk);
}
first = false;
return false;
}
};
Expand Down
5 changes: 3 additions & 2 deletions src/executor/runnersub.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,9 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec,
if (config.services) {
await writeLog("$> Removing docker compose services if exists");
if (typeof config.services == 'string') {
await sshExec(`docker compose -f ${config.services} --progress plain down --remove-orphans --rmi all || true`);
await sshExec(`docker compose -f ${config.services} --progress quiet down --remove-orphans --rmi all || true`);
} else {
await sshExec(`docker compose --progress-plain down --remove-orphans --rmi all || true`);
await sshExec(`docker compose --progress-plain quiet --remove-orphans --rmi all || true`);
}
await writeLog("$> Writing docker compose services");
let d = await dockerExec.executeServices(config.services, subdomaindata['Home directory'] + '/public_html', subdomain);
Expand All @@ -485,6 +485,7 @@ export async function runConfigSubdomain(config, domaindata, subdomain, sshExec,
} else {
await sshExec(`docker compose up --build --detach`);
}
await sshExec(`docker ps`);
}

if (config.commands) {
Expand Down

0 comments on commit 52279d0

Please sign in to comment.