@cat-indev/catops-cli 0.0.1-alpha.7 → 0.0.1-alpha.8
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 +63 -36
- package/dist/services/ansible.d.ts +7 -6
- package/dist/services/ansible.js +10 -10
- package/dist/services/ansible.js.map +1 -1
- package/dist/services/archive.d.ts +4 -4
- package/dist/services/archive.js +6 -6
- package/dist/services/archive.js.map +1 -1
- package/dist/services/argocd.d.ts +11 -8
- package/dist/services/argocd.js +14 -14
- package/dist/services/argocd.js.map +1 -1
- package/dist/services/az.d.ts +13 -8
- package/dist/services/az.js +17 -14
- package/dist/services/az.js.map +1 -1
- package/dist/services/docker.d.ts +10 -7
- package/dist/services/docker.js +12 -12
- package/dist/services/docker.js.map +1 -1
- package/dist/services/git.d.ts +9 -9
- package/dist/services/git.js +16 -16
- package/dist/services/git.js.map +1 -1
- package/dist/services/helm.d.ts +4 -4
- package/dist/services/helm.js +6 -6
- package/dist/services/helm.js.map +1 -1
- package/dist/services/kubectl.d.ts +4 -2
- package/dist/services/kubectl.js +13 -8
- package/dist/services/kubectl.js.map +1 -1
- package/dist/services/npm.d.ts +5 -5
- package/dist/services/npm.js +8 -8
- package/dist/services/npm.js.map +1 -1
- package/dist/services/oc.d.ts +12 -2
- package/dist/services/oc.js +22 -9
- package/dist/services/oc.js.map +1 -1
- package/dist/services/shell.d.ts +8 -0
- package/dist/services/shell.js +11 -0
- package/dist/services/shell.js.map +1 -1
- package/dist/services/tekton.d.ts +8 -6
- package/dist/services/tekton.js +10 -10
- package/dist/services/tekton.js.map +1 -1
- package/dist/services/terraform.d.ts +13 -8
- package/dist/services/terraform.js +14 -14
- package/dist/services/terraform.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# catops-cli
|
|
2
2
|
|
|
3
3
|
Framework para pipelines DevOps, escrito en **TypeScript** (100% usable desde JavaScript puro), empaquetado como librería npm instalable en cualquier proyecto.
|
|
4
4
|
|
|
@@ -16,53 +16,53 @@ Trae:
|
|
|
16
16
|
**Opción A — publicado en tu registro npm (público o privado tipo Verdaccio/Artifactory/GitHub Packages):**
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install
|
|
20
|
-
# o si lo publicas con scope propio, p.ej. @miorg/
|
|
21
|
-
npm install @miorg/
|
|
19
|
+
npm install catops-cli
|
|
20
|
+
# o si lo publicas con scope propio, p.ej. @miorg/catops-cli
|
|
21
|
+
npm install @miorg/catops-cli
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
**Opción B — sin publicar, directo desde este proyecto (útil mientras lo maduras):**
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
# Dentro del repo de
|
|
28
|
-
npm pack # genera
|
|
27
|
+
# Dentro del repo de catops-cli
|
|
28
|
+
npm pack # genera catops-cli-<version>.tgz
|
|
29
29
|
|
|
30
30
|
# Dentro del proyecto que lo va a consumir
|
|
31
|
-
npm install /ruta/a/
|
|
31
|
+
npm install /ruta/a/catops-cli-<version>.tgz
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**Opción C — enlazado local con `npm link` (para desarrollar la librería y el proyecto que la consume al mismo tiempo):**
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
# Dentro del repo de
|
|
37
|
+
# Dentro del repo de catops-cli
|
|
38
38
|
npm link
|
|
39
39
|
|
|
40
40
|
# Dentro del proyecto consumidor
|
|
41
|
-
npm link
|
|
41
|
+
npm link catops-cli
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
**Opción D — como dependencia de Git (monorepo o repo privado, sin registro npm):**
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
npm install git+https://github.com/tu-org/
|
|
47
|
+
npm install git+https://github.com/tu-org/catops-cli.git
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Cualquiera de las 4 deja disponibles dos cosas en el proyecto consumidor:
|
|
51
51
|
|
|
52
52
|
1. La librería, tanto desde TS como desde JS puro:
|
|
53
53
|
```typescript
|
|
54
|
-
import { Context, Menu, services, type MenuDefinition } from "
|
|
54
|
+
import { Context, Menu, services, type MenuDefinition } from "catops-cli";
|
|
55
55
|
```
|
|
56
56
|
```javascript
|
|
57
|
-
const { Context, Menu, services } = require("
|
|
57
|
+
const { Context, Menu, services } = require("catops-cli");
|
|
58
58
|
```
|
|
59
|
-
2. El binario: `npx
|
|
59
|
+
2. El binario: `npx catops-cli` (o `catops-cli` si lo instalaste global con `-g`).
|
|
60
60
|
|
|
61
61
|
## Publicar una nueva versión
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
npm version patch # o minor / major
|
|
65
|
-
npm publish # agrega --access public si usas un scope (@miorg/
|
|
65
|
+
npm publish # agrega --access public si usas un scope (@miorg/catops-cli)
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
`prepublishOnly` corre el build y los tests automáticamente antes de publicar.
|
|
@@ -90,18 +90,18 @@ src/
|
|
|
90
90
|
index.ts -> registra todos los servicios anteriores (ServicesRegistry)
|
|
91
91
|
index.ts -> entry point público: Context, Menu, Notifier, senders, classifiers, messages, services, tipos
|
|
92
92
|
bin/
|
|
93
|
-
|
|
93
|
+
catops-cli.ts -> CLI ejecutable (busca devops.pipeline.js en el proyecto consumidor)
|
|
94
94
|
examples/
|
|
95
95
|
pipeline-example.js -> pipeline + menú + notificaciones de ejemplo, corre contra dist/
|
|
96
96
|
test/
|
|
97
97
|
context.test.js, shell.test.js, services.test.js, menu-selector.test.js,
|
|
98
98
|
notifier.test.js, senders.test.js, hooks-integration.test.js,
|
|
99
|
-
kubectl.test.js, oc.test.js, deployment-group.test.js
|
|
99
|
+
kubectl.test.js, oc.test.js, deployment-group.test.js, exec-options-passthrough.test.js
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
## Uso rápido: menú con `devops.pipeline.js` + el bin
|
|
103
103
|
|
|
104
|
-
Crea un `devops.pipeline.js` (o `devops.config.js` / `.
|
|
104
|
+
Crea un `devops.pipeline.js` (o `devops.config.js` / `.catops-cli.js`) en la raíz de tu proyecto:
|
|
105
105
|
|
|
106
106
|
```javascript
|
|
107
107
|
// devops.pipeline.js
|
|
@@ -119,16 +119,16 @@ module.exports = (ctx) => ({
|
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
npx
|
|
122
|
+
npx catops-cli --debug --env=prod
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
`
|
|
125
|
+
`catops-cli` detecta el archivo, arma el `Context` a partir de los flags/params de `argv`, y renderiza el menú.
|
|
126
126
|
|
|
127
127
|
## Uso directo en tu propio script (p. ej. con `tsx`)
|
|
128
128
|
|
|
129
129
|
```typescript
|
|
130
130
|
// src/index.ts
|
|
131
|
-
import { Context, Menu, type MenuDefinition } from "
|
|
131
|
+
import { Context, Menu, type MenuDefinition } from "catops-cli";
|
|
132
132
|
|
|
133
133
|
const ctx = Context.parseArgv();
|
|
134
134
|
|
|
@@ -155,7 +155,7 @@ npm run dev -- --menu-selector=build # con npm hace falta el "--" para reenv
|
|
|
155
155
|
## Uso como librería sin menú (pipeline lineal)
|
|
156
156
|
|
|
157
157
|
```javascript
|
|
158
|
-
const { Context } = require("
|
|
158
|
+
const { Context } = require("catops-cli"); // o require("./dist") dentro de este repo
|
|
159
159
|
|
|
160
160
|
const ctx = Context.parseArgv(); // llena flags/params desde argv
|
|
161
161
|
|
|
@@ -210,13 +210,13 @@ Menu.render(mainMenu, ctx);
|
|
|
210
210
|
|
|
211
211
|
```bash
|
|
212
212
|
# encadena ambos niveles en un solo comando, sin ningún prompt interactivo:
|
|
213
|
-
|
|
213
|
+
catops-cli --menu-selector=docker --docker-action=build
|
|
214
214
|
|
|
215
215
|
# un solo nivel:
|
|
216
|
-
|
|
216
|
+
catops-cli --menu-selector=deploy
|
|
217
217
|
|
|
218
218
|
# sin flags -> menú interactivo normal
|
|
219
|
-
|
|
219
|
+
catops-cli
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
Si el valor del flag no matchea ningún `selector` del nivel actual, cae de vuelta al menú interactivo (con un warning), en vez de fallar en seco. Cada submenú revisa su **propio** `flag-selector` de forma independiente, así que podés automatizar tantos niveles como quieras encadenando flags.
|
|
@@ -247,7 +247,7 @@ await ctx.run(
|
|
|
247
247
|
|
|
248
248
|
En ambos casos, además de tus callbacks, el resultado se reporta automáticamente al `ctx.notifier` (ver más abajo) — no hay que llamarlo a mano.
|
|
249
249
|
|
|
250
|
-
## retry / timeout / dryRun en shell.exec
|
|
250
|
+
## retry / timeout / dryRun — en shell.exec y en TODOS los servicios
|
|
251
251
|
|
|
252
252
|
`shell.exec(command, ...args)` sigue aceptando exactamente los mismos argumentos de siempre. Si el último argumento es un objeto plano, se interpreta como opciones **solo para esa llamada**:
|
|
253
253
|
|
|
@@ -262,17 +262,43 @@ await ctx.services.shell.exec("curl", "https://flaky-api.internal", {
|
|
|
262
262
|
});
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
**Todos los comandos de todos los servicios** (`docker`, `git`, `kubectl`, `helm`, `npm`, `archive`, `terraform`, `ansible`, `argocd`, `tekton`, `oc`, `az`) aceptan este mismo control, sin que cambie nada de lo que ya usabas:
|
|
266
|
+
|
|
267
|
+
- Si la función ya recibía un **objeto de opciones** (la mayoría), agregale la clave `exec`:
|
|
268
|
+
```javascript
|
|
269
|
+
await ctx.services.terraform.apply({ autoApprove: true, exec: { retry: 3 } });
|
|
270
|
+
await ctx.services.argocd.appSync("mi-app", { prune: true, exec: { retry: 3 } });
|
|
271
|
+
```
|
|
272
|
+
- Si la función recibe **argumentos posicionales** (strings sueltos), `exec` va como el **último argumento**:
|
|
273
|
+
```javascript
|
|
274
|
+
await ctx.services.docker.push("registry/app:v1", { retry: 3 });
|
|
275
|
+
await ctx.services.git.push({ retry: 3 });
|
|
276
|
+
await ctx.services.helm.uninstall("mi-app", { retry: 3 });
|
|
277
|
+
```
|
|
278
|
+
- `kubectl` y `oc` combinan `exec` en el **mismo objeto** que ya usás para `kubeconfig`/`namespace`:
|
|
279
|
+
```javascript
|
|
280
|
+
// 10 reintentos en un login inestable de OpenShift
|
|
281
|
+
await ctx.services.oc.login({
|
|
282
|
+
server: "https://api.cluster:6443",
|
|
283
|
+
token: process.env.OC_TOKEN,
|
|
284
|
+
namespace: "prod",
|
|
285
|
+
exec: { retry: 10, retryDelay: 2000 }
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
await ctx.services.kubectl.apply("deploy.yaml", { namespace: "prod", exec: { retry: 5, timeout: 30000 } });
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Defaults globales para todo el proceso (afecta a todos los comandos que no pasen su propio `exec`/opciones puntuales):
|
|
266
292
|
|
|
267
293
|
```javascript
|
|
268
294
|
ctx.services.shell.configure({ retry: 3, timeout: 30000 });
|
|
269
295
|
```
|
|
270
296
|
|
|
271
|
-
`Context.parseArgv()` ya conecta flags de línea de comandos automáticamente:
|
|
297
|
+
`Context.parseArgv()` ya conecta flags de línea de comandos automáticamente a esos defaults globales:
|
|
272
298
|
|
|
273
299
|
```bash
|
|
274
|
-
npx
|
|
275
|
-
npx
|
|
300
|
+
npx catops-cli --dry-run # activa dryRun global
|
|
301
|
+
npx catops-cli --retry=3 --timeout=15000
|
|
276
302
|
```
|
|
277
303
|
|
|
278
304
|
## Servicios de infraestructura incluidos
|
|
@@ -290,15 +316,15 @@ await ctx.services.tekton.pipelineStart("build-pipeline", { params: { image: "ap
|
|
|
290
316
|
await ctx.services.az.acrBuild({ registry: "miregistro", image: "app:v1" });
|
|
291
317
|
```
|
|
292
318
|
|
|
293
|
-
## kubectl / oc: kubeconfig, namespace y espera cíclica del rollout
|
|
319
|
+
## kubectl / oc: kubeconfig, namespace, retry/timeout, y espera cíclica del rollout
|
|
294
320
|
|
|
295
|
-
`kubectl` y `oc` aceptan `{ kubeconfig, namespace }` como último argumento en **todos** sus comandos (retrocompatible, sigue funcionando sin ese argumento):
|
|
321
|
+
`kubectl` y `oc` aceptan `{ kubeconfig, namespace, exec }` como último argumento en **todos** sus comandos (retrocompatible, sigue funcionando sin ese argumento — ver la sección anterior para el detalle de `exec`):
|
|
296
322
|
|
|
297
323
|
```javascript
|
|
298
324
|
await ctx.services.kubectl.apply("deploy.yaml", { kubeconfig: "/etc/kube/prod.yaml", namespace: "prod" });
|
|
299
|
-
await ctx.services.kubectl.get("pods", "-o", "wide", { namespace: "staging" });
|
|
325
|
+
await ctx.services.kubectl.get("pods", "-o", "wide", { namespace: "staging", exec: { retry: 3 } });
|
|
300
326
|
|
|
301
|
-
await ctx.services.oc.login({ server: "https://api.cluster:6443", token, namespace: "prod" });
|
|
327
|
+
await ctx.services.oc.login({ server: "https://api.cluster:6443", token, namespace: "prod", exec: { retry: 10 } });
|
|
302
328
|
await ctx.services.oc.apply("deploy.yaml", { namespace: "prod" });
|
|
303
329
|
```
|
|
304
330
|
|
|
@@ -378,7 +404,7 @@ ctx.services.azdo.endGroup();
|
|
|
378
404
|
3. **`channel()`** / **`onSuccess()`** — a qué **senders** se manda cada área.
|
|
379
405
|
|
|
380
406
|
```javascript
|
|
381
|
-
const { classifiers, messages, senders } = require("
|
|
407
|
+
const { classifiers, messages, senders } = require("catops-cli");
|
|
382
408
|
|
|
383
409
|
// 1. ¿A qué área de TI pertenece este error?
|
|
384
410
|
ctx.notifier.classify(classifiers.byCommand({
|
|
@@ -419,7 +445,7 @@ ctx.notifier.describeError(messages.byRule([
|
|
|
419
445
|
// 3. ¿a dónde se manda cada área?
|
|
420
446
|
ctx.notifier.channel("kubernetes", senders.webhook({ url: process.env.TEAMS_WEBHOOK }));
|
|
421
447
|
ctx.notifier.channel("security", senders.http({ url: "https://security.miempresa.com/incidents" }));
|
|
422
|
-
ctx.notifier.channel("*", senders.file({ path: "./
|
|
448
|
+
ctx.notifier.channel("*", senders.file({ path: "./catops-cli-errors.log" })); // TODO error, sin importar el área
|
|
423
449
|
|
|
424
450
|
// (opcional) éxito, sin clasificación de área
|
|
425
451
|
ctx.notifier.onSuccess(senders.log());
|
|
@@ -472,11 +498,12 @@ npm test
|
|
|
472
498
|
- `notifier.test.js` — classify/channel/onSuccess/describeError/byRule
|
|
473
499
|
- `senders.test.js` — file/http/webhook/log contra servidores reales en localhost
|
|
474
500
|
- `kubectl.test.js`, `oc.test.js` — kubeconfig/namespace, waitForDeployment (éxito, timeout, Failed, maxRestarts)
|
|
501
|
+
- `exec-options-passthrough.test.js` — retry/timeout/dryRun (`exec`) llegando a todos los servicios, incluyendo un retry real que se recupera tras 2 fallos
|
|
475
502
|
- `deployment-group.test.js` — waitForDeploymentGroup (éxito total, fallo parcial, label sin matches, oc con `dc`)
|
|
476
503
|
|
|
477
504
|
## Siguientes pasos posibles
|
|
478
505
|
|
|
479
|
-
- Publicar en un registro privado (Verdaccio/Artifactory/GitHub Packages) para instalarlo con scope, p.ej. `@miorg/
|
|
506
|
+
- Publicar en un registro privado (Verdaccio/Artifactory/GitHub Packages) para instalarlo con scope, p.ej. `@miorg/catops-cli`.
|
|
480
507
|
- Agregar más plugins (`ansible-lint`, `trivy`, `sonar-scanner`) con el mismo patrón que `terraform.ts`/`docker.ts`.
|
|
481
508
|
- CI propio (GitHub Actions/Azure Pipelines) que corra `npm test` en cada PR antes de `npm publish`.
|
|
482
509
|
- `--catch=throw` (o similar) para que un item de menú fallido mate el proceso completo en vez de solo loguear y seguir — útil corriendo vía `--menu-selector` dentro de un step de Azure Pipelines.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface AnsiblePlaybookOptions {
|
|
3
3
|
inventory?: string;
|
|
4
4
|
extraVars?: Record<string, string>;
|
|
5
5
|
tags?: string;
|
|
6
|
+
exec?: ExecOptions;
|
|
6
7
|
}
|
|
7
|
-
export declare function playbook(playbookPath: string, { inventory, extraVars, tags }?: AnsiblePlaybookOptions): Promise<ExecResult>;
|
|
8
|
-
export declare function adhoc(host: string, module: string, moduleArgs?: string): Promise<ExecResult>;
|
|
9
|
-
export declare function vaultEncrypt(file: string): Promise<ExecResult>;
|
|
10
|
-
export declare function vaultDecrypt(file: string): Promise<ExecResult>;
|
|
11
|
-
export declare function galaxyInstall(requirementsFile: string): Promise<ExecResult>;
|
|
8
|
+
export declare function playbook(playbookPath: string, { inventory, extraVars, tags, exec }?: AnsiblePlaybookOptions): Promise<ExecResult>;
|
|
9
|
+
export declare function adhoc(host: string, module: string, moduleArgs?: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
10
|
+
export declare function vaultEncrypt(file: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
11
|
+
export declare function vaultDecrypt(file: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
12
|
+
export declare function galaxyInstall(requirementsFile: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/ansible.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.vaultEncrypt = vaultEncrypt;
|
|
|
6
6
|
exports.vaultDecrypt = vaultDecrypt;
|
|
7
7
|
exports.galaxyInstall = galaxyInstall;
|
|
8
8
|
const shell_1 = require("./shell");
|
|
9
|
-
function playbook(playbookPath, { inventory, extraVars = {}, tags } = {}) {
|
|
9
|
+
function playbook(playbookPath, { inventory, extraVars = {}, tags, exec } = {}) {
|
|
10
10
|
const args = ["-i", inventory || "inventory.ini", playbookPath];
|
|
11
11
|
Object.entries(extraVars).forEach(([k, v]) => {
|
|
12
12
|
args.push("--extra-vars", `${k}=${v}`);
|
|
@@ -14,22 +14,22 @@ function playbook(playbookPath, { inventory, extraVars = {}, tags } = {}) {
|
|
|
14
14
|
if (tags) {
|
|
15
15
|
args.push("--tags", tags);
|
|
16
16
|
}
|
|
17
|
-
return shell_1.shell.exec("ansible-playbook", ...args);
|
|
17
|
+
return shell_1.shell.exec("ansible-playbook", ...(0, shell_1.withExecOptions)(args, exec));
|
|
18
18
|
}
|
|
19
|
-
function adhoc(host, module, moduleArgs) {
|
|
19
|
+
function adhoc(host, module, moduleArgs, exec) {
|
|
20
20
|
const args = [host, "-m", module];
|
|
21
21
|
if (moduleArgs) {
|
|
22
22
|
args.push("-a", moduleArgs);
|
|
23
23
|
}
|
|
24
|
-
return shell_1.shell.exec("ansible", ...args);
|
|
24
|
+
return shell_1.shell.exec("ansible", ...(0, shell_1.withExecOptions)(args, exec));
|
|
25
25
|
}
|
|
26
|
-
function vaultEncrypt(file) {
|
|
27
|
-
return shell_1.shell.exec("ansible-vault", "encrypt", file);
|
|
26
|
+
function vaultEncrypt(file, exec) {
|
|
27
|
+
return shell_1.shell.exec("ansible-vault", ...(0, shell_1.withExecOptions)(["encrypt", file], exec));
|
|
28
28
|
}
|
|
29
|
-
function vaultDecrypt(file) {
|
|
30
|
-
return shell_1.shell.exec("ansible-vault", "decrypt", file);
|
|
29
|
+
function vaultDecrypt(file, exec) {
|
|
30
|
+
return shell_1.shell.exec("ansible-vault", ...(0, shell_1.withExecOptions)(["decrypt", file], exec));
|
|
31
31
|
}
|
|
32
|
-
function galaxyInstall(requirementsFile) {
|
|
33
|
-
return shell_1.shell.exec("ansible-galaxy", "install", "-r", requirementsFile);
|
|
32
|
+
function galaxyInstall(requirementsFile, exec) {
|
|
33
|
+
return shell_1.shell.exec("ansible-galaxy", ...(0, shell_1.withExecOptions)(["install", "-r", requirementsFile], exec));
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=ansible.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ansible.js","sourceRoot":"","sources":["../../src/services/ansible.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ansible.js","sourceRoot":"","sources":["../../src/services/ansible.ts"],"names":[],"mappings":";;AAUA,4BAcC;AAED,sBAUC;AAED,oCAEC;AAED,oCAEC;AAED,sCAEC;AAhDD,mCAAiD;AAUjD,SAAgB,QAAQ,CAAC,YAAoB,EAAE,EAAE,SAAS,EA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AE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAgB,aAAa,CAAC,gBAAwB,EAAE,IAAkB;IACtE,OAAO,aAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvG,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
2
|
-
export declare function zip(source: string, target: string): Promise<ExecResult>;
|
|
3
|
-
export declare function unzip(file: string, target: string): Promise<ExecResult>;
|
|
4
|
-
export declare function tar(source: string, target: string): Promise<ExecResult>;
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
|
+
export declare function zip(source: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
3
|
+
export declare function unzip(file: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
4
|
+
export declare function tar(source: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/archive.js
CHANGED
|
@@ -4,13 +4,13 @@ exports.zip = zip;
|
|
|
4
4
|
exports.unzip = unzip;
|
|
5
5
|
exports.tar = tar;
|
|
6
6
|
const shell_1 = require("./shell");
|
|
7
|
-
function zip(source, target) {
|
|
8
|
-
return shell_1.shell.exec("zip", "-r", target, source);
|
|
7
|
+
function zip(source, target, exec) {
|
|
8
|
+
return shell_1.shell.exec("zip", ...(0, shell_1.withExecOptions)(["-r", target, source], exec));
|
|
9
9
|
}
|
|
10
|
-
function unzip(file, target) {
|
|
11
|
-
return shell_1.shell.exec("unzip", file, "-d", target);
|
|
10
|
+
function unzip(file, target, exec) {
|
|
11
|
+
return shell_1.shell.exec("unzip", ...(0, shell_1.withExecOptions)([file, "-d", target], exec));
|
|
12
12
|
}
|
|
13
|
-
function tar(source, target) {
|
|
14
|
-
return shell_1.shell.exec("tar", "-czf", target, source);
|
|
13
|
+
function tar(source, target, exec) {
|
|
14
|
+
return shell_1.shell.exec("tar", ...(0, shell_1.withExecOptions)(["-czf", target, source], exec));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=archive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/services/archive.ts"],"names":[],"mappings":";;AAGA,kBAEC;AAED,sBAEC;AAED,kBAEC;AAbD,
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/services/archive.ts"],"names":[],"mappings":";;AAGA,kBAEC;AAED,sBAEC;AAED,kBAEC;AAbD,mCAAiD;AAGjD,SAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,SAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface ArgoLoginOptions {
|
|
3
3
|
server: string;
|
|
4
4
|
username: string;
|
|
5
5
|
password: string;
|
|
6
6
|
insecure?: boolean;
|
|
7
|
+
exec?: ExecOptions;
|
|
7
8
|
}
|
|
8
9
|
export interface ArgoSyncOptions {
|
|
9
10
|
prune?: boolean;
|
|
11
|
+
exec?: ExecOptions;
|
|
10
12
|
}
|
|
11
13
|
export interface ArgoWaitOptions {
|
|
12
14
|
timeout?: number;
|
|
15
|
+
exec?: ExecOptions;
|
|
13
16
|
}
|
|
14
|
-
export declare function login({ server, username, password, insecure }: ArgoLoginOptions): Promise<ExecResult>;
|
|
15
|
-
export declare function appSync(name: string, { prune }?: ArgoSyncOptions): Promise<ExecResult>;
|
|
16
|
-
export declare function appGet(name: string): Promise<ExecResult>;
|
|
17
|
-
export declare function appWait(name: string, { timeout }?: ArgoWaitOptions): Promise<ExecResult>;
|
|
18
|
-
export declare function appSet(name: string, params?: Record<string, string
|
|
19
|
-
export declare function appList(): Promise<ExecResult>;
|
|
20
|
-
export declare function appRollback(name: string, revisionId: string): Promise<ExecResult>;
|
|
17
|
+
export declare function login({ server, username, password, insecure, exec }: ArgoLoginOptions): Promise<ExecResult>;
|
|
18
|
+
export declare function appSync(name: string, { prune, exec }?: ArgoSyncOptions): Promise<ExecResult>;
|
|
19
|
+
export declare function appGet(name: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
20
|
+
export declare function appWait(name: string, { timeout, exec }?: ArgoWaitOptions): Promise<ExecResult>;
|
|
21
|
+
export declare function appSet(name: string, params?: Record<string, string>, exec?: ExecOptions): Promise<ExecResult>;
|
|
22
|
+
export declare function appList(exec?: ExecOptions): Promise<ExecResult>;
|
|
23
|
+
export declare function appRollback(name: string, revisionId: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/argocd.js
CHANGED
|
@@ -8,41 +8,41 @@ exports.appSet = appSet;
|
|
|
8
8
|
exports.appList = appList;
|
|
9
9
|
exports.appRollback = appRollback;
|
|
10
10
|
const shell_1 = require("./shell");
|
|
11
|
-
function login({ server, username, password, insecure = false }) {
|
|
11
|
+
function login({ server, username, password, insecure = false, exec }) {
|
|
12
12
|
const args = ["login", server, "--username", username, "--password", password];
|
|
13
13
|
if (insecure) {
|
|
14
14
|
args.push("--insecure");
|
|
15
15
|
}
|
|
16
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
16
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
17
17
|
}
|
|
18
|
-
function appSync(name, { prune = false } = {}) {
|
|
18
|
+
function appSync(name, { prune = false, exec } = {}) {
|
|
19
19
|
const args = ["app", "sync", name];
|
|
20
20
|
if (prune) {
|
|
21
21
|
args.push("--prune");
|
|
22
22
|
}
|
|
23
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
23
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
24
24
|
}
|
|
25
|
-
function appGet(name) {
|
|
26
|
-
return shell_1.shell.exec("argocd", "app", "get", name);
|
|
25
|
+
function appGet(name, exec) {
|
|
26
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(["app", "get", name], exec));
|
|
27
27
|
}
|
|
28
|
-
function appWait(name, { timeout } = {}) {
|
|
28
|
+
function appWait(name, { timeout, exec } = {}) {
|
|
29
29
|
const args = ["app", "wait", name];
|
|
30
30
|
if (timeout) {
|
|
31
31
|
args.push("--timeout", String(timeout));
|
|
32
32
|
}
|
|
33
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
33
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
34
34
|
}
|
|
35
|
-
function appSet(name, params = {}) {
|
|
35
|
+
function appSet(name, params = {}, exec) {
|
|
36
36
|
const args = ["app", "set", name];
|
|
37
37
|
Object.entries(params).forEach(([k, v]) => {
|
|
38
38
|
args.push("-p", `${k}=${v}`);
|
|
39
39
|
});
|
|
40
|
-
return shell_1.shell.exec("argocd", ...args);
|
|
40
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(args, exec));
|
|
41
41
|
}
|
|
42
|
-
function appList() {
|
|
43
|
-
return shell_1.shell.exec("argocd", "app", "list");
|
|
42
|
+
function appList(exec) {
|
|
43
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(["app", "list"], exec));
|
|
44
44
|
}
|
|
45
|
-
function appRollback(name, revisionId) {
|
|
46
|
-
return shell_1.shell.exec("argocd", "app", "rollback", name, revisionId);
|
|
45
|
+
function appRollback(name, revisionId, exec) {
|
|
46
|
+
return shell_1.shell.exec("argocd", ...(0, shell_1.withExecOptions)(["app", "rollback", name, revisionId], exec));
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=argocd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argocd.js","sourceRoot":"","sources":["../../src/services/argocd.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"argocd.js","sourceRoot":"","sources":["../../src/services/argocd.ts"],"names":[],"mappings":";;AAqBA,sBAUC;AAED,0BAUC;AAED,wBAEC;AAED,0BAUC;AAED,wBAUC;AAED,0BAEC;AAED,kCAEC;AA/ED,mCAAiD;AAqBjD,SAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,IAAI,EAAoB;IAE1F,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE/E,IAAI,QAAQ,EAAE,CAAC;QACX,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEhE,CAAC;AAED,SAAgB,OAAO,CAAC,IAAY,EAAE,EAAE,KAA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E,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEhE,CAAC;AAED,SAAgB,OAAO,CAAC,IAAkB;IACtC,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAgB,WAAW,CAAC,IAAY,EAAE,UAAkB,EAAE,IAAkB;IAC5E,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC"}
|
package/dist/services/az.d.ts
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface AzLoginOptions {
|
|
3
3
|
username: string;
|
|
4
4
|
password: string;
|
|
5
5
|
tenant: string;
|
|
6
|
+
exec?: ExecOptions;
|
|
6
7
|
}
|
|
7
8
|
export interface AzAcrBuildOptions {
|
|
8
9
|
registry: string;
|
|
9
10
|
image: string;
|
|
10
11
|
file?: string;
|
|
12
|
+
exec?: ExecOptions;
|
|
11
13
|
}
|
|
12
14
|
export interface AzWebappDeployOptions {
|
|
13
15
|
name: string;
|
|
14
16
|
resourceGroup: string;
|
|
15
17
|
srcPath: string;
|
|
18
|
+
exec?: ExecOptions;
|
|
16
19
|
}
|
|
17
20
|
export interface AzAksCredentialsOptions {
|
|
18
21
|
name: string;
|
|
19
22
|
resourceGroup: string;
|
|
20
23
|
overwriteExisting?: boolean;
|
|
24
|
+
exec?: ExecOptions;
|
|
21
25
|
}
|
|
22
26
|
export interface AzDeploymentGroupOptions {
|
|
23
27
|
resourceGroup: string;
|
|
24
28
|
templateFile: string;
|
|
25
29
|
parameters?: Record<string, string>;
|
|
30
|
+
exec?: ExecOptions;
|
|
26
31
|
}
|
|
27
|
-
export declare function loginServicePrincipal({ username, password, tenant }: AzLoginOptions): Promise<ExecResult>;
|
|
28
|
-
export declare function setAccount(subscription: string): Promise<ExecResult>;
|
|
29
|
-
export declare function acrBuild({ registry, image, file }: AzAcrBuildOptions): Promise<ExecResult>;
|
|
30
|
-
export declare function acrLogin(registry: string): Promise<ExecResult>;
|
|
31
|
-
export declare function webappDeploy({ name, resourceGroup, srcPath }: AzWebappDeployOptions): Promise<ExecResult>;
|
|
32
|
-
export declare function aksGetCredentials({ name, resourceGroup, overwriteExisting }: AzAksCredentialsOptions): Promise<ExecResult>;
|
|
33
|
-
export declare function deploymentGroupCreate({ resourceGroup, templateFile, parameters }: AzDeploymentGroupOptions): Promise<ExecResult>;
|
|
32
|
+
export declare function loginServicePrincipal({ username, password, tenant, exec }: AzLoginOptions): Promise<ExecResult>;
|
|
33
|
+
export declare function setAccount(subscription: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
34
|
+
export declare function acrBuild({ registry, image, file, exec }: AzAcrBuildOptions): Promise<ExecResult>;
|
|
35
|
+
export declare function acrLogin(registry: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
36
|
+
export declare function webappDeploy({ name, resourceGroup, srcPath, exec }: AzWebappDeployOptions): Promise<ExecResult>;
|
|
37
|
+
export declare function aksGetCredentials({ name, resourceGroup, overwriteExisting, exec }: AzAksCredentialsOptions): Promise<ExecResult>;
|
|
38
|
+
export declare function deploymentGroupCreate({ resourceGroup, templateFile, parameters, exec }: AzDeploymentGroupOptions): Promise<ExecResult>;
|
package/dist/services/az.js
CHANGED
|
@@ -8,22 +8,25 @@ exports.webappDeploy = webappDeploy;
|
|
|
8
8
|
exports.aksGetCredentials = aksGetCredentials;
|
|
9
9
|
exports.deploymentGroupCreate = deploymentGroupCreate;
|
|
10
10
|
const shell_1 = require("./shell");
|
|
11
|
-
function loginServicePrincipal({ username, password, tenant }) {
|
|
12
|
-
|
|
11
|
+
function loginServicePrincipal({ username, password, tenant, exec }) {
|
|
12
|
+
const args = ["login", "--service-principal", "-u", username, "-p", password, "--tenant", tenant];
|
|
13
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
13
14
|
}
|
|
14
|
-
function setAccount(subscription) {
|
|
15
|
-
return shell_1.shell.exec("az", "account", "set", "--subscription", subscription);
|
|
15
|
+
function setAccount(subscription, exec) {
|
|
16
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(["account", "set", "--subscription", subscription], exec));
|
|
16
17
|
}
|
|
17
|
-
function acrBuild({ registry, image, file = "." }) {
|
|
18
|
-
|
|
18
|
+
function acrBuild({ registry, image, file = ".", exec }) {
|
|
19
|
+
const args = ["acr", "build", "--registry", registry, "--image", image, file];
|
|
20
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
19
21
|
}
|
|
20
|
-
function acrLogin(registry) {
|
|
21
|
-
return shell_1.shell.exec("az", "acr", "login", "--name", registry);
|
|
22
|
+
function acrLogin(registry, exec) {
|
|
23
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(["acr", "login", "--name", registry], exec));
|
|
22
24
|
}
|
|
23
|
-
function webappDeploy({ name, resourceGroup, srcPath }) {
|
|
24
|
-
|
|
25
|
+
function webappDeploy({ name, resourceGroup, srcPath, exec }) {
|
|
26
|
+
const args = ["webapp", "deploy", "--name", name, "--resource-group", resourceGroup, "--src-path", srcPath];
|
|
27
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
25
28
|
}
|
|
26
|
-
function aksGetCredentials({ name, resourceGroup, overwriteExisting = true }) {
|
|
29
|
+
function aksGetCredentials({ name, resourceGroup, overwriteExisting = true, exec }) {
|
|
27
30
|
const args = [
|
|
28
31
|
"aks", "get-credentials",
|
|
29
32
|
"--name", name,
|
|
@@ -32,9 +35,9 @@ function aksGetCredentials({ name, resourceGroup, overwriteExisting = true }) {
|
|
|
32
35
|
if (overwriteExisting) {
|
|
33
36
|
args.push("--overwrite-existing");
|
|
34
37
|
}
|
|
35
|
-
return shell_1.shell.exec("az", ...args);
|
|
38
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
36
39
|
}
|
|
37
|
-
function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {} }) {
|
|
40
|
+
function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {}, exec }) {
|
|
38
41
|
const args = [
|
|
39
42
|
"deployment", "group", "create",
|
|
40
43
|
"--resource-group", resourceGroup,
|
|
@@ -43,6 +46,6 @@ function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {} })
|
|
|
43
46
|
Object.entries(parameters).forEach(([k, v]) => {
|
|
44
47
|
args.push("--parameters", `${k}=${v}`);
|
|
45
48
|
});
|
|
46
|
-
return shell_1.shell.exec("az", ...args);
|
|
49
|
+
return shell_1.shell.exec("az", ...(0, shell_1.withExecOptions)(args, exec));
|
|
47
50
|
}
|
|
48
51
|
//# sourceMappingURL=az.js.map
|
package/dist/services/az.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"az.js","sourceRoot":"","sources":["../../src/services/az.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"az.js","sourceRoot":"","sources":["../../src/services/az.ts"],"names":[],"mappings":";;AAsCA,sDAMC;AAED,gCAEC;AAED,4BAMC;AAED,4BAEC;AAED,oCAMC;AAED,8CAcC;AAED,sDAcC;AApGD,mCAAiD;AAsCjD,SAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAkB;IAEtF,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,QAAQ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,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE5D,CAAC;AAED,SAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,GAAG,IAAI,EAAE,IAAI,EAA2B;IAE9G,MAAM,IAAI,GAAG;QACT,KAAK,EAAE,iBAAiB;QACxB,QAAQ,EAAE,IAAI;QACd,kBAAkB,EAAE,aAAa;KACpC,CAAC;IAEF,IAAI,iBAAiB,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,aAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE5D,CAAC;AAED,SAAgB,qBAAqB,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,GAAG,EAAE,EAAE,IAAI,EAA4B;IAElH,MAAM,IAAI,GAAG;QACT,YAAY,EAAE,OAAO,EAAE,QAAQ;QAC/B,kBAAkB,EAAE,aAAa;QACjC,iBAAiB,EAAE,YAAY;KAClC,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QAC1C,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,OAAO,aAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE5D,CAAC"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface DockerBuildOptions {
|
|
3
3
|
image: string;
|
|
4
4
|
context?: string;
|
|
5
5
|
dockerfile?: string;
|
|
6
6
|
buildArgs?: Record<string, string>;
|
|
7
|
+
/** retry/timeout/dryRun para esta llamada puntual. */
|
|
8
|
+
exec?: ExecOptions;
|
|
7
9
|
}
|
|
8
10
|
export interface DockerLoginOptions {
|
|
9
11
|
registry: string;
|
|
10
12
|
username: string;
|
|
11
13
|
password: string;
|
|
14
|
+
exec?: ExecOptions;
|
|
12
15
|
}
|
|
13
|
-
export declare function build({ image, context, dockerfile, buildArgs }: DockerBuildOptions): Promise<ExecResult>;
|
|
14
|
-
export declare function push(image: string): Promise<ExecResult>;
|
|
15
|
-
export declare function tag(source: string, target: string): Promise<ExecResult>;
|
|
16
|
-
export declare function login({ registry, username, password }: DockerLoginOptions): Promise<ExecResult>;
|
|
17
|
-
export declare function pull(image: string): Promise<ExecResult>;
|
|
18
|
-
export declare function rmi(image: string): Promise<ExecResult>;
|
|
16
|
+
export declare function build({ image, context, dockerfile, buildArgs, exec }: DockerBuildOptions): Promise<ExecResult>;
|
|
17
|
+
export declare function push(image: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
18
|
+
export declare function tag(source: string, target: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
19
|
+
export declare function login({ registry, username, password, exec }: DockerLoginOptions): Promise<ExecResult>;
|
|
20
|
+
export declare function pull(image: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
21
|
+
export declare function rmi(image: string, exec?: ExecOptions): Promise<ExecResult>;
|