@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.
Files changed (41) hide show
  1. package/README.md +63 -36
  2. package/dist/services/ansible.d.ts +7 -6
  3. package/dist/services/ansible.js +10 -10
  4. package/dist/services/ansible.js.map +1 -1
  5. package/dist/services/archive.d.ts +4 -4
  6. package/dist/services/archive.js +6 -6
  7. package/dist/services/archive.js.map +1 -1
  8. package/dist/services/argocd.d.ts +11 -8
  9. package/dist/services/argocd.js +14 -14
  10. package/dist/services/argocd.js.map +1 -1
  11. package/dist/services/az.d.ts +13 -8
  12. package/dist/services/az.js +17 -14
  13. package/dist/services/az.js.map +1 -1
  14. package/dist/services/docker.d.ts +10 -7
  15. package/dist/services/docker.js +12 -12
  16. package/dist/services/docker.js.map +1 -1
  17. package/dist/services/git.d.ts +9 -9
  18. package/dist/services/git.js +16 -16
  19. package/dist/services/git.js.map +1 -1
  20. package/dist/services/helm.d.ts +4 -4
  21. package/dist/services/helm.js +6 -6
  22. package/dist/services/helm.js.map +1 -1
  23. package/dist/services/kubectl.d.ts +4 -2
  24. package/dist/services/kubectl.js +13 -8
  25. package/dist/services/kubectl.js.map +1 -1
  26. package/dist/services/npm.d.ts +5 -5
  27. package/dist/services/npm.js +8 -8
  28. package/dist/services/npm.js.map +1 -1
  29. package/dist/services/oc.d.ts +12 -2
  30. package/dist/services/oc.js +22 -9
  31. package/dist/services/oc.js.map +1 -1
  32. package/dist/services/shell.d.ts +8 -0
  33. package/dist/services/shell.js +11 -0
  34. package/dist/services/shell.js.map +1 -1
  35. package/dist/services/tekton.d.ts +8 -6
  36. package/dist/services/tekton.js +10 -10
  37. package/dist/services/tekton.js.map +1 -1
  38. package/dist/services/terraform.d.ts +13 -8
  39. package/dist/services/terraform.js +14 -14
  40. package/dist/services/terraform.js.map +1 -1
  41. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # devops-cli
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 devops-cli
20
- # o si lo publicas con scope propio, p.ej. @miorg/devops-cli
21
- npm install @miorg/devops-cli
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 devops-cli
28
- npm pack # genera devops-cli-<version>.tgz
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/devops-cli-<version>.tgz
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 devops-cli
37
+ # Dentro del repo de catops-cli
38
38
  npm link
39
39
 
40
40
  # Dentro del proyecto consumidor
41
- npm link devops-cli
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/devops-cli.git
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 "devops-cli";
54
+ import { Context, Menu, services, type MenuDefinition } from "catops-cli";
55
55
  ```
56
56
  ```javascript
57
- const { Context, Menu, services } = require("devops-cli");
57
+ const { Context, Menu, services } = require("catops-cli");
58
58
  ```
59
- 2. El binario: `npx devops-cli` (o `devops-cli` si lo instalaste global con `-g`).
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/devops-cli)
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
- devops-cli.ts -> CLI ejecutable (busca devops.pipeline.js en el proyecto consumidor)
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` / `.devops-cli.js`) en la raíz de tu proyecto:
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 devops-cli --debug --env=prod
122
+ npx catops-cli --debug --env=prod
123
123
  ```
124
124
 
125
- `devops-cli` detecta el archivo, arma el `Context` a partir de los flags/params de `argv`, y renderiza el menú.
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 "devops-cli";
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("devops-cli"); // o require("./dist") dentro de este repo
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
- devops-cli --menu-selector=docker --docker-action=build
213
+ catops-cli --menu-selector=docker --docker-action=build
214
214
 
215
215
  # un solo nivel:
216
- devops-cli --menu-selector=deploy
216
+ catops-cli --menu-selector=deploy
217
217
 
218
218
  # sin flags -> menú interactivo normal
219
- devops-cli
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
- Defaults globales para todo el proceso:
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 devops-cli --dry-run # activa dryRun global
275
- npx devops-cli --retry=3 --timeout=15000
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("devops-cli");
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: "./devops-cli-errors.log" })); // TODO error, sin importar el área
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/devops-cli`.
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>;
@@ -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":";;AASA,4BAcC;AAED,sBAUC;AAED,oCAEC;AAED,oCAEC;AAED,sCAEC;AA/CD,mCAAgC;AAShC,SAAgB,QAAQ,CAAC,YAAoB,EAAE,EAAE,SAAS,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,KAA6B,EAAE;IAE3G,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,SAAS,IAAI,eAAe,EAAE,YAAY,CAAC,CAAC;IAEhE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACzC,IAAI,CAAC,IAAI,CAAC,cAAc,EA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,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>;
@@ -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,kBA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,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>): Promise<ExecResult>;
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>;
@@ -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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AAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAElC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACtC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,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"}
@@ -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>;
@@ -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
- return shell_1.shell.exec("az", "login", "--service-principal", "-u", username, "-p", password, "--tenant", tenant);
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
- return shell_1.shell.exec("az", "acr", "build", "--registry", registry, "--image", image, file);
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
- return shell_1.shell.exec("az", "webapp", "deploy", "--name", name, "--resource-group", resourceGroup, "--src-path", srcPath);
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
@@ -1 +1 @@
1
- {"version":3,"file":"az.js","sourceRoot":"","sources":["../../src/services/az.ts"],"names":[],"mappings":";;AAiCA,sDAUC;AAED,gCAEC;AAED,4BASC;AAED,4BAEC;AAED,oCASC;AAED,8CAcC;AAED,sDAcC;AAzGD,mCAAgC;AAiChC,SAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAkB;IAEhF,OAAO,aAAK,CAAC,IAAI,CACb,IAAI,EAAE,OAAO,EACb,qBAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,CACrB,CAAC;AAEN,CAAC;AAED,SAAgB,UAAU,CAAC,YAAoB;IAC3C,OAAO,aAAK,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC9E,CAAC;AAED,SAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,GAAG,GAAG,EAAqB;IAEvE,OAAO,aAAK,CAAC,IAAI,CACb,IAAI,EAAE,KAAK,EAAE,OAAO,EACpB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,KAAK,EAChB,IAAI,CACP,CAAC;AAEN,CAAC;AAED,SAAgB,QAAQ,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AAC,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>;