Group refinements
This commit is contained in:
parent
c8ccee7ada
commit
f20cd5a53c
15 changed files with 287 additions and 23 deletions
|
|
@ -1,4 +1,5 @@
|
|||
const { spawn } = require("child_process");
|
||||
const path = require('path');
|
||||
|
||||
const app = process.argv[2];
|
||||
const command = process.argv[3];
|
||||
|
|
@ -16,10 +17,19 @@ const files = {
|
|||
zammad: ["zammad", "postgresql", "opensearch"],
|
||||
};
|
||||
|
||||
|
||||
const envFile = path.resolve(process.cwd(), '.env');
|
||||
const finalFiles = files[app]
|
||||
.map((file) => ['-f', `docker/compose/${file}.yml`]).flat();
|
||||
|
||||
// Add bridge-dev.yml for dev commands that include zammad
|
||||
const devAppsWithZammad = ['linkDev', 'bridgeDev', 'all'];
|
||||
if (devAppsWithZammad.includes(app) && files[app].includes('zammad')) {
|
||||
finalFiles.push('-f', 'docker-compose.bridge-dev.yml');
|
||||
}
|
||||
|
||||
const finalCommand = command === "up" ? ["up", "-d", "--remove-orphans"] : [command];
|
||||
const dockerCompose = spawn('docker', ['compose', '--env-file', '.env', ...finalFiles, ...finalCommand]);
|
||||
const dockerCompose = spawn('docker', ['compose', '--env-file', envFile, ...finalFiles, ...finalCommand]);
|
||||
|
||||
dockerCompose.stdout.on('data', (data) => {
|
||||
console.info(`${data}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue