Add prepare
option
This commit is contained in:
parent
72454abe0f
commit
a3893052cd
2 changed files with 8 additions and 4 deletions
|
@ -11,5 +11,6 @@
|
|||
],
|
||||
"memory": "128m",
|
||||
"cpus": "0.5",
|
||||
"timeout": 10000
|
||||
"timeout": 10000,
|
||||
"prepare": false
|
||||
}
|
||||
|
|
|
@ -52,10 +52,13 @@ class LanguageHandler extends AkairoHandler {
|
|||
}
|
||||
|
||||
buildDocker() {
|
||||
return Promise.all(this.modules.map(({ loads }) => {
|
||||
return Promise.all(loads.map(name => {
|
||||
return Promise.all(this.modules.map(({ id, loads }) => {
|
||||
return Promise.all(loads.map(async name => {
|
||||
const folder = path.join(__dirname, '../../docker', name);
|
||||
return util.promisify(childProcess.exec)(`docker build -t "1computer1/comp_iler:${name}" ${folder}`);
|
||||
await util.promisify(childProcess.exec)(`docker build -t "1computer1/comp_iler:${name}" ${folder}`);
|
||||
if (this.client.config.prepare) {
|
||||
await this.setupContainer(id);
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue