@cat-indev/catops-cli 0.0.1-alpha.7 → 0.0.1-alpha.9
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 +76 -40
- package/dist/core/Menu.js +4 -3
- package/dist/core/Menu.js.map +1 -1
- package/dist/core/Notifier.js +7 -7
- package/dist/core/Notifier.js.map +1 -1
- package/dist/core/classifiers.d.ts +2 -1
- package/dist/core/classifiers.js +3 -2
- package/dist/core/classifiers.js.map +1 -1
- package/dist/core/messages.d.ts +3 -2
- package/dist/core/messages.js +4 -3
- package/dist/core/messages.js.map +1 -1
- 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/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,I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B;IAExF,MAAM,IAAI,GAAG,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"}
|
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,sDA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AI,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>;
|
package/dist/services/docker.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.login = login;
|
|
|
7
7
|
exports.pull = pull;
|
|
8
8
|
exports.rmi = rmi;
|
|
9
9
|
const shell_1 = require("./shell");
|
|
10
|
-
function build({ image, context = ".", dockerfile, buildArgs = {} }) {
|
|
10
|
+
function build({ image, context = ".", dockerfile, buildArgs = {}, exec }) {
|
|
11
11
|
const args = ["build", "-t", image];
|
|
12
12
|
if (dockerfile) {
|
|
13
13
|
args.push("-f", dockerfile);
|
|
@@ -16,21 +16,21 @@ function build({ image, context = ".", dockerfile, buildArgs = {} }) {
|
|
|
16
16
|
args.push("--build-arg", `${k}=${v}`);
|
|
17
17
|
});
|
|
18
18
|
args.push(context);
|
|
19
|
-
return shell_1.shell.exec("docker", ...args);
|
|
19
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(args, exec));
|
|
20
20
|
}
|
|
21
|
-
function push(image) {
|
|
22
|
-
return shell_1.shell.exec("docker", "push", image);
|
|
21
|
+
function push(image, exec) {
|
|
22
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["push", image], exec));
|
|
23
23
|
}
|
|
24
|
-
function tag(source, target) {
|
|
25
|
-
return shell_1.shell.exec("docker", "tag", source, target);
|
|
24
|
+
function tag(source, target, exec) {
|
|
25
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["tag", source, target], exec));
|
|
26
26
|
}
|
|
27
|
-
function login({ registry, username, password }) {
|
|
28
|
-
return shell_1.shell.exec("docker", "login", registry, "-u", username, "-p", password);
|
|
27
|
+
function login({ registry, username, password, exec }) {
|
|
28
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["login", registry, "-u", username, "-p", password], exec));
|
|
29
29
|
}
|
|
30
|
-
function pull(image) {
|
|
31
|
-
return shell_1.shell.exec("docker", "pull", image);
|
|
30
|
+
function pull(image, exec) {
|
|
31
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["pull", image], exec));
|
|
32
32
|
}
|
|
33
|
-
function rmi(image) {
|
|
34
|
-
return shell_1.shell.exec("docker", "rmi", image);
|
|
33
|
+
function rmi(image, exec) {
|
|
34
|
+
return shell_1.shell.exec("docker", ...(0, shell_1.withExecOptions)(["rmi", image], exec));
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=docker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/services/docker.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/services/docker.ts"],"names":[],"mappings":";;AAmBA,sBAsBC;AAED,oBAEC;AAED,kBAEC;AAED,sBAEC;AAED,oBAEC;AAED,kBAEC;AA7DD,mCAAiD;AAmBjD,SAAgB,KAAK,CAAC,EAClB,KAAK,EACL,OAAO,GAAG,GAAG,EACb,UAAU,EACV,SAAS,GAAG,EAAE,EACd,IAAI,EACa;IAEjB,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAEpC,IAAI,UAAU,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACzC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEhE,CAAC;AAED,SAAgB,IAAI,CAAC,KAAa,EAAE,IAAkB;IAClD,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,IAAkB;IAClE,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAsB;IAC5E,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/G,CAAC;AAED,SAAgB,IAAI,CAAC,KAAa,EAAE,IAAkB;IAClD,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,SAAgB,GAAG,CAAC,KAAa,EAAE,IAAkB;IACjD,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/services/git.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
2
|
-
export declare function clone(url: string, targetPath: string): Promise<ExecResult>;
|
|
3
|
-
export declare function checkout(branch: string): Promise<ExecResult>;
|
|
4
|
-
export declare function pull(): Promise<ExecResult>;
|
|
5
|
-
export declare function fetch(): Promise<ExecResult>;
|
|
6
|
-
export declare function tag(name: string): Promise<ExecResult>;
|
|
7
|
-
export declare function commit(message: string): Promise<ExecResult>;
|
|
8
|
-
export declare function push(): Promise<ExecResult>;
|
|
9
|
-
export declare function revParse(): Promise<ExecResult>;
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
|
+
export declare function clone(url: string, targetPath: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
3
|
+
export declare function checkout(branch: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
4
|
+
export declare function pull(exec?: ExecOptions): Promise<ExecResult>;
|
|
5
|
+
export declare function fetch(exec?: ExecOptions): Promise<ExecResult>;
|
|
6
|
+
export declare function tag(name: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
7
|
+
export declare function commit(message: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
8
|
+
export declare function push(exec?: ExecOptions): Promise<ExecResult>;
|
|
9
|
+
export declare function revParse(exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/git.js
CHANGED
|
@@ -9,28 +9,28 @@ exports.commit = commit;
|
|
|
9
9
|
exports.push = push;
|
|
10
10
|
exports.revParse = revParse;
|
|
11
11
|
const shell_1 = require("./shell");
|
|
12
|
-
function clone(url, targetPath) {
|
|
13
|
-
return shell_1.shell.exec("git", "clone", url, targetPath);
|
|
12
|
+
function clone(url, targetPath, exec) {
|
|
13
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["clone", url, targetPath], exec));
|
|
14
14
|
}
|
|
15
|
-
function checkout(branch) {
|
|
16
|
-
return shell_1.shell.exec("git", "checkout", branch);
|
|
15
|
+
function checkout(branch, exec) {
|
|
16
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["checkout", branch], exec));
|
|
17
17
|
}
|
|
18
|
-
function pull() {
|
|
19
|
-
return shell_1.shell.exec("git", "pull");
|
|
18
|
+
function pull(exec) {
|
|
19
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["pull"], exec));
|
|
20
20
|
}
|
|
21
|
-
function fetch() {
|
|
22
|
-
return shell_1.shell.exec("git", "fetch", "--all");
|
|
21
|
+
function fetch(exec) {
|
|
22
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["fetch", "--all"], exec));
|
|
23
23
|
}
|
|
24
|
-
function tag(name) {
|
|
25
|
-
return shell_1.shell.exec("git", "tag", name);
|
|
24
|
+
function tag(name, exec) {
|
|
25
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["tag", name], exec));
|
|
26
26
|
}
|
|
27
|
-
function commit(message) {
|
|
28
|
-
return shell_1.shell.exec("git", "commit", "-m", message);
|
|
27
|
+
function commit(message, exec) {
|
|
28
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["commit", "-m", message], exec));
|
|
29
29
|
}
|
|
30
|
-
function push() {
|
|
31
|
-
return shell_1.shell.exec("git", "push");
|
|
30
|
+
function push(exec) {
|
|
31
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["push"], exec));
|
|
32
32
|
}
|
|
33
|
-
function revParse() {
|
|
34
|
-
return shell_1.shell.exec("git", "rev-parse", "HEAD");
|
|
33
|
+
function revParse(exec) {
|
|
34
|
+
return shell_1.shell.exec("git", ...(0, shell_1.withExecOptions)(["rev-parse", "HEAD"], exec));
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=git.js.map
|
package/dist/services/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/services/git.ts"],"names":[],"mappings":";;AAGA,sBAEC;AAED,4BAEC;AAED,oBAEC;AAED,sBAEC;AAED,kBAEC;AAED,wBAEC;AAED,oBAEC;AAED,4BAEC;AAjCD,
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/services/git.ts"],"names":[],"mappings":";;AAGA,sBAEC;AAED,4BAEC;AAED,oBAEC;AAED,sBAEC;AAED,kBAEC;AAED,wBAEC;AAED,oBAEC;AAED,4BAEC;AAjCD,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AG,IAAA,uBAAe,EAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAgB,QAAQ,CAAC,IAAkB;IACvC,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/services/helm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
2
|
-
export declare function install(name: string, chart: string, values?: string): Promise<ExecResult>;
|
|
3
|
-
export declare function upgrade(name: string, chart: string, values?: string): Promise<ExecResult>;
|
|
4
|
-
export declare function uninstall(name: string): Promise<ExecResult>;
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
|
+
export declare function install(name: string, chart: string, values?: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
3
|
+
export declare function upgrade(name: string, chart: string, values?: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
4
|
+
export declare function uninstall(name: string, exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/helm.js
CHANGED
|
@@ -4,21 +4,21 @@ exports.install = install;
|
|
|
4
4
|
exports.upgrade = upgrade;
|
|
5
5
|
exports.uninstall = uninstall;
|
|
6
6
|
const shell_1 = require("./shell");
|
|
7
|
-
function install(name, chart, values) {
|
|
7
|
+
function install(name, chart, values, exec) {
|
|
8
8
|
const args = ["install", name, chart];
|
|
9
9
|
if (values) {
|
|
10
10
|
args.push("-f", values);
|
|
11
11
|
}
|
|
12
|
-
return shell_1.shell.exec("helm", ...args);
|
|
12
|
+
return shell_1.shell.exec("helm", ...(0, shell_1.withExecOptions)(args, exec));
|
|
13
13
|
}
|
|
14
|
-
function upgrade(name, chart, values) {
|
|
14
|
+
function upgrade(name, chart, values, exec) {
|
|
15
15
|
const args = ["upgrade", name, chart];
|
|
16
16
|
if (values) {
|
|
17
17
|
args.push("-f", values);
|
|
18
18
|
}
|
|
19
|
-
return shell_1.shell.exec("helm", ...args);
|
|
19
|
+
return shell_1.shell.exec("helm", ...(0, shell_1.withExecOptions)(args, exec));
|
|
20
20
|
}
|
|
21
|
-
function uninstall(name) {
|
|
22
|
-
return shell_1.shell.exec("helm", "uninstall", name);
|
|
21
|
+
function uninstall(name, exec) {
|
|
22
|
+
return shell_1.shell.exec("helm", ...(0, shell_1.withExecOptions)(["uninstall", name], exec));
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=helm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helm.js","sourceRoot":"","sources":["../../src/services/helm.ts"],"names":[],"mappings":";;AAGA,0BAUC;AAED,0BAUC;AAED,8BAEC;AA7BD,
|
|
1
|
+
{"version":3,"file":"helm.js","sourceRoot":"","sources":["../../src/services/helm.ts"],"names":[],"mappings":";;AAGA,0BAUC;AAED,0BAUC;AAED,8BAEC;AA7BD,mCAAiD;AAGjD,SAAgB,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,MAAe,EAAE,IAAkB;IAEpF,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAEtC,IAAI,MAAM,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE9D,CAAC;AAED,SAAgB,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,MAAe,EAAE,IAAkB;IAEpF,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAEtC,IAAI,MAAM,EAAE,CAAC;QACT,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAA,uBAAe,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE9D,CAAC;AAED,SAAgB,SAAS,CAAC,IAAY,EAAE,IAAkB;IACtD,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface KubectlOptions {
|
|
3
3
|
/** Ruta al archivo kubeconfig. Se pasa como --kubeconfig <path>. */
|
|
4
4
|
kubeconfig?: string;
|
|
5
5
|
/** Namespace destino. Se pasa como -n <namespace>. */
|
|
6
6
|
namespace?: string;
|
|
7
|
+
/** retry/timeout/dryRun para esta llamada puntual (ver shell.exec). */
|
|
8
|
+
exec?: ExecOptions;
|
|
7
9
|
}
|
|
8
10
|
export declare function apply(file: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
9
11
|
export declare function del(file: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
10
12
|
/**
|
|
11
13
|
* Igual que antes (`kubectl.get("pods", "-o", "wide")`), pero ahora también
|
|
12
14
|
* acepta KubectlOptions como último argumento:
|
|
13
|
-
* kubectl.get("pods", "-o", "wide", { namespace: "prod" })
|
|
15
|
+
* kubectl.get("pods", "-o", "wide", { namespace: "prod", exec: { retry: 3 } })
|
|
14
16
|
*/
|
|
15
17
|
export declare function get(...rawArgs: Array<string | KubectlOptions>): Promise<ExecResult>;
|
|
16
18
|
export declare function logs(pod: string, options?: KubectlOptions): Promise<ExecResult>;
|
package/dist/services/kubectl.js
CHANGED
|
@@ -15,7 +15,7 @@ function isKubectlOptions(value) {
|
|
|
15
15
|
return Boolean(value)
|
|
16
16
|
&& typeof value === "object"
|
|
17
17
|
&& !Array.isArray(value)
|
|
18
|
-
&& ("kubeconfig" in value || "namespace" in value || Object.keys(value).length === 0);
|
|
18
|
+
&& ("kubeconfig" in value || "namespace" in value || "exec" in value || Object.keys(value).length === 0);
|
|
19
19
|
}
|
|
20
20
|
function withGlobalFlags(args, options = {}) {
|
|
21
21
|
const result = [...args];
|
|
@@ -27,16 +27,21 @@ function withGlobalFlags(args, options = {}) {
|
|
|
27
27
|
}
|
|
28
28
|
return result;
|
|
29
29
|
}
|
|
30
|
+
/** Arma los args finales para shell.exec: flags (--kubeconfig/-n) + el objeto exec al final, si se pasó. */
|
|
31
|
+
function toExecArgs(args, options = {}) {
|
|
32
|
+
const withFlags = withGlobalFlags(args, options);
|
|
33
|
+
return options.exec ? [...withFlags, options.exec] : withFlags;
|
|
34
|
+
}
|
|
30
35
|
function apply(file, options = {}) {
|
|
31
|
-
return shell_1.shell.exec("kubectl", ...
|
|
36
|
+
return shell_1.shell.exec("kubectl", ...toExecArgs(["apply", "-f", file], options));
|
|
32
37
|
}
|
|
33
38
|
function del(file, options = {}) {
|
|
34
|
-
return shell_1.shell.exec("kubectl", ...
|
|
39
|
+
return shell_1.shell.exec("kubectl", ...toExecArgs(["delete", "-f", file], options));
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
42
|
* Igual que antes (`kubectl.get("pods", "-o", "wide")`), pero ahora también
|
|
38
43
|
* acepta KubectlOptions como último argumento:
|
|
39
|
-
* kubectl.get("pods", "-o", "wide", { namespace: "prod" })
|
|
44
|
+
* kubectl.get("pods", "-o", "wide", { namespace: "prod", exec: { retry: 3 } })
|
|
40
45
|
*/
|
|
41
46
|
function get(...rawArgs) {
|
|
42
47
|
let args = rawArgs;
|
|
@@ -46,16 +51,16 @@ function get(...rawArgs) {
|
|
|
46
51
|
options = last;
|
|
47
52
|
args = rawArgs.slice(0, -1);
|
|
48
53
|
}
|
|
49
|
-
return shell_1.shell.exec("kubectl", "get", ...
|
|
54
|
+
return shell_1.shell.exec("kubectl", "get", ...toExecArgs(args, options));
|
|
50
55
|
}
|
|
51
56
|
function logs(pod, options = {}) {
|
|
52
|
-
return shell_1.shell.exec("kubectl", ...
|
|
57
|
+
return shell_1.shell.exec("kubectl", ...toExecArgs(["logs", pod], options));
|
|
53
58
|
}
|
|
54
59
|
function rolloutStatus(deployment, options = {}) {
|
|
55
|
-
return shell_1.shell.exec("kubectl", ...
|
|
60
|
+
return shell_1.shell.exec("kubectl", ...toExecArgs(["rollout", "status", deployment], options));
|
|
56
61
|
}
|
|
57
62
|
function setImage(resource, image, options = {}) {
|
|
58
|
-
return shell_1.shell.exec("kubectl", ...
|
|
63
|
+
return shell_1.shell.exec("kubectl", ...toExecArgs(["set", "image", resource, image], options));
|
|
59
64
|
}
|
|
60
65
|
// ---------------------------------------------------------------------------
|
|
61
66
|
// waitForDeployment — validación cíclica del rollout de un Deployment
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kubectl.js","sourceRoot":"","sources":["../../src/services/kubectl.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"kubectl.js","sourceRoot":"","sources":["../../src/services/kubectl.ts"],"names":[],"mappings":";;;AAiDA,sBAEC;AAED,kBAEC;AAmCe,qBAAM;AA5BtB,kBAcC;AAED,oBAEC;AAED,sCAEC;AAED,4BAEC;AA4ID,8CA2EC;AAsGD,wDA8EC;AAneD,mCAAgC;AAiBhC,SAAS,gBAAgB,CAAC,KAAc;IACpC,OAAO,OAAO,CAAC,KAAK,CAAC;WACd,OAAO,KAAK,KAAK,QAAQ;WACzB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;WACrB,CAAC,YAAY,IAAK,KAAgB,IAAI,WAAW,IAAK,KAAgB,IAAI,MAAM,IAAK,KAAgB,IAAI,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;AAC/J,CAAC;AAED,SAAS,eAAe,CAAC,I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YACR,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,QAAQ;YAClC,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACrD,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IAEzC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAEhB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,MAAM,OAAO,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,2BAA2B,QAAQ,mCAAmC,OAAO,EAAE,CAAC;QAEhI,MAAM,IAAI,2BAA2B,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtG,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,MAAM,2BAA2B,QAAQ,iCAAiC,CAAC;IAExG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAEnF,CAAC"}
|
package/dist/services/npm.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
2
|
-
export declare function install(): Promise<ExecResult>;
|
|
3
|
-
export declare function ci(): Promise<ExecResult>;
|
|
4
|
-
export declare function run(script: string): Promise<ExecResult>;
|
|
5
|
-
export declare function publish(): Promise<ExecResult>;
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
|
+
export declare function install(exec?: ExecOptions): Promise<ExecResult>;
|
|
3
|
+
export declare function ci(exec?: ExecOptions): Promise<ExecResult>;
|
|
4
|
+
export declare function run(script: string, exec?: ExecOptions): Promise<ExecResult>;
|
|
5
|
+
export declare function publish(exec?: ExecOptions): Promise<ExecResult>;
|
package/dist/services/npm.js
CHANGED
|
@@ -5,16 +5,16 @@ exports.ci = ci;
|
|
|
5
5
|
exports.run = run;
|
|
6
6
|
exports.publish = publish;
|
|
7
7
|
const shell_1 = require("./shell");
|
|
8
|
-
function install() {
|
|
9
|
-
return shell_1.shell.exec("npm", "install");
|
|
8
|
+
function install(exec) {
|
|
9
|
+
return shell_1.shell.exec("npm", ...(0, shell_1.withExecOptions)(["install"], exec));
|
|
10
10
|
}
|
|
11
|
-
function ci() {
|
|
12
|
-
return shell_1.shell.exec("npm", "ci");
|
|
11
|
+
function ci(exec) {
|
|
12
|
+
return shell_1.shell.exec("npm", ...(0, shell_1.withExecOptions)(["ci"], exec));
|
|
13
13
|
}
|
|
14
|
-
function run(script) {
|
|
15
|
-
return shell_1.shell.exec("npm", "run", script);
|
|
14
|
+
function run(script, exec) {
|
|
15
|
+
return shell_1.shell.exec("npm", ...(0, shell_1.withExecOptions)(["run", script], exec));
|
|
16
16
|
}
|
|
17
|
-
function publish() {
|
|
18
|
-
return shell_1.shell.exec("npm", "publish");
|
|
17
|
+
function publish(exec) {
|
|
18
|
+
return shell_1.shell.exec("npm", ...(0, shell_1.withExecOptions)(["publish"], exec));
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=npm.js.map
|
package/dist/services/npm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/services/npm.ts"],"names":[],"mappings":";;AAGA,0BAEC;AAED,gBAEC;AAED,kBAEC;AAED,0BAEC;AAjBD,
|
|
1
|
+
{"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/services/npm.ts"],"names":[],"mappings":";;AAGA,0BAEC;AAED,gBAEC;AAED,kBAEC;AAED,0BAEC;AAjBD,mCAAiD;AAGjD,SAAgB,OAAO,CAAC,IAAkB;IACtC,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,EAAE,CAAC,IAAkB;IACjC,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,SAAgB,GAAG,CAAC,MAAc,EAAE,IAAkB;IAClD,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,SAAgB,OAAO,CAAC,IAAkB;IACtC,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAA,uBAAe,EAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/services/oc.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { ExecResult } from "../core/types";
|
|
1
|
+
import type { ExecOptions, ExecResult } from "../core/types";
|
|
2
2
|
export interface OcOptions {
|
|
3
3
|
/** Ruta al archivo kubeconfig. Se pasa como --kubeconfig <path>. */
|
|
4
4
|
kubeconfig?: string;
|
|
5
5
|
/** Namespace/proyecto destino. Se pasa como -n <namespace>. */
|
|
6
6
|
namespace?: string;
|
|
7
|
+
/** retry/timeout/dryRun para esta llamada puntual (ver shell.exec). */
|
|
8
|
+
exec?: ExecOptions;
|
|
7
9
|
}
|
|
8
10
|
export interface OcLoginOptions extends OcOptions {
|
|
9
11
|
server: string;
|
|
@@ -15,13 +17,21 @@ export interface OcLoginOptions extends OcOptions {
|
|
|
15
17
|
export interface OcStartBuildOptions extends OcOptions {
|
|
16
18
|
follow?: boolean;
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Ejemplo — 10 reintentos ante un login inestable:
|
|
22
|
+
* await ctx.services.oc.login({
|
|
23
|
+
* server: "https://api.cluster:6443",
|
|
24
|
+
* token: process.env.OC_TOKEN,
|
|
25
|
+
* exec: { retry: 10, retryDelay: 2000 }
|
|
26
|
+
* });
|
|
27
|
+
*/
|
|
18
28
|
export declare function login({ server, token, username, password, insecureSkipTlsVerify, ...options }: OcLoginOptions): Promise<ExecResult>;
|
|
19
29
|
export declare function project(name: string, options?: OcOptions): Promise<ExecResult>;
|
|
20
30
|
export declare function apply(file: string, options?: OcOptions): Promise<ExecResult>;
|
|
21
31
|
/**
|
|
22
32
|
* Igual que antes (`oc.get("pods", "-o", "wide")`), pero ahora también
|
|
23
33
|
* acepta OcOptions como último argumento:
|
|
24
|
-
* oc.get("pods", "-o", "wide", { namespace: "prod" })
|
|
34
|
+
* oc.get("pods", "-o", "wide", { namespace: "prod", exec: { retry: 3 } })
|
|
25
35
|
*/
|
|
26
36
|
export declare function get(...rawArgs: Array<string | OcOptions>): Promise<ExecResult>;
|
|
27
37
|
export declare function rollout(deployment: string, options?: OcOptions): Promise<ExecResult>;
|