@cat-indev/catops-cli 0.0.1-alpha.5
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/LICENSE +21 -0
- package/README.md +397 -0
- package/dist/bin/devops-cli.d.ts +2 -0
- package/dist/bin/devops-cli.js +132 -0
- package/dist/bin/devops-cli.js.map +1 -0
- package/dist/core/Context.d.ts +42 -0
- package/dist/core/Context.js +153 -0
- package/dist/core/Context.js.map +1 -0
- package/dist/core/Menu.d.ts +23 -0
- package/dist/core/Menu.js +159 -0
- package/dist/core/Menu.js.map +1 -0
- package/dist/core/Notifier.d.ts +27 -0
- package/dist/core/Notifier.js +93 -0
- package/dist/core/Notifier.js.map +1 -0
- package/dist/core/classifiers.d.ts +31 -0
- package/dist/core/classifiers.js +53 -0
- package/dist/core/classifiers.js.map +1 -0
- package/dist/core/logger.d.ts +8 -0
- package/dist/core/logger.js +37 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/prompt.d.ts +10 -0
- package/dist/core/prompt.js +87 -0
- package/dist/core/prompt.js.map +1 -0
- package/dist/core/senders.d.ts +27 -0
- package/dist/core/senders.js +109 -0
- package/dist/core/senders.js.map +1 -0
- package/dist/core/types.d.ts +105 -0
- package/dist/core/types.js +3 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/services/ansible.d.ts +11 -0
- package/dist/services/ansible.js +35 -0
- package/dist/services/ansible.js.map +1 -0
- package/dist/services/archive.d.ts +4 -0
- package/dist/services/archive.js +16 -0
- package/dist/services/archive.js.map +1 -0
- package/dist/services/argocd.d.ts +20 -0
- package/dist/services/argocd.js +48 -0
- package/dist/services/argocd.js.map +1 -0
- package/dist/services/az.d.ts +33 -0
- package/dist/services/az.js +48 -0
- package/dist/services/az.js.map +1 -0
- package/dist/services/azdo.d.ts +13 -0
- package/dist/services/azdo.js +57 -0
- package/dist/services/azdo.js.map +1 -0
- package/dist/services/docker.d.ts +18 -0
- package/dist/services/docker.js +36 -0
- package/dist/services/docker.js.map +1 -0
- package/dist/services/git.d.ts +9 -0
- package/dist/services/git.js +36 -0
- package/dist/services/git.js.map +1 -0
- package/dist/services/helm.d.ts +4 -0
- package/dist/services/helm.js +24 -0
- package/dist/services/helm.js.map +1 -0
- package/dist/services/index.d.ts +32 -0
- package/dist/services/index.js +81 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/kubectl.d.ts +135 -0
- package/dist/services/kubectl.js +266 -0
- package/dist/services/kubectl.js.map +1 -0
- package/dist/services/npm.d.ts +5 -0
- package/dist/services/npm.js +20 -0
- package/dist/services/npm.js.map +1 -0
- package/dist/services/oc.d.ts +146 -0
- package/dist/services/oc.js +296 -0
- package/dist/services/oc.js.map +1 -0
- package/dist/services/shell.d.ts +20 -0
- package/dist/services/shell.js +195 -0
- package/dist/services/shell.js.map +1 -0
- package/dist/services/tekton.d.ts +14 -0
- package/dist/services/tekton.js +46 -0
- package/dist/services/tekton.js.map +1 -0
- package/dist/services/terraform.d.ts +26 -0
- package/dist/services/terraform.js +63 -0
- package/dist/services/terraform.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loginServicePrincipal = loginServicePrincipal;
|
|
4
|
+
exports.setAccount = setAccount;
|
|
5
|
+
exports.acrBuild = acrBuild;
|
|
6
|
+
exports.acrLogin = acrLogin;
|
|
7
|
+
exports.webappDeploy = webappDeploy;
|
|
8
|
+
exports.aksGetCredentials = aksGetCredentials;
|
|
9
|
+
exports.deploymentGroupCreate = deploymentGroupCreate;
|
|
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);
|
|
13
|
+
}
|
|
14
|
+
function setAccount(subscription) {
|
|
15
|
+
return shell_1.shell.exec("az", "account", "set", "--subscription", subscription);
|
|
16
|
+
}
|
|
17
|
+
function acrBuild({ registry, image, file = "." }) {
|
|
18
|
+
return shell_1.shell.exec("az", "acr", "build", "--registry", registry, "--image", image, file);
|
|
19
|
+
}
|
|
20
|
+
function acrLogin(registry) {
|
|
21
|
+
return shell_1.shell.exec("az", "acr", "login", "--name", registry);
|
|
22
|
+
}
|
|
23
|
+
function webappDeploy({ name, resourceGroup, srcPath }) {
|
|
24
|
+
return shell_1.shell.exec("az", "webapp", "deploy", "--name", name, "--resource-group", resourceGroup, "--src-path", srcPath);
|
|
25
|
+
}
|
|
26
|
+
function aksGetCredentials({ name, resourceGroup, overwriteExisting = true }) {
|
|
27
|
+
const args = [
|
|
28
|
+
"aks", "get-credentials",
|
|
29
|
+
"--name", name,
|
|
30
|
+
"--resource-group", resourceGroup
|
|
31
|
+
];
|
|
32
|
+
if (overwriteExisting) {
|
|
33
|
+
args.push("--overwrite-existing");
|
|
34
|
+
}
|
|
35
|
+
return shell_1.shell.exec("az", ...args);
|
|
36
|
+
}
|
|
37
|
+
function deploymentGroupCreate({ resourceGroup, templateFile, parameters = {} }) {
|
|
38
|
+
const args = [
|
|
39
|
+
"deployment", "group", "create",
|
|
40
|
+
"--resource-group", resourceGroup,
|
|
41
|
+
"--template-file", templateFile
|
|
42
|
+
];
|
|
43
|
+
Object.entries(parameters).forEach(([k, v]) => {
|
|
44
|
+
args.push("--parameters", `${k}=${v}`);
|
|
45
|
+
});
|
|
46
|
+
return shell_1.shell.exec("az", ...args);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=az.js.map
|
|
@@ -0,0 +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,CAAC,QAAgB;IACrC,OAAO,aAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChE,CAAC;AAED,SAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAyB;IAEhF,OAAO,aAAK,CAAC,IAAI,CACb,IAAI,EAAE,QAAQ,EAAE,QAAQ,EACxB,QAAQ,EAAE,IAAI,EACd,kBAAkB,EAAE,aAAa,EACjC,YAAY,EAAE,OAAO,CACxB,CAAC;AAEN,CAAC;AAED,SAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,GAAG,IAAI,EAA2B;IAExG,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,IAAI,CAAC,CAAC;AAErC,CAAC;AAED,SAAgB,qBAAqB,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,GAAG,EAAE,EAA4B;IAE5G,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,IAAI,CAAC,CAAC;AAErC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SetVariableOptions {
|
|
2
|
+
isSecret?: boolean;
|
|
3
|
+
isOutput?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function setVariable(name: string, value: unknown, { isSecret, isOutput }?: SetVariableOptions): void;
|
|
6
|
+
export declare function logError(message: string): void;
|
|
7
|
+
export declare function logWarning(message: string): void;
|
|
8
|
+
export declare function setProgress(percent: number, currentOperation?: string): void;
|
|
9
|
+
export declare function complete(result?: "Succeeded" | "SucceededWithIssues" | "Failed", message?: string): void;
|
|
10
|
+
export declare function addBuildTag(tag: string): void;
|
|
11
|
+
export declare function uploadArtifact(name: string, path: string, containerFolder?: string): void;
|
|
12
|
+
export declare function group(name: string): void;
|
|
13
|
+
export declare function endGroup(): void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Azure Pipelines "logging commands": https://learn.microsoft.com/azure/devops/pipelines/scripts/logging-commands
|
|
3
|
+
// Estos deben imprimirse en stdout tal cual, sin el formato/color del logger interno,
|
|
4
|
+
// porque el agente de Azure DevOps los parsea línea por línea.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setVariable = setVariable;
|
|
7
|
+
exports.logError = logError;
|
|
8
|
+
exports.logWarning = logWarning;
|
|
9
|
+
exports.setProgress = setProgress;
|
|
10
|
+
exports.complete = complete;
|
|
11
|
+
exports.addBuildTag = addBuildTag;
|
|
12
|
+
exports.uploadArtifact = uploadArtifact;
|
|
13
|
+
exports.group = group;
|
|
14
|
+
exports.endGroup = endGroup;
|
|
15
|
+
function escape(value) {
|
|
16
|
+
return String(value)
|
|
17
|
+
.replace(/%/g, "%AZP25")
|
|
18
|
+
.replace(/\r/g, "%0D")
|
|
19
|
+
.replace(/\n/g, "%0A")
|
|
20
|
+
.replace(/]/g, "%5D")
|
|
21
|
+
.replace(/;/g, "%3B");
|
|
22
|
+
}
|
|
23
|
+
function print(command, properties, message = "") {
|
|
24
|
+
const props = Object.entries(properties)
|
|
25
|
+
.filter(([, v]) => v !== undefined && v !== null)
|
|
26
|
+
.map(([k, v]) => `${k}=${escape(v)}`)
|
|
27
|
+
.join(";");
|
|
28
|
+
console.log(`##vso[${command}${props ? ` ${props}` : ""}]${message}`);
|
|
29
|
+
}
|
|
30
|
+
function setVariable(name, value, { isSecret = false, isOutput = false } = {}) {
|
|
31
|
+
print("task.setvariable", { variable: name, issecret: isSecret, isoutput: isOutput }, String(value));
|
|
32
|
+
}
|
|
33
|
+
function logError(message) {
|
|
34
|
+
print("task.logissue", { type: "error" }, message);
|
|
35
|
+
}
|
|
36
|
+
function logWarning(message) {
|
|
37
|
+
print("task.logissue", { type: "warning" }, message);
|
|
38
|
+
}
|
|
39
|
+
function setProgress(percent, currentOperation = "") {
|
|
40
|
+
print("task.setprogress", { value: percent }, currentOperation);
|
|
41
|
+
}
|
|
42
|
+
function complete(result = "Succeeded", message = "") {
|
|
43
|
+
print("task.complete", { result }, message);
|
|
44
|
+
}
|
|
45
|
+
function addBuildTag(tag) {
|
|
46
|
+
print("build.addbuildtag", {}, tag);
|
|
47
|
+
}
|
|
48
|
+
function uploadArtifact(name, path, containerFolder = "") {
|
|
49
|
+
print("artifact.upload", { artifactname: name, containerfolder: containerFolder }, path);
|
|
50
|
+
}
|
|
51
|
+
function group(name) {
|
|
52
|
+
console.log(`##[group]${name}`);
|
|
53
|
+
}
|
|
54
|
+
function endGroup() {
|
|
55
|
+
console.log("##[endgroup]");
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=azdo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azdo.js","sourceRoot":"","sources":["../../src/services/azdo.ts"],"names":[],"mappings":";AAAA,kHAAkH;AAClH,sFAAsF;AACtF,+DAA+D;;AA2B/D,kCAEC;AAED,4BAEC;AAED,gCAEC;AAED,kCAEC;AAED,4BAEC;AAED,kCAEC;AAED,wCAEC;AAED,sBAEC;AAED,4BAEC;AA3DD,SAAS,MAAM,CAAC,KAAc;IAC1B,OAAO,MAAM,CAAC,KAAK,CAAC;SACf,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,KAAK,CAAC,OAAe,EAAE,UAAmC,EAAE,OAAO,GAAG,EAAE;IAE7E,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;SAChD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;SACpC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEf,OAAO,CAAC,GAAG,CAAC,SAAS,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;AAE1E,CAAC;AAOD,SAAgB,WAAW,CAAC,IAAY,EAAE,KAAc,EAAE,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,GAAG,KAAK,KAAyB,EAAE;IACrH,KAAK,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACzG,CAAC;AAED,SAAgB,QAAQ,CAAC,OAAe;IACpC,KAAK,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAe;IACtC,KAAK,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,WAAW,CAAC,OAAe,EAAE,gBAAgB,GAAG,EAAE;IAC9D,KAAK,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,gBAAgB,CAAC,CAAC;AACpE,CAAC;AAED,SAAgB,QAAQ,CAAC,SAAyD,WAAW,EAAE,OAAO,GAAG,EAAE;IACvG,KAAK,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,SAAgB,WAAW,CAAC,GAAW;IACnC,KAAK,CAAC,mBAAmB,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,cAAc,CAAC,IAAY,EAAE,IAAY,EAAE,eAAe,GAAG,EAAE;IAC3E,KAAK,CAAC,iBAAiB,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE,IAAI,CAAC,CAAC;AAC7F,CAAC;AAED,SAAgB,KAAK,CAAC,IAAY;IAC9B,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,QAAQ;IACpB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExecResult } from "../core/types";
|
|
2
|
+
export interface DockerBuildOptions {
|
|
3
|
+
image: string;
|
|
4
|
+
context?: string;
|
|
5
|
+
dockerfile?: string;
|
|
6
|
+
buildArgs?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface DockerLoginOptions {
|
|
9
|
+
registry: string;
|
|
10
|
+
username: string;
|
|
11
|
+
password: string;
|
|
12
|
+
}
|
|
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>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.build = build;
|
|
4
|
+
exports.push = push;
|
|
5
|
+
exports.tag = tag;
|
|
6
|
+
exports.login = login;
|
|
7
|
+
exports.pull = pull;
|
|
8
|
+
exports.rmi = rmi;
|
|
9
|
+
const shell_1 = require("./shell");
|
|
10
|
+
function build({ image, context = ".", dockerfile, buildArgs = {} }) {
|
|
11
|
+
const args = ["build", "-t", image];
|
|
12
|
+
if (dockerfile) {
|
|
13
|
+
args.push("-f", dockerfile);
|
|
14
|
+
}
|
|
15
|
+
Object.entries(buildArgs).forEach(([k, v]) => {
|
|
16
|
+
args.push("--build-arg", `${k}=${v}`);
|
|
17
|
+
});
|
|
18
|
+
args.push(context);
|
|
19
|
+
return shell_1.shell.exec("docker", ...args);
|
|
20
|
+
}
|
|
21
|
+
function push(image) {
|
|
22
|
+
return shell_1.shell.exec("docker", "push", image);
|
|
23
|
+
}
|
|
24
|
+
function tag(source, target) {
|
|
25
|
+
return shell_1.shell.exec("docker", "tag", source, target);
|
|
26
|
+
}
|
|
27
|
+
function login({ registry, username, password }) {
|
|
28
|
+
return shell_1.shell.exec("docker", "login", registry, "-u", username, "-p", password);
|
|
29
|
+
}
|
|
30
|
+
function pull(image) {
|
|
31
|
+
return shell_1.shell.exec("docker", "pull", image);
|
|
32
|
+
}
|
|
33
|
+
function rmi(image) {
|
|
34
|
+
return shell_1.shell.exec("docker", "rmi", image);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=docker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker.js","sourceRoot":"","sources":["../../src/services/docker.ts"],"names":[],"mappings":";;AAgBA,sBAqBC;AAED,oBAEC;AAED,kBAEC;AAED,sBAEC;AAED,oBAEC;AAED,kBAEC;AAzDD,mCAAgC;AAgBhC,SAAgB,KAAK,CAAC,EAClB,KAAK,EACL,OAAO,GAAG,GAAG,EACb,UAAU,EACV,SAAS,GAAG,EAAE,EACG;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,IAAI,CAAC,CAAC;AAEzC,CAAC;AAED,SAAgB,IAAI,CAAC,KAAa;IAC9B,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,GAAG,CAAC,MAAc,EAAE,MAAc;IAC9C,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAsB;IACtE,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,IAAI,CAAC,KAAa;IAC9B,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,GAAG,CAAC,KAAa;IAC7B,OAAO,aAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +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>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clone = clone;
|
|
4
|
+
exports.checkout = checkout;
|
|
5
|
+
exports.pull = pull;
|
|
6
|
+
exports.fetch = fetch;
|
|
7
|
+
exports.tag = tag;
|
|
8
|
+
exports.commit = commit;
|
|
9
|
+
exports.push = push;
|
|
10
|
+
exports.revParse = revParse;
|
|
11
|
+
const shell_1 = require("./shell");
|
|
12
|
+
function clone(url, targetPath) {
|
|
13
|
+
return shell_1.shell.exec("git", "clone", url, targetPath);
|
|
14
|
+
}
|
|
15
|
+
function checkout(branch) {
|
|
16
|
+
return shell_1.shell.exec("git", "checkout", branch);
|
|
17
|
+
}
|
|
18
|
+
function pull() {
|
|
19
|
+
return shell_1.shell.exec("git", "pull");
|
|
20
|
+
}
|
|
21
|
+
function fetch() {
|
|
22
|
+
return shell_1.shell.exec("git", "fetch", "--all");
|
|
23
|
+
}
|
|
24
|
+
function tag(name) {
|
|
25
|
+
return shell_1.shell.exec("git", "tag", name);
|
|
26
|
+
}
|
|
27
|
+
function commit(message) {
|
|
28
|
+
return shell_1.shell.exec("git", "commit", "-m", message);
|
|
29
|
+
}
|
|
30
|
+
function push() {
|
|
31
|
+
return shell_1.shell.exec("git", "push");
|
|
32
|
+
}
|
|
33
|
+
function revParse() {
|
|
34
|
+
return shell_1.shell.exec("git", "rev-parse", "HEAD");
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +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,mCAAgC;AAGhC,SAAgB,KAAK,CAAC,GAAW,EAAE,UAAkB;IACjD,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,QAAQ,CAAC,MAAc;IACnC,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,SAAgB,IAAI;IAChB,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,KAAK;IACjB,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,GAAG,CAAC,IAAY;IAC5B,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,MAAM,CAAC,OAAe;IAClC,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,IAAI;IAChB,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,QAAQ;IACpB,OAAO,aAAK,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +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>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.install = install;
|
|
4
|
+
exports.upgrade = upgrade;
|
|
5
|
+
exports.uninstall = uninstall;
|
|
6
|
+
const shell_1 = require("./shell");
|
|
7
|
+
function install(name, chart, values) {
|
|
8
|
+
const args = ["install", name, chart];
|
|
9
|
+
if (values) {
|
|
10
|
+
args.push("-f", values);
|
|
11
|
+
}
|
|
12
|
+
return shell_1.shell.exec("helm", ...args);
|
|
13
|
+
}
|
|
14
|
+
function upgrade(name, chart, values) {
|
|
15
|
+
const args = ["upgrade", name, chart];
|
|
16
|
+
if (values) {
|
|
17
|
+
args.push("-f", values);
|
|
18
|
+
}
|
|
19
|
+
return shell_1.shell.exec("helm", ...args);
|
|
20
|
+
}
|
|
21
|
+
function uninstall(name) {
|
|
22
|
+
return shell_1.shell.exec("helm", "uninstall", name);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=helm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.js","sourceRoot":"","sources":["../../src/services/helm.ts"],"names":[],"mappings":";;AAGA,0BAUC;AAED,0BAUC;AAED,8BAEC;AA7BD,mCAAgC;AAGhC,SAAgB,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,MAAe;IAEhE,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,IAAI,CAAC,CAAC;AAEvC,CAAC;AAED,SAAgB,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,MAAe;IAEhE,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,IAAI,CAAC,CAAC;AAEvC,CAAC;AAED,SAAgB,SAAS,CAAC,IAAY;IAClC,OAAO,aAAK,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { shell } from "./shell";
|
|
2
|
+
import * as docker from "./docker";
|
|
3
|
+
import * as git from "./git";
|
|
4
|
+
import * as kubectl from "./kubectl";
|
|
5
|
+
import * as helm from "./helm";
|
|
6
|
+
import * as npm from "./npm";
|
|
7
|
+
import * as archive from "./archive";
|
|
8
|
+
import * as terraform from "./terraform";
|
|
9
|
+
import * as ansible from "./ansible";
|
|
10
|
+
import * as argocd from "./argocd";
|
|
11
|
+
import * as tekton from "./tekton";
|
|
12
|
+
import * as oc from "./oc";
|
|
13
|
+
import * as az from "./az";
|
|
14
|
+
import * as azdo from "./azdo";
|
|
15
|
+
export declare const services: {
|
|
16
|
+
shell: import("./shell").Shell;
|
|
17
|
+
docker: typeof docker;
|
|
18
|
+
git: typeof git;
|
|
19
|
+
kubectl: typeof kubectl;
|
|
20
|
+
helm: typeof helm;
|
|
21
|
+
npm: typeof npm;
|
|
22
|
+
archive: typeof archive;
|
|
23
|
+
terraform: typeof terraform;
|
|
24
|
+
ansible: typeof ansible;
|
|
25
|
+
argocd: typeof argocd;
|
|
26
|
+
tekton: typeof tekton;
|
|
27
|
+
oc: typeof oc;
|
|
28
|
+
az: typeof az;
|
|
29
|
+
azdo: typeof azdo;
|
|
30
|
+
};
|
|
31
|
+
export type ServicesRegistry = typeof services;
|
|
32
|
+
export { shell, docker, git, kubectl, helm, npm, archive, terraform, ansible, argocd, tekton, oc, az, azdo };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.azdo = exports.az = exports.oc = exports.tekton = exports.argocd = exports.ansible = exports.terraform = exports.archive = exports.npm = exports.helm = exports.kubectl = exports.git = exports.docker = exports.shell = exports.services = void 0;
|
|
37
|
+
const shell_1 = require("./shell");
|
|
38
|
+
Object.defineProperty(exports, "shell", { enumerable: true, get: function () { return shell_1.shell; } });
|
|
39
|
+
const docker = __importStar(require("./docker"));
|
|
40
|
+
exports.docker = docker;
|
|
41
|
+
const git = __importStar(require("./git"));
|
|
42
|
+
exports.git = git;
|
|
43
|
+
const kubectl = __importStar(require("./kubectl"));
|
|
44
|
+
exports.kubectl = kubectl;
|
|
45
|
+
const helm = __importStar(require("./helm"));
|
|
46
|
+
exports.helm = helm;
|
|
47
|
+
const npm = __importStar(require("./npm"));
|
|
48
|
+
exports.npm = npm;
|
|
49
|
+
const archive = __importStar(require("./archive"));
|
|
50
|
+
exports.archive = archive;
|
|
51
|
+
const terraform = __importStar(require("./terraform"));
|
|
52
|
+
exports.terraform = terraform;
|
|
53
|
+
const ansible = __importStar(require("./ansible"));
|
|
54
|
+
exports.ansible = ansible;
|
|
55
|
+
const argocd = __importStar(require("./argocd"));
|
|
56
|
+
exports.argocd = argocd;
|
|
57
|
+
const tekton = __importStar(require("./tekton"));
|
|
58
|
+
exports.tekton = tekton;
|
|
59
|
+
const oc = __importStar(require("./oc"));
|
|
60
|
+
exports.oc = oc;
|
|
61
|
+
const az = __importStar(require("./az"));
|
|
62
|
+
exports.az = az;
|
|
63
|
+
const azdo = __importStar(require("./azdo"));
|
|
64
|
+
exports.azdo = azdo;
|
|
65
|
+
exports.services = {
|
|
66
|
+
shell: shell_1.shell,
|
|
67
|
+
docker,
|
|
68
|
+
git,
|
|
69
|
+
kubectl,
|
|
70
|
+
helm,
|
|
71
|
+
npm,
|
|
72
|
+
archive,
|
|
73
|
+
terraform,
|
|
74
|
+
ansible,
|
|
75
|
+
argocd,
|
|
76
|
+
tekton,
|
|
77
|
+
oc,
|
|
78
|
+
az,
|
|
79
|
+
azdo
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAmC5B,sFAnCK,aAAK,OAmCL;AAlCT,iDAAmC;AAmC/B,wBAAM;AAlCV,2CAA6B;AAmCzB,kBAAG;AAlCP,mDAAqC;AAmCjC,0BAAO;AAlCX,6CAA+B;AAmC3B,oBAAI;AAlCR,2CAA6B;AAmCzB,kBAAG;AAlCP,mDAAqC;AAmCjC,0BAAO;AAlCX,uDAAyC;AAmCrC,8BAAS;AAlCb,mDAAqC;AAmCjC,0BAAO;AAlCX,iDAAmC;AAmC/B,wBAAM;AAlCV,iDAAmC;AAmC/B,wBAAM;AAlCV,yCAA2B;AAmCvB,gBAAE;AAlCN,yCAA2B;AAmCvB,gBAAE;AAlCN,6CAA+B;AAmC3B,oBAAI;AAjCK,QAAA,QAAQ,GAAG;IACpB,KAAK,EAAL,aAAK;IACL,MAAM;IACN,GAAG;IACH,OAAO;IACP,IAAI;IACJ,GAAG;IACH,OAAO;IACP,SAAS;IACT,OAAO;IACP,MAAM;IACN,MAAM;IACN,EAAE;IACF,EAAE;IACF,IAAI;CACP,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { ExecResult } from "../core/types";
|
|
2
|
+
export interface KubectlOptions {
|
|
3
|
+
/** Ruta al archivo kubeconfig. Se pasa como --kubeconfig <path>. */
|
|
4
|
+
kubeconfig?: string;
|
|
5
|
+
/** Namespace destino. Se pasa como -n <namespace>. */
|
|
6
|
+
namespace?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function apply(file: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
9
|
+
export declare function del(file: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Igual que antes (`kubectl.get("pods", "-o", "wide")`), pero ahora también
|
|
12
|
+
* acepta KubectlOptions como último argumento:
|
|
13
|
+
* kubectl.get("pods", "-o", "wide", { namespace: "prod" })
|
|
14
|
+
*/
|
|
15
|
+
export declare function get(...rawArgs: Array<string | KubectlOptions>): Promise<ExecResult>;
|
|
16
|
+
export declare function logs(pod: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
17
|
+
export declare function rolloutStatus(deployment: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
18
|
+
export declare function setImage(resource: string, image: string, options?: KubectlOptions): Promise<ExecResult>;
|
|
19
|
+
export { del as delete };
|
|
20
|
+
export type DeploymentRolloutStatus = "success" | "failed" | "timeout";
|
|
21
|
+
export interface DeploymentWatchResult {
|
|
22
|
+
status: DeploymentRolloutStatus;
|
|
23
|
+
deployment: string;
|
|
24
|
+
elapsedMs: number;
|
|
25
|
+
restarts: number;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Se lanza cuando `waitForDeployment` no llega a un rollout exitoso, ya sea
|
|
30
|
+
* por timeout global, por quedarse en estado Failed sin recuperarse, o por
|
|
31
|
+
* superar el máximo de reinicios permitido. Lleva `command: "kubectl"` para
|
|
32
|
+
* que `classifiers.byCommand({ kubectl: "kubernetes" })` lo clasifique
|
|
33
|
+
* automáticamente si usas el sistema de notificaciones.
|
|
34
|
+
*/
|
|
35
|
+
export declare class DeploymentRolloutError extends Error {
|
|
36
|
+
readonly command = "kubectl";
|
|
37
|
+
readonly status: DeploymentRolloutStatus;
|
|
38
|
+
readonly deployment: string;
|
|
39
|
+
readonly elapsedMs: number;
|
|
40
|
+
readonly restarts: number;
|
|
41
|
+
constructor(message: string, info: Omit<DeploymentWatchResult, "message">);
|
|
42
|
+
}
|
|
43
|
+
export interface WaitForDeploymentOptions extends KubectlOptions {
|
|
44
|
+
/** Nombre del deployment, sin el prefijo "deployment/". */
|
|
45
|
+
deployment: string;
|
|
46
|
+
/** Milisegundos totales antes de abortar y reportar error. Default: 300000 (5 min). */
|
|
47
|
+
timeout?: number;
|
|
48
|
+
/** Milisegundos entre cada chequeo. Default: 5000. */
|
|
49
|
+
pollInterval?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Si el deployment entra en estado Failed, milisegundos a esperar para
|
|
52
|
+
* ver si se recupera solo antes de darlo por fallido. Default: igual a
|
|
53
|
+
* `pollInterval` * 6 (30s con los defaults).
|
|
54
|
+
*/
|
|
55
|
+
failedGracePeriod?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Máximo de reinicios (sumados entre todos los pods/containers del
|
|
58
|
+
* deployment) tolerados antes de abortar inmediatamente, sin esperar
|
|
59
|
+
* el `failedGracePeriod` ni el `timeout`. Si no se pasa, no se valida.
|
|
60
|
+
*/
|
|
61
|
+
maxRestarts?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Valida cíclicamente el estado de un Deployment hasta que:
|
|
65
|
+
* - llega a estado exitoso (replicas listas/actualizadas == replicas deseadas) -> resuelve,
|
|
66
|
+
* - supera `maxRestarts` reinicios acumulados -> lanza DeploymentRolloutError,
|
|
67
|
+
* - se queda en estado Failed más de `failedGracePeriod` sin recuperarse -> lanza DeploymentRolloutError,
|
|
68
|
+
* - o se cumple `timeout` sin éxito -> lanza DeploymentRolloutError.
|
|
69
|
+
*
|
|
70
|
+
* En cualquier caso de error, el polling se detiene ("se mata el proceso")
|
|
71
|
+
* y el error se re-lanza, listo para que `ctx.run(...)` lo capture y lo
|
|
72
|
+
* reporte vía `ctx.notifier` si lo tienes configurado.
|
|
73
|
+
*/
|
|
74
|
+
export declare function waitForDeployment(options: WaitForDeploymentOptions): Promise<DeploymentWatchResult>;
|
|
75
|
+
export type DeploymentGroupStatus = "success" | "failed" | "timeout";
|
|
76
|
+
export interface DeploymentGroupFailure {
|
|
77
|
+
deployment: string;
|
|
78
|
+
status: DeploymentRolloutStatus;
|
|
79
|
+
message: string;
|
|
80
|
+
}
|
|
81
|
+
export interface DeploymentGroupWatchResult {
|
|
82
|
+
status: "success";
|
|
83
|
+
label: string;
|
|
84
|
+
elapsedMs: number;
|
|
85
|
+
deployments: DeploymentWatchResult[];
|
|
86
|
+
message: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Se lanza cuando `waitForDeploymentGroup` no logra que TODAS las instancias
|
|
90
|
+
* del grupo lleguen a estado exitoso. Lleva `command: "kubectl"` para que
|
|
91
|
+
* `classifiers.byCommand({ kubectl: "kubernetes" })` lo clasifique solo.
|
|
92
|
+
*/
|
|
93
|
+
export declare class DeploymentGroupRolloutError extends Error {
|
|
94
|
+
readonly command = "kubectl";
|
|
95
|
+
readonly label: string;
|
|
96
|
+
readonly elapsedMs: number;
|
|
97
|
+
readonly succeeded: string[];
|
|
98
|
+
readonly failed: DeploymentGroupFailure[];
|
|
99
|
+
constructor(message: string, info: {
|
|
100
|
+
label: string;
|
|
101
|
+
elapsedMs: number;
|
|
102
|
+
succeeded: string[];
|
|
103
|
+
failed: DeploymentGroupFailure[];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export interface WaitForDeploymentGroupOptions extends KubectlOptions {
|
|
107
|
+
/**
|
|
108
|
+
* Label que agrupa todas las instancias del despliegue. Puede ser el
|
|
109
|
+
* selector ya armado ("deployment-group=repository-14") o un objeto
|
|
110
|
+
* ({ "deployment-group": "repository-14" }).
|
|
111
|
+
*/
|
|
112
|
+
label: string | Record<string, string>;
|
|
113
|
+
/** Milisegundos totales antes de abortar el grupo entero. Default: 300000 (5 min). */
|
|
114
|
+
timeout?: number;
|
|
115
|
+
/** Milisegundos entre cada chequeo, por instancia. Default: 5000. */
|
|
116
|
+
pollInterval?: number;
|
|
117
|
+
/** Igual que en waitForDeployment, aplicado a cada instancia del grupo. */
|
|
118
|
+
failedGracePeriod?: number;
|
|
119
|
+
/** Igual que en waitForDeployment, aplicado a cada instancia del grupo. */
|
|
120
|
+
maxRestarts?: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Descubre todos los Deployments que compartan el `label` dado (p. ej.
|
|
124
|
+
* todas las instancias GitOps de un mismo repo, marcadas con
|
|
125
|
+
* `deployment-group: repository-14`) y espera a que TODAS lleguen a estado
|
|
126
|
+
* exitoso, corriendo `waitForDeployment` por cada una en paralelo con el
|
|
127
|
+
* mismo `timeout` global.
|
|
128
|
+
*
|
|
129
|
+
* Si alguna instancia falla (timeout individual, Failed sin recuperarse, o
|
|
130
|
+
* maxRestarts superado), se espera a que terminen las demás y se lanza
|
|
131
|
+
* `DeploymentGroupRolloutError` con el detalle de cuáles fallaron y cuáles sí
|
|
132
|
+
* llegaron a estado exitoso — listo para que `ctx.run(...)` lo capture y lo
|
|
133
|
+
* reporte vía `ctx.notifier`.
|
|
134
|
+
*/
|
|
135
|
+
export declare function waitForDeploymentGroup(options: WaitForDeploymentGroupOptions): Promise<DeploymentGroupWatchResult>;
|