Skip to content

Commit

Permalink
Retain everything else in composer
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Sep 18, 2024
1 parent 6d74874 commit 814b61b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/executor/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,22 @@ class DockerExecutor {
*/
async executeServices(services, home, domain) {
let filename = path.join(home, 'docker-compose.yml');
let composeObject = {};
if (typeof services === 'string') {
filename = path.join(home, services);
// cat from file
services = yaml.parse(await executeLock('compose', () => {
composeObject = yaml.parse(await executeLock('compose', () => {
return new Promise((resolve, reject) => {
spawnSudoUtil('COMPOSE_GET', [filename]).then(() => {
resolve(cat(tmpFile));
}).catch(reject);
});
})).services;
}));
} else {
composeObject.services = services;
}
services = this.rewriteServices(services, domain);
let composeFile = yaml.stringify({ services });
composeObject.services = this.rewriteServices(composeObject.services, domain);
let composeFile = yaml.stringify(composeObject);
await executeLock('compose', () => {
return new Promise((resolve, reject) => {
ShellString(composeFile).to(filename)
Expand Down

0 comments on commit 814b61b

Please sign in to comment.