ramm 0.0.58 → 0.0.59
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/ramm.js +21 -9
- package/dist/types/podman.d.ts +3 -3
- package/package.json +1 -1
package/dist/ramm.js
CHANGED
|
@@ -399,26 +399,38 @@ var getCreateCommand = async (name) => {
|
|
|
399
399
|
var loginPodman = async (address, login, password) => {
|
|
400
400
|
return await execCommand(`echo "${password}" | podman login --username "${login}" --password-stdin ${address}`);
|
|
401
401
|
};
|
|
402
|
-
var createPodmanCommand = (
|
|
402
|
+
var createPodmanCommand = ({
|
|
403
|
+
name,
|
|
404
|
+
replace = true,
|
|
405
|
+
background = true,
|
|
406
|
+
networks = ["ramm"],
|
|
407
|
+
envs = [],
|
|
408
|
+
volumes = [],
|
|
409
|
+
command
|
|
410
|
+
}) => {
|
|
403
411
|
const values = [];
|
|
404
|
-
|
|
405
|
-
|
|
412
|
+
values.push("podman", "run");
|
|
413
|
+
if (name) {
|
|
414
|
+
values.push(`--name ${name}`);
|
|
406
415
|
}
|
|
407
|
-
if (
|
|
416
|
+
if (replace) {
|
|
408
417
|
values.push("--replace");
|
|
409
418
|
}
|
|
410
|
-
if (
|
|
419
|
+
if (background) {
|
|
411
420
|
values.push("-d");
|
|
412
421
|
}
|
|
413
|
-
|
|
414
|
-
values.push(`--network ${
|
|
422
|
+
for (const network of networks) {
|
|
423
|
+
values.push(`--network ${network}`);
|
|
415
424
|
}
|
|
416
|
-
for (const env of
|
|
425
|
+
for (const env of envs) {
|
|
417
426
|
values.push(`-e ${env.name}=${env.value}`);
|
|
418
427
|
}
|
|
419
|
-
for (const volume of
|
|
428
|
+
for (const volume of volumes) {
|
|
420
429
|
values.push(`-v ${volume.from}:${volume.to}`);
|
|
421
430
|
}
|
|
431
|
+
values.push(command);
|
|
432
|
+
const str = values.join(" ");
|
|
433
|
+
return str;
|
|
422
434
|
};
|
|
423
435
|
var runPodmanContainer = async (name, command) => {
|
|
424
436
|
if (await getCreateCommand(name) !== command) {
|
package/dist/types/podman.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ export declare const loginPodman: (address: string, login: string, password: str
|
|
|
5
5
|
stdout: string;
|
|
6
6
|
spawnResult: import("bun").Subprocess<"inherit", "pipe", "pipe">;
|
|
7
7
|
}>;
|
|
8
|
-
export declare const createPodmanCommand: (
|
|
8
|
+
export declare const createPodmanCommand: ({ name, replace, background, networks, envs, volumes, command, }: {
|
|
9
9
|
name?: string;
|
|
10
10
|
replace?: boolean;
|
|
11
11
|
background?: boolean;
|
|
12
|
-
|
|
12
|
+
networks?: string[];
|
|
13
13
|
envs?: {
|
|
14
14
|
name: string;
|
|
15
15
|
value: string;
|
|
@@ -19,7 +19,7 @@ export declare const createPodmanCommand: (props: {
|
|
|
19
19
|
to: string;
|
|
20
20
|
}[];
|
|
21
21
|
command: string;
|
|
22
|
-
}) =>
|
|
22
|
+
}) => string;
|
|
23
23
|
export declare const runPodmanContainer: (name: string, command: string) => Promise<void>;
|
|
24
24
|
export declare const runPodmanContainerService: (name: string, command: string, context?: Context) => Promise<void>;
|
|
25
25
|
export declare const addNftPodmanRule: () => Promise<void>;
|
package/package.json
CHANGED