poad 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/global/start.js +20 -1
- package/package.json +1 -1
package/global/start.js
CHANGED
|
@@ -18,11 +18,30 @@ module.exports = async (args) => {
|
|
|
18
18
|
if (await isDockerExist(containerName)) {
|
|
19
19
|
return console.log(chalk.bold('Container already started'));
|
|
20
20
|
}
|
|
21
|
+
const image = 'poadio/engine:' + config.engine;
|
|
22
|
+
// L'image de la version du projet n'est pas forcément là (poad install tire
|
|
23
|
+
// celle du CLI, et config.toml peut en demander une autre) : on la tire.
|
|
24
|
+
try {
|
|
25
|
+
await docker.getImage(image).inspect();
|
|
26
|
+
} catch {
|
|
27
|
+
const pulling = ora(`Pulling ${image}`).start();
|
|
28
|
+
try {
|
|
29
|
+
await new Promise((resolve, reject) =>
|
|
30
|
+
docker.pull(image, (err, stream) =>
|
|
31
|
+
err ? reject(err) : docker.modem.followProgress(stream, (e) => (e ? reject(e) : resolve()))
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
pulling.succeed(`${image} pulled.`);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
pulling.fail(chalk.redBright(`Cannot pull ${image}: ${err.message}`));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
21
40
|
const progress = ora('Starting container').start();
|
|
22
41
|
docker
|
|
23
42
|
.createContainer({
|
|
24
43
|
name: containerName,
|
|
25
|
-
Image:
|
|
44
|
+
Image: image,
|
|
26
45
|
Tty: false,
|
|
27
46
|
Env: [
|
|
28
47
|
'OMNEEDIA_GATEWAY_URL=http://localhost:' + config.web.port,
|