fix(run): refs#6706 keep option to keep container on failure

This commit is contained in:
Juan Ferrer 2024-02-07 09:51:32 +01:00
parent 26ac3e995a
commit 6eb451ecaf
3 changed files with 10 additions and 7 deletions

View File

@ -20,7 +20,8 @@ class Run extends Command {
ci: 'Workaround for continuous integration system',
network: 'Docker network to attach container to',
random: 'Whether to use a random container name and port',
tmpfs: 'Whether to use tmpfs mount for MySQL data'
tmpfs: 'Whether to use tmpfs mount for MySQL data',
keep: 'Keep container on failure'
}
};
@ -29,12 +30,14 @@ class Run extends Command {
ci: 'c',
network: 'n',
random: 'r',
tmpfs: 't'
tmpfs: 't',
keep: 'k'
},
boolean: [
'ci',
'random',
'tmpfs'
'tmpfs',
'keep'
]
};
@ -208,7 +211,7 @@ class Run extends Command {
return server;
} catch (err) {
try {
await ct.rm({force: true});
if (!opts.keep) await ct.rm({force: true});
} catch (e) {}
throw err;
}

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@verdnatura/myt",
"version": "1.6.4",
"version": "1.6.6",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@verdnatura/myt",
"version": "1.6.4",
"version": "1.6.6",
"license": "GPL-3.0",
"dependencies": {
"@sqltools/formatter": "^1.2.5",

View File

@ -1,6 +1,6 @@
{
"name": "@verdnatura/myt",
"version": "1.6.5",
"version": "1.6.6",
"author": "Verdnatura Levante SL",
"description": "MySQL version control",
"license": "GPL-3.0",