@cloud-cli/dx 2.5.1 → 2.6.0
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/dist/containers.d.ts +6 -4
- package/dist/containers.js +20 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/containers.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export declare function getRunningContainers(): Promise<string[]>;
|
|
|
4
4
|
export declare function getAllContainers(): Promise<NameAndStatus[]>;
|
|
5
5
|
export declare function getLogs(options: GetLogsOptions): Promise<string>;
|
|
6
6
|
export declare function renameContainer(options: RenameOptions): Container;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, cli: any): Promise<any[]>;
|
|
7
|
+
export interface AllOptions {
|
|
8
|
+
image?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function updateAll({ image }: AllOptions, cli: any): Promise<any[]>;
|
|
11
|
+
export declare function startAll({ image }: AllOptions, cli: any): Promise<boolean>;
|
|
12
|
+
export declare function stopAll({ image }: AllOptions, cli: any): Promise<any[]>;
|
|
11
13
|
export declare function refreshContainer(options: ContainerName, { run }: ServerParams): Promise<void>;
|
|
12
14
|
export declare function restartContainer(options: ContainerName, { run }: ServerParams): Promise<boolean>;
|
|
13
15
|
export interface StartOptions {
|
package/dist/containers.js
CHANGED
|
@@ -44,8 +44,20 @@ export function renameContainer(options) {
|
|
|
44
44
|
}
|
|
45
45
|
return rename(name, newName);
|
|
46
46
|
}
|
|
47
|
-
export async function
|
|
48
|
-
const list = listContainers();
|
|
47
|
+
export async function updateAll({ image } = {}, cli) {
|
|
48
|
+
const list = listContainers({ image });
|
|
49
|
+
const affected = [];
|
|
50
|
+
for (const app of list) {
|
|
51
|
+
try {
|
|
52
|
+
await refreshContainer({ name: app.name }, cli);
|
|
53
|
+
affected.push(app.name);
|
|
54
|
+
}
|
|
55
|
+
catch { }
|
|
56
|
+
}
|
|
57
|
+
return affected;
|
|
58
|
+
}
|
|
59
|
+
export async function startAll({ image } = {}, cli) {
|
|
60
|
+
const list = listContainers({ image });
|
|
49
61
|
const running = (await getRunningContainers());
|
|
50
62
|
const notRunning = list.filter(({ name }) => !running.includes(name));
|
|
51
63
|
for (const app of notRunning) {
|
|
@@ -56,14 +68,14 @@ export async function startAll(_, cli) {
|
|
|
56
68
|
}
|
|
57
69
|
return true;
|
|
58
70
|
}
|
|
59
|
-
export async function
|
|
60
|
-
const list = listContainers();
|
|
71
|
+
export async function stopAll({ image } = {}, cli) {
|
|
72
|
+
const list = listContainers({ image });
|
|
73
|
+
const running = await getRunningContainers();
|
|
74
|
+
const runningContainers = list.filter(({ name }) => running.includes(name));
|
|
61
75
|
const affected = [];
|
|
62
|
-
for (const app of
|
|
63
|
-
if (app.image !== options.image)
|
|
64
|
-
continue;
|
|
76
|
+
for (const app of runningContainers) {
|
|
65
77
|
try {
|
|
66
|
-
await
|
|
78
|
+
await stopContainer({ name: app.name }, cli);
|
|
67
79
|
affected.push(app.name);
|
|
68
80
|
}
|
|
69
81
|
catch { }
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLogs, refreshContainer, restartContainer, startAll, updateAll, startContainer, stopContainer, renameContainer, runContainer } from "./containers.js";
|
|
1
|
+
import { getLogs, refreshContainer, restartContainer, startAll, updateAll, startContainer, stopAll, stopContainer, renameContainer, runContainer } from "./containers.js";
|
|
2
2
|
import { prune, pull } from "./images.js";
|
|
3
3
|
import { addContainer, getContainer, listContainers, removeContainer, updateContainer } from "./store.js";
|
|
4
4
|
export type { Config } from "./types.js";
|
|
@@ -15,10 +15,11 @@ declare const _default: {
|
|
|
15
15
|
list: typeof listContainers;
|
|
16
16
|
refresh: typeof refreshContainer;
|
|
17
17
|
update: typeof updateContainer;
|
|
18
|
-
startAll: typeof startAll;
|
|
19
18
|
updateAll: typeof updateAll;
|
|
19
|
+
startAll: typeof startAll;
|
|
20
20
|
start: typeof startContainer;
|
|
21
21
|
run: typeof runContainer;
|
|
22
|
+
stopAll: typeof stopAll;
|
|
22
23
|
stop: typeof stopContainer;
|
|
23
24
|
restart: typeof restartContainer;
|
|
24
25
|
ps: typeof ps;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAllContainers, getLogs, getRunningContainers, refreshContainer, restartContainer, startAll, updateAll, startContainer, stopContainer, renameContainer, runContainer, } from "./containers.js";
|
|
1
|
+
import { getAllContainers, getLogs, getRunningContainers, refreshContainer, restartContainer, startAll, updateAll, startContainer, stopAll, stopContainer, renameContainer, runContainer, } from "./containers.js";
|
|
2
2
|
import { prune, pull } from "./images.js";
|
|
3
3
|
import { addContainer, getContainer, listContainers, removeContainer, updateContainer, } from "./store.js";
|
|
4
4
|
function ps(options = {}) {
|
|
@@ -17,10 +17,11 @@ export default {
|
|
|
17
17
|
list: listContainers,
|
|
18
18
|
refresh: refreshContainer,
|
|
19
19
|
update: updateContainer,
|
|
20
|
-
startAll,
|
|
21
20
|
updateAll,
|
|
21
|
+
startAll,
|
|
22
22
|
start: startContainer,
|
|
23
23
|
run: runContainer,
|
|
24
|
+
stopAll,
|
|
24
25
|
stop: stopContainer,
|
|
25
26
|
restart: restartContainer,
|
|
26
27
|
ps: ps,
|