ramm 0.0.57 → 0.0.58
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 +22 -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,27 @@ 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 = (props) => {
|
|
403
|
+
const values = [];
|
|
404
|
+
if (props.name) {
|
|
405
|
+
values.push(`--name ${props.name}`);
|
|
406
|
+
}
|
|
407
|
+
if (props.replace) {
|
|
408
|
+
values.push("--replace");
|
|
409
|
+
}
|
|
410
|
+
if (props.background) {
|
|
411
|
+
values.push("-d");
|
|
412
|
+
}
|
|
413
|
+
if (props.network) {
|
|
414
|
+
values.push(`--network ${props.network}`);
|
|
415
|
+
}
|
|
416
|
+
for (const env of props.envs ?? []) {
|
|
417
|
+
values.push(`-e ${env.name}=${env.value}`);
|
|
418
|
+
}
|
|
419
|
+
for (const volume of props.volumes ?? []) {
|
|
420
|
+
values.push(`-v ${volume.from}:${volume.to}`);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
402
423
|
var runPodmanContainer = async (name, command) => {
|
|
403
424
|
if (await getCreateCommand(name) !== command) {
|
|
404
425
|
await $2`podman rm -f ${name}`;
|
|
@@ -575,6 +596,7 @@ export {
|
|
|
575
596
|
enabledSystemdUnit,
|
|
576
597
|
createSystemdUnit,
|
|
577
598
|
createSystemdService,
|
|
599
|
+
createPodmanCommand,
|
|
578
600
|
createCron,
|
|
579
601
|
createAndAddSshKey,
|
|
580
602
|
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: (props: {
|
|
9
|
+
name?: string;
|
|
10
|
+
replace?: boolean;
|
|
11
|
+
background?: boolean;
|
|
12
|
+
network?: string;
|
|
13
|
+
envs?: {
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[];
|
|
17
|
+
volumes?: {
|
|
18
|
+
from: string;
|
|
19
|
+
to: string;
|
|
20
|
+
}[];
|
|
21
|
+
command: string;
|
|
22
|
+
}) => void;
|
|
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