@verdnatura/myt 1.5.31 → 1.5.32
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/README.md +1 -1
- package/myt-run.js +11 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -279,7 +279,7 @@ Builds and starts local database server container. It only rebuilds the image
|
|
|
279
279
|
when dump have been modified.
|
|
280
280
|
|
|
281
281
|
```text
|
|
282
|
-
$ myt run [-c|--ci] [-r|--random]
|
|
282
|
+
$ myt run [-c|--ci] [-r|--random] [-n|--network <string>]
|
|
283
283
|
```
|
|
284
284
|
|
|
285
285
|
### start
|
package/myt-run.js
CHANGED
|
@@ -18,13 +18,15 @@ class Run extends Command {
|
|
|
18
18
|
description: 'Build and start local database server container',
|
|
19
19
|
params: {
|
|
20
20
|
ci: 'Workaround for continuous integration system',
|
|
21
|
-
|
|
21
|
+
network: 'Docker network to attach container to',
|
|
22
|
+
random: 'Whether to use a random container name and port'
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
static opts = {
|
|
26
27
|
alias: {
|
|
27
28
|
ci: 'c',
|
|
29
|
+
network: 'n',
|
|
28
30
|
random: 'r'
|
|
29
31
|
},
|
|
30
32
|
boolean: [
|
|
@@ -104,6 +106,9 @@ class Run extends Command {
|
|
|
104
106
|
} catch (e) {}
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
if (opts.network)
|
|
110
|
+
Object.assign(runOptions, {network: opts.network});
|
|
111
|
+
|
|
107
112
|
const runChown = process.platform != 'linux';
|
|
108
113
|
|
|
109
114
|
Object.assign(runOptions, null, {
|
|
@@ -120,10 +125,11 @@ class Run extends Command {
|
|
|
120
125
|
format: '{{json .NetworkSettings}}'
|
|
121
126
|
});
|
|
122
127
|
|
|
123
|
-
if (opts.ci)
|
|
124
|
-
dbConfig.host = netSettings.
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
if (opts.ci) {
|
|
129
|
+
dbConfig.host = netSettings.Networks[networkName].IPAddress;
|
|
130
|
+
dbConfig.port = 3306;
|
|
131
|
+
} else
|
|
132
|
+
dbConfig.port = netSettings.Ports['3306/tcp'][0].HostPort;
|
|
127
133
|
} catch (err) {
|
|
128
134
|
await server.rm();
|
|
129
135
|
throw err;
|