fix(run): refs#6706 Remove container on failure, network param fix
This commit is contained in:
parent
ed248aed93
commit
26ac3e995a
10
myt-run.js
10
myt-run.js
|
@ -118,6 +118,8 @@ class Run extends Command {
|
|||
detach: true
|
||||
});
|
||||
const ct = await docker.run(opts.code, null, runOptions);
|
||||
|
||||
try {
|
||||
const server = new Server(ct, dbConfig);
|
||||
|
||||
if (isRandom) {
|
||||
|
@ -126,7 +128,7 @@ class Run extends Command {
|
|||
format: '{{json .NetworkSettings}}'
|
||||
});
|
||||
|
||||
if (opts.ci) {
|
||||
if (opts.ci || opts.network) {
|
||||
dbConfig.host = opts.network
|
||||
? netSettings.Networks[opts.network].IPAddress
|
||||
: netSettings.Gateway;
|
||||
|
@ -204,6 +206,12 @@ class Run extends Command {
|
|||
|
||||
await conn.end();
|
||||
return server;
|
||||
} catch (err) {
|
||||
try {
|
||||
await ct.rm({force: true});
|
||||
} catch (e) {}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.4",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@sqltools/formatter": "^1.2.5",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@verdnatura/myt",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.5",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "MySQL version control",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue