ramm 0.0.57 → 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 +34 -0
- package/dist/types/podman.d.ts +15 -1
- package/dist/types/ramm.d.ts +1 -2
- package/package.json +1 -1
package/dist/ramm.js
CHANGED
|
@@ -399,6 +399,39 @@ 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 = ({
|
|
403
|
+
name,
|
|
404
|
+
replace = true,
|
|
405
|
+
background = true,
|
|
406
|
+
networks = ["ramm"],
|
|
407
|
+
envs = [],
|
|
408
|
+
volumes = [],
|
|
409
|
+
command
|
|
410
|
+
}) => {
|
|
411
|
+
const values = [];
|
|
412
|
+
values.push("podman", "run");
|
|
413
|
+
if (name) {
|
|
414
|
+
values.push(`--name ${name}`);
|
|
415
|
+
}
|
|
416
|
+
if (replace) {
|
|
417
|
+
values.push("--replace");
|
|
418
|
+
}
|
|
419
|
+
if (background) {
|
|
420
|
+
values.push("-d");
|
|
421
|
+
}
|
|
422
|
+
for (const network of networks) {
|
|
423
|
+
values.push(`--network ${network}`);
|
|
424
|
+
}
|
|
425
|
+
for (const env of envs) {
|
|
426
|
+
values.push(`-e ${env.name}=${env.value}`);
|
|
427
|
+
}
|
|
428
|
+
for (const volume of volumes) {
|
|
429
|
+
values.push(`-v ${volume.from}:${volume.to}`);
|
|
430
|
+
}
|
|
431
|
+
values.push(command);
|
|
432
|
+
const str = values.join(" ");
|
|
433
|
+
return str;
|
|
434
|
+
};
|
|
402
435
|
var runPodmanContainer = async (name, command) => {
|
|
403
436
|
if (await getCreateCommand(name) !== command) {
|
|
404
437
|
await $2`podman rm -f ${name}`;
|
|
@@ -575,6 +608,7 @@ export {
|
|
|
575
608
|
enabledSystemdUnit,
|
|
576
609
|
createSystemdUnit,
|
|
577
610
|
createSystemdService,
|
|
611
|
+
createPodmanCommand,
|
|
578
612
|
createCron,
|
|
579
613
|
createAndAddSshKey,
|
|
580
614
|
copyFilesBySsh,
|
package/dist/types/podman.d.ts
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import type { Context } from "./context.ts";
|
|
2
2
|
export declare const installPodman: () => Promise<void>;
|
|
3
|
-
export declare const getCreateCommand: (name: string) => Promise<string>;
|
|
4
3
|
export declare const loginPodman: (address: string, login: string, password: string) => Promise<{
|
|
5
4
|
stderr: string;
|
|
6
5
|
stdout: string;
|
|
7
6
|
spawnResult: import("bun").Subprocess<"inherit", "pipe", "pipe">;
|
|
8
7
|
}>;
|
|
8
|
+
export declare const createPodmanCommand: ({ name, replace, background, networks, envs, volumes, command, }: {
|
|
9
|
+
name?: string;
|
|
10
|
+
replace?: boolean;
|
|
11
|
+
background?: boolean;
|
|
12
|
+
networks?: string[];
|
|
13
|
+
envs?: {
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
17
|
+
volumes?: {
|
|
18
|
+
from: string;
|
|
19
|
+
to: string;
|
|
20
|
+
}[];
|
|
21
|
+
command: string;
|
|
22
|
+
}) => string;
|
|
9
23
|
export declare const runPodmanContainer: (name: string, command: string) => Promise<void>;
|
|
10
24
|
export declare const runPodmanContainerService: (name: string, command: string, context?: Context) => Promise<void>;
|
|
11
25
|
export declare const addNftPodmanRule: () => Promise<void>;
|
package/dist/types/ramm.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export { execCommandOverSsh, execCommand, execCommandMayError, copyFilesBySsh, execCommandRaw, } from "./base/base.ts";
|
|
2
2
|
export { Context } from "./context.ts";
|
|
3
3
|
export { installBunOverSsh } from "./init.ts";
|
|
4
|
-
export { installPodman, runPodmanContainer, loginPodman } from "./podman.ts";
|
|
5
|
-
export { runPodmanContainerService, addNftPodmanRule } from "./podman.ts";
|
|
4
|
+
export { installPodman, runPodmanContainer, loginPodman, runPodmanContainerService, addNftPodmanRule, createPodmanCommand, } from "./podman.ts";
|
|
6
5
|
export { startSystemdUnit, enabledSystemdUnit, restartSystemdUnit, createSystemdService, getSystemdPathToUnit as getSystemdPathToService, createSystemdUnit, reloadSystemd, } from "./systemd.ts";
|
|
7
6
|
export { installSystemPackage } from "./packages.ts";
|
|
8
7
|
export { printBlock } from "./print.ts";
|
package/package.json
CHANGED