@catladder/cli 1.40.4 → 1.41.2
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/bin/catenv +1 -1
- package/bin/catenv-dev +3 -0
- package/bin/catladder +1 -1
- package/bin/catladder-dev +3 -0
- package/dist/apps/cli/commands/general/index.d.ts +1 -1
- package/dist/apps/cli/commands/general/portForward.d.ts +1 -1
- package/dist/apps/cli/commands/mongodb/index.d.ts +1 -1
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +1 -1
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +2 -1
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -1
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +1 -1
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +1 -1
- package/dist/apps/cli/commands/mongodb/utils/index.js +2 -1
- package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -1
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +2 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/apps/cli/commands/project/commandCopyDB.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandDeletePods.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandDeletePods.js +2 -1
- package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -1
- package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandEnvVars.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandGetShell.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandGetShell.js +2 -1
- package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -1
- package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -1
- package/dist/apps/cli/commands/project/commandInitProject.old.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandListPods.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandListPods.js +2 -2
- package/dist/apps/cli/commands/project/commandListPods.js.map +1 -1
- package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandNamespace.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenGit.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +2 -1
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -1
- package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandPauseProject.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandPortForward.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandPortForward.js +2 -1
- package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -1
- package/dist/apps/cli/commands/project/commandSetup.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -1
- package/dist/apps/cli/commands/project/index.d.ts +1 -1
- package/dist/apps/cli/commands/project/setup/index.d.ts +1 -1
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.d.ts +1 -1
- package/dist/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
- package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -1
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
- package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +1 -1
- package/dist/apps/cli/commands/shared/index.d.ts +1 -1
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +1 -1
- package/dist/apps/cli/config/writeConfig.d.ts +2 -2
- package/dist/apps/cli/verify/index.d.ts +1 -1
- package/dist/apps/cli/verify/migration/fromv2.d.ts +1 -1
- package/dist/apps/cli/verify/migration/fromv2.js.map +1 -1
- package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +3 -3
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -1
- package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +1 -1
- package/dist/bundles/catenv/index.js +15 -0
- package/dist/bundles/catenv/xdg-open +1066 -0
- package/dist/bundles/cli/check.js +28 -0
- package/dist/bundles/cli/clipboard_i686.exe +0 -0
- package/dist/bundles/cli/clipboard_x86_64.exe +0 -0
- package/dist/bundles/cli/exec-child.js +39 -0
- package/dist/bundles/cli/index.js +536 -0
- package/dist/bundles/cli/xdg-open +1066 -0
- package/dist/bundles/cli/xsel +0 -0
- package/dist/catenv.js +2 -3
- package/dist/catenv.js.map +1 -1
- package/dist/config/getProjectConfig.d.ts +3 -6
- package/dist/config/getProjectConfig.js +10 -6
- package/dist/config/getProjectConfig.js.map +1 -1
- package/dist/config/parseChoice.d.ts +4 -0
- package/dist/config/parseChoice.js +9 -0
- package/dist/config/parseChoice.js.map +1 -0
- package/dist/kubernetes/index.d.ts +3 -0
- package/dist/kubernetes/index.js +88 -0
- package/dist/kubernetes/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cluster.d.ts +2 -2
- package/dist/utils/gitlab.d.ts +1 -1
- package/dist/utils/passwordstore/index.js.map +1 -1
- package/dist/utils/projects/index.d.ts +0 -3
- package/dist/utils/projects/index.js +1 -47
- package/dist/utils/projects/index.js.map +1 -1
- package/package.json +25 -22
- package/scripts/bundle +4 -0
- package/src/apps/catenv/catenv.ts +1 -1
- package/src/apps/cli/commands/general/index.ts +1 -1
- package/src/apps/cli/commands/general/portForward.ts +1 -1
- package/src/apps/cli/commands/mongodb/index.ts +1 -1
- package/src/apps/cli/commands/mongodb/projectMongoDestroyMember.ts +3 -5
- package/src/apps/cli/commands/mongodb/projectMongoGetShell.ts +1 -1
- package/src/apps/cli/commands/mongodb/projectMongoPortForward.ts +1 -1
- package/src/apps/cli/commands/mongodb/utils/index.ts +2 -4
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +1 -1
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +2 -1
- package/src/apps/cli/commands/project/commandCopyDB.ts +1 -1
- package/src/apps/cli/commands/project/commandDeletePods.ts +3 -5
- package/src/apps/cli/commands/project/commandDeleteProject.ts +1 -1
- package/src/apps/cli/commands/project/commandEnvVars.ts +1 -1
- package/src/apps/cli/commands/project/commandGetMyTotalWorktime.ts +1 -1
- package/src/apps/cli/commands/project/commandGetShell.ts +3 -5
- package/src/apps/cli/commands/project/commandGitlabCi.ts +2 -1
- package/src/apps/cli/commands/project/commandInitProject.old.ts +1 -1
- package/src/apps/cli/commands/project/commandListPods.ts +2 -2
- package/src/apps/cli/commands/project/commandMigrateHelm3.ts +1 -1
- package/src/apps/cli/commands/project/commandNamespace.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenCostDashboard.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenDashboard.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenEnv.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenGit.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenGrafana.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenGrafanaPod.ts +3 -5
- package/src/apps/cli/commands/project/commandOpenLogs.ts +1 -1
- package/src/apps/cli/commands/project/commandPauseProject.ts +1 -1
- package/src/apps/cli/commands/project/commandPortForward.ts +3 -5
- package/src/apps/cli/commands/project/commandSetup.ts +1 -1
- package/src/apps/cli/commands/project/commandTriggerCronjob.ts +3 -2
- package/src/apps/cli/commands/project/index.ts +1 -1
- package/src/apps/cli/commands/project/setup/index.ts +1 -1
- package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +1 -1
- package/src/apps/cli/commands/project/setup/setupContext.ts +3 -2
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +6 -6
- package/src/apps/cli/commands/project/utils/ensureNamespace.ts +4 -2
- package/src/apps/cli/commands/project/utils/showProjectBanner.ts +1 -1
- package/src/apps/cli/commands/shared/index.ts +1 -1
- package/src/apps/cli/commands/theStuffThatReallyMatters/index.ts +1 -1
- package/src/apps/cli/config/writeConfig.ts +2 -2
- package/src/apps/cli/verify/index.ts +1 -1
- package/src/apps/cli/verify/migration/fromv2.ts +4 -7
- package/src/apps/cli/verify/migration/migrateSecrets.ts +4 -3
- package/src/apps/cli/verify/migration/oldGitlabCi.ts +1 -1
- package/src/catenv.ts +1 -3
- package/src/config/getProjectConfig.ts +6 -8
- package/src/config/parseChoice.ts +4 -0
- package/src/kubernetes/index.ts +27 -0
- package/src/types/child-process-promise.d.ts +36 -1
- package/src/utils/gitlab.ts +1 -1
- package/src/utils/passwordstore/index.ts +2 -2
- package/src/utils/projects/index.ts +1 -25
package/dist/utils/cluster.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const getCurrentContext: () => Promise<
|
|
2
|
-
export declare const getCurrentConnectedClusterName: () => Promise<
|
|
1
|
+
export declare const getCurrentContext: () => Promise<string>;
|
|
2
|
+
export declare const getCurrentConnectedClusterName: () => Promise<string>;
|
|
3
3
|
export declare const connectToCluster: (fullname: string) => Promise<void>;
|
package/dist/utils/gitlab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizee from "memoizee";
|
|
2
|
-
import { CommandInstance } from "vorpal";
|
|
2
|
+
import type { CommandInstance } from "vorpal";
|
|
3
3
|
export declare const hasGitlabToken: () => Promise<boolean>;
|
|
4
4
|
export declare const setupGitlabToken: (vorpal: CommandInstance) => Promise<void>;
|
|
5
5
|
export declare const getGitlabToken: (vorpal: CommandInstance) => Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/passwordstore/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAoD;AACpD,kFAAmD;AACnD,gDAA0B;AAC1B,8CAA6E;AAE7E,IAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,IAAM,eAAe,GAAG;;;;;gBACtB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAClB,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;gBACvD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACZ,OAAO,GAAG,IAAA,6BAAK,EAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;oBAC/C,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC;iBACtC,CAAC,CAAC;gBACC,OAAO,GAAG,IAAI,CAAC;gBACnB,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAC5B,MAAM,EACN,UAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/passwordstore/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAoD;AACpD,kFAAmD;AACnD,gDAA0B;AAC1B,8CAA6E;AAE7E,IAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,IAAM,eAAe,GAAG;;;;;gBACtB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAClB,OAAO,CAAC,KAAK,CAAC,uCAAuC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,IAAI,EAAE,CAAC;oBACP,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;oBACvB,IAAI,EAAE,IAAI;oBAEV,KAAK,EAAE,OAAO;;gBACE,qBAAM,wBAAwB,EAAE,EAAA;;gBAN5C,KAAK,IAMT,gBAAa,IAAG,SAAgC,CAAC;uBAClD;gBACc,qBAAM,oBAAoB,CAAC,sBAAe,MAAM,CAAC,KAAK,CAAC,CAAE,CAAC,EAAA;;gBAAnE,MAAM,GAAG,SAA0D;gBACzE,qBAAM,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAAtB,SAAsB,CAAC;;;;KACxB,CAAC;AAXW,QAAA,UAAU,cAWrB;AAEF,IAAM,KAAK,GAAG,UAAO,MAAc;;;;;gBACjC,KAAA,oBAAoB,CAAA;2CACT,MAAM;gBAAI,qBAAM,uBAAuB,EAAE,EAAA;;yCAA/B,SAA+B;gBAAI,KAAA,MAAM,CAAA;gBAC1D,qBAAM,wBAAwB,EAAE,EAAA;oBAFpC,sBAAA,kBACE,cAAsD;gCACpD,SAAgC;+BAChC,EAAE,EACL,EAAA;;;KAAA,CAAC;AAEG,IAAM,SAAS,GAAG,UAAO,IAAY;;;;oBAC7B,qBAAM,OAAO,CAAC,IAAI,CAAC,EAAA;;gBAA1B,IAAI,GAAG,SAAmB;gBAEjB,qBAAM,oBAAoB,CAAC,sBAAe,IAAI,CAAC,EAAE,CAAE,CAAC,EAAA;;gBAA7D,MAAM,GAAG,SAAoD;gBAEnE,sBAAO,MAAM,EAAC;;;KACf,CAAC;AANW,QAAA,SAAS,aAMpB"}
|
|
@@ -3,6 +3,3 @@ export declare const getRootGitlabCiFile: () => Promise<string>;
|
|
|
3
3
|
export declare const readRootGitlabCiFile: () => Promise<any[]>;
|
|
4
4
|
export declare const hasGitlabCiFile: () => Promise<boolean>;
|
|
5
5
|
export declare const getProjectNamespace: (envComponent: string) => Promise<string>;
|
|
6
|
-
export declare const getProjectPods: (envComponent: string) => Promise<import("@kubernetes/client-node").V1Pod[]>;
|
|
7
|
-
export declare const getProjectPvcs: (envComponent: string) => Promise<import("@kubernetes/client-node").V1PersistentVolumeClaim[]>;
|
|
8
|
-
export declare const getProjectPodNames: (envComponent: string) => Promise<string[]>;
|
|
@@ -36,10 +36,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
|
-
exports.
|
|
39
|
+
exports.getProjectNamespace = exports.hasGitlabCiFile = exports.readRootGitlabCiFile = exports.getRootGitlabCiFile = exports.getGitRoot = void 0;
|
|
40
40
|
var path_1 = require("path");
|
|
41
41
|
var getProjectConfig_1 = require("../../config/getProjectConfig");
|
|
42
|
-
var k8sApi_1 = require("../../k8sApi");
|
|
43
42
|
var files_1 = require("../files");
|
|
44
43
|
var child_process_promise_1 = require("child-process-promise");
|
|
45
44
|
var getGitRoot = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -101,49 +100,4 @@ var getProjectNamespace = function (envComponent) { return __awaiter(void 0, voi
|
|
|
101
100
|
});
|
|
102
101
|
}); };
|
|
103
102
|
exports.getProjectNamespace = getProjectNamespace;
|
|
104
|
-
var getProjectPods = function (envComponent) { return __awaiter(void 0, void 0, void 0, function () {
|
|
105
|
-
var namespace, k8sApi, res, componentName;
|
|
106
|
-
return __generator(this, function (_a) {
|
|
107
|
-
switch (_a.label) {
|
|
108
|
-
case 0: return [4 /*yield*/, (0, exports.getProjectNamespace)(envComponent)];
|
|
109
|
-
case 1:
|
|
110
|
-
namespace = _a.sent();
|
|
111
|
-
k8sApi = (0, k8sApi_1.getk8sApi)();
|
|
112
|
-
return [4 /*yield*/, k8sApi.listNamespacedPod(namespace)];
|
|
113
|
-
case 2:
|
|
114
|
-
res = _a.sent();
|
|
115
|
-
componentName = (0, getProjectConfig_1.parseChoice)(envComponent).componentName;
|
|
116
|
-
return [2 /*return*/, res.body.items.filter(function (item) { var _a, _b; return componentName ? (_b = (_a = item.metadata) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.includes(componentName + "-") : true; })];
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}); };
|
|
120
|
-
exports.getProjectPods = getProjectPods;
|
|
121
|
-
var getProjectPvcs = function (envComponent) { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
|
-
var namespace, k8sApi, res;
|
|
123
|
-
return __generator(this, function (_a) {
|
|
124
|
-
switch (_a.label) {
|
|
125
|
-
case 0: return [4 /*yield*/, (0, exports.getProjectNamespace)(envComponent)];
|
|
126
|
-
case 1:
|
|
127
|
-
namespace = _a.sent();
|
|
128
|
-
k8sApi = (0, k8sApi_1.getk8sApi)();
|
|
129
|
-
return [4 /*yield*/, k8sApi.listNamespacedPersistentVolumeClaim(namespace)];
|
|
130
|
-
case 2:
|
|
131
|
-
res = _a.sent();
|
|
132
|
-
return [2 /*return*/, res.body.items];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}); };
|
|
136
|
-
exports.getProjectPvcs = getProjectPvcs;
|
|
137
|
-
var getProjectPodNames = function (envComponent) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
|
-
var pods;
|
|
139
|
-
return __generator(this, function (_a) {
|
|
140
|
-
switch (_a.label) {
|
|
141
|
-
case 0: return [4 /*yield*/, (0, exports.getProjectPods)(envComponent)];
|
|
142
|
-
case 1:
|
|
143
|
-
pods = _a.sent();
|
|
144
|
-
return [2 /*return*/, pods.map(function (n) { return n.metadata.name; })];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}); };
|
|
148
|
-
exports.getProjectPodNames = getProjectPodNames;
|
|
149
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/projects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;A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CAAC,YAAY,cAAI,MAAM,CAAC,OAAO,cAAI,GAAG,CAAE,EAAC;;;KAC1D,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"lint": "eslint \"src/**/*.ts\"",
|
|
9
9
|
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
10
10
|
"test": "yarn run lint",
|
|
11
|
-
"build": "yarn
|
|
11
|
+
"build": "yarn build:compile && yarn build:bundle",
|
|
12
|
+
"build:bundle": "./scripts/bundle",
|
|
13
|
+
"build:compile": "yarn tsc",
|
|
12
14
|
"build:watch": "yarn tsc -w"
|
|
13
15
|
},
|
|
14
16
|
"bin": {
|
|
@@ -16,34 +18,19 @@
|
|
|
16
18
|
"catladder": "./bin/catladder"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"@kubernetes/client-node": "^0.16.2",
|
|
21
|
-
"child-process-promise": "^2.2.1",
|
|
22
|
-
"clipboardy": "^2.0.0",
|
|
23
|
-
"command-exists-promise": "^2.0.2",
|
|
24
|
-
"common-tags": "^1.8.0",
|
|
25
|
-
"dayjs": "^1.10.4",
|
|
26
|
-
"fs-extra": "^7.0.1",
|
|
27
|
-
"gitlab": "^4.4.1",
|
|
28
|
-
"js-yaml": "^4.1.0",
|
|
29
|
-
"lodash": "^4.17.21",
|
|
30
|
-
"memoizee": "^0.4.14",
|
|
31
|
-
"node-fetch": "^2.3.0",
|
|
32
|
-
"open": "^8.4.0",
|
|
33
|
-
"prettier": "^2.5.1",
|
|
34
|
-
"tmp-promise": "^2.0.2",
|
|
35
|
-
"update-notifier": "^2.5.0",
|
|
36
|
-
"vorpal": "^1.12.0"
|
|
21
|
+
"ts-node": "^10.9.1"
|
|
37
22
|
},
|
|
38
23
|
"engines": {
|
|
39
24
|
"node": ">=12.0.0"
|
|
40
25
|
},
|
|
41
26
|
"devDependencies": {
|
|
27
|
+
"@catladder/pipeline": "1.41.2",
|
|
28
|
+
"@kubernetes/client-node": "^0.16.2",
|
|
42
29
|
"@tsconfig/node14": "^1.0.1",
|
|
43
30
|
"@types/common-tags": "^1.8.0",
|
|
44
31
|
"@types/fs-extra": "^5.0.4",
|
|
45
32
|
"@types/js-yaml": "^4.0.5",
|
|
46
|
-
"@types/lodash": "^4.14.
|
|
33
|
+
"@types/lodash": "^4.14.185",
|
|
47
34
|
"@types/memoizee": "^0.4.2",
|
|
48
35
|
"@types/node-fetch": "^2.1.4",
|
|
49
36
|
"@types/request": "^2.48.1",
|
|
@@ -52,8 +39,24 @@
|
|
|
52
39
|
"@types/vorpal": "^1.12.0",
|
|
53
40
|
"@types/websocket": "^0.0.40",
|
|
54
41
|
"@types/yargs": "^13.0.0",
|
|
42
|
+
"child-process-promise": "^2.2.1",
|
|
43
|
+
"clipboardy": "^2.0.0",
|
|
44
|
+
"command-exists-promise": "^2.0.2",
|
|
45
|
+
"common-tags": "^1.8.0",
|
|
46
|
+
"dayjs": "^1.10.4",
|
|
55
47
|
"eslint": "^8.7.0",
|
|
56
|
-
"
|
|
48
|
+
"fs-extra": "^7.0.1",
|
|
49
|
+
"gitlab": "^4.4.1",
|
|
50
|
+
"js-yaml": "^4.1.0",
|
|
51
|
+
"lodash": "^4.17.21",
|
|
52
|
+
"memoizee": "^0.4.14",
|
|
53
|
+
"node-fetch": "^2.3.0",
|
|
54
|
+
"open": "^8.4.0",
|
|
55
|
+
"prettier": "^2.5.1",
|
|
56
|
+
"tmp-promise": "^2.0.2",
|
|
57
|
+
"typescript": "^4.5.4",
|
|
58
|
+
"update-notifier": "^5",
|
|
59
|
+
"vorpal": "^1.12.0"
|
|
57
60
|
},
|
|
58
|
-
"version": "1.
|
|
61
|
+
"version": "1.41.2"
|
|
59
62
|
}
|
package/scripts/bundle
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config, ComponentConfig } from "@catladder/pipeline";
|
|
1
|
+
import type { Config, ComponentConfig } from "@catladder/pipeline";
|
|
2
2
|
import { getEnvVars, getProjectConfig } from "../../config/getProjectConfig";
|
|
3
3
|
import { getGitRoot } from "../../utils/projects";
|
|
4
4
|
import { join } from "path";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { exec } from "child-process-promise";
|
|
2
|
-
import Vorpal from "vorpal";
|
|
2
|
+
import type Vorpal from "vorpal";
|
|
3
|
+
import { getProjectPvcs } from "../../../../kubernetes";
|
|
3
4
|
import { logError } from "../../../../utils/log";
|
|
4
|
-
import {
|
|
5
|
-
getProjectNamespace,
|
|
6
|
-
getProjectPvcs,
|
|
7
|
-
} from "../../../../utils/projects";
|
|
5
|
+
import { getProjectNamespace } from "../../../../utils/projects";
|
|
8
6
|
import { envAndComponents } from "../project/utils/autocompletions";
|
|
9
7
|
import ensureCluster from "../project/utils/ensureCluster";
|
|
10
8
|
import { getMongoDbPodsWithReplInfo } from "./utils";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { exec, spawn } from "child-process-promise";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
getProjectPodNames,
|
|
5
|
-
} from "../../../../../utils/projects";
|
|
2
|
+
import { getProjectPodNames } from "../../../../../kubernetes";
|
|
3
|
+
import { getProjectNamespace } from "../../../../../utils/projects";
|
|
6
4
|
|
|
7
5
|
const filterMongoDbs = (podNames: string[]) =>
|
|
8
6
|
podNames.filter(
|
|
@@ -2,7 +2,7 @@ import { isOfDeployType } from "@catladder/pipeline";
|
|
|
2
2
|
import { spawn } from "child-process-promise";
|
|
3
3
|
import { writeFile } from "fs-extra";
|
|
4
4
|
import { withFile } from "tmp-promise";
|
|
5
|
-
import Vorpal from "vorpal";
|
|
5
|
+
import type Vorpal from "vorpal";
|
|
6
6
|
import {
|
|
7
7
|
getEnvVars,
|
|
8
8
|
getGitlabVar,
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { getSecretVarName } from "@catladder/pipeline";
|
|
3
3
|
import { stripIndents } from "common-tags";
|
|
4
4
|
import { difference } from "lodash";
|
|
5
|
-
import
|
|
5
|
+
import type { CommandInstance } from "vorpal";
|
|
6
|
+
import type Vorpal from "vorpal";
|
|
6
7
|
import {
|
|
7
8
|
getAllComponentsWithAllEnvsHierarchical,
|
|
8
9
|
getEnvironment,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
2
|
import { getk8sApi } from "../../../../k8sApi";
|
|
3
|
+
import { getProjectPodNames } from "../../../../kubernetes";
|
|
3
4
|
|
|
4
5
|
import { logError } from "../../../../utils/log";
|
|
5
|
-
import {
|
|
6
|
-
getProjectNamespace,
|
|
7
|
-
getProjectPodNames,
|
|
8
|
-
} from "../../../../utils/projects";
|
|
6
|
+
import { getProjectNamespace } from "../../../../utils/projects";
|
|
9
7
|
import { envAndComponents } from "./utils/autocompletions";
|
|
10
8
|
import ensureCluster from "./utils/ensureCluster";
|
|
11
9
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
|
+
import { getProjectPodNames } from "../../../../kubernetes";
|
|
2
3
|
import { logError } from "../../../../utils/log";
|
|
3
|
-
import {
|
|
4
|
-
getProjectNamespace,
|
|
5
|
-
getProjectPodNames,
|
|
6
|
-
} from "../../../../utils/projects";
|
|
4
|
+
import { getProjectNamespace } from "../../../../utils/projects";
|
|
7
5
|
import { getShell } from "../../../../utils/shell";
|
|
8
6
|
|
|
9
7
|
import { envAndComponents } from "./utils/autocompletions";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { exec } from "child-process-promise";
|
|
2
2
|
import { last } from "lodash";
|
|
3
3
|
import open from "open";
|
|
4
|
-
import
|
|
4
|
+
import type { CommandInstance } from "vorpal";
|
|
5
|
+
import type Vorpal from "vorpal";
|
|
5
6
|
import {
|
|
6
7
|
doGitlabRequest,
|
|
7
8
|
getGitlabToken,
|
|
@@ -2,7 +2,7 @@ import { readFile, writeFile } from "fs-extra";
|
|
|
2
2
|
import { dump } from "js-yaml";
|
|
3
3
|
import { mapKeys, snakeCase, toUpper } from "lodash";
|
|
4
4
|
import path from "path";
|
|
5
|
-
import Vorpal from "vorpal";
|
|
5
|
+
import type Vorpal from "vorpal";
|
|
6
6
|
import { hasGitlabCiFile } from "../../../../utils/projects";
|
|
7
7
|
|
|
8
8
|
const transformVar = (key: string) => toUpper(snakeCase(key));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dump } from "js-yaml";
|
|
2
2
|
import { pick } from "lodash";
|
|
3
|
-
import Vorpal from "vorpal";
|
|
4
|
-
import { getProjectPods } from "../../../../
|
|
3
|
+
import type Vorpal from "vorpal";
|
|
4
|
+
import { getProjectPods } from "../../../../kubernetes";
|
|
5
5
|
import { envAndComponents } from "./utils/autocompletions";
|
|
6
6
|
import ensureCluster from "./utils/ensureCluster";
|
|
7
7
|
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import open from "open";
|
|
2
|
-
import Vorpal from "vorpal";
|
|
2
|
+
import type Vorpal from "vorpal";
|
|
3
3
|
import {
|
|
4
4
|
GRAFANA_PROXY_LOCAL_PORT,
|
|
5
5
|
GRAFANA_PROXY_TARGET_PORT,
|
|
6
6
|
} from "../../../../config/constants";
|
|
7
|
+
import { getProjectPodNames } from "../../../../kubernetes";
|
|
7
8
|
import { logError } from "../../../../utils/log";
|
|
8
9
|
import { startPortForward } from "../../../../utils/portForward";
|
|
9
|
-
import {
|
|
10
|
-
getProjectNamespace,
|
|
11
|
-
getProjectPodNames,
|
|
12
|
-
} from "../../../../utils/projects";
|
|
10
|
+
import { getProjectNamespace } from "../../../../utils/projects";
|
|
13
11
|
import { envAndComponents } from "./utils/autocompletions";
|
|
14
12
|
import ensureCluster from "./utils/ensureCluster";
|
|
15
13
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
|
+
import { getProjectPodNames } from "../../../../kubernetes";
|
|
2
3
|
import { logError } from "../../../../utils/log";
|
|
3
4
|
import { startPortForward } from "../../../../utils/portForward";
|
|
4
|
-
import {
|
|
5
|
-
getProjectNamespace,
|
|
6
|
-
getProjectPodNames,
|
|
7
|
-
} from "../../../../utils/projects";
|
|
5
|
+
import { getProjectNamespace } from "../../../../utils/projects";
|
|
8
6
|
import { envAndComponents } from "./utils/autocompletions";
|
|
9
7
|
import ensureCluster from "./utils/ensureCluster";
|
|
10
8
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { V1ObjectMeta } from "@kubernetes/client-node";
|
|
2
|
+
import { V1Job } from "@kubernetes/client-node";
|
|
2
3
|
|
|
3
|
-
import Vorpal from "vorpal";
|
|
4
|
+
import type Vorpal from "vorpal";
|
|
4
5
|
import { getk8sApiBatch, getk8sApiBatchBeta } from "../../../../k8sApi";
|
|
5
6
|
import { logError } from "../../../../utils/log";
|
|
6
7
|
import { namespaceAutoCompletion } from "../general/namespaceAutoCompletion";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandInstance } from "vorpal";
|
|
1
|
+
import type { CommandInstance } from "vorpal";
|
|
2
2
|
import { getAllPipelineContexts } from "../../../../../config/getProjectConfig";
|
|
3
3
|
import { projectConfigSecrets } from "../commandConfigSecrets";
|
|
4
4
|
import { setupAccessTokens } from "./setupAccessTokens";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import open from "open";
|
|
2
|
-
import { CommandInstance } from "vorpal";
|
|
2
|
+
import type { CommandInstance } from "vorpal";
|
|
3
3
|
import { doGitlabRequest, getProjectInfo } from "../../../../../utils/gitlab";
|
|
4
4
|
|
|
5
5
|
export const setupAccessTokens = async (instance: CommandInstance) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Context
|
|
2
|
-
import {
|
|
1
|
+
import type { Context} from "@catladder/pipeline";
|
|
2
|
+
import { isOfDeployType } from "@catladder/pipeline";
|
|
3
|
+
import type { CommandInstance } from "vorpal";
|
|
3
4
|
import { setupKubernetes } from "./setupKubernetes";
|
|
4
5
|
|
|
5
6
|
export const setupContext = async (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { Context } from "@catladder/pipeline";
|
|
1
2
|
import {
|
|
2
|
-
Context,
|
|
3
3
|
getFullKubernetesClusterName,
|
|
4
4
|
isOfDeployType,
|
|
5
5
|
} from "@catladder/pipeline";
|
|
6
|
-
import { CommandInstance } from "vorpal";
|
|
6
|
+
import type { CommandInstance } from "vorpal";
|
|
7
7
|
import { exec } from "child-process-promise";
|
|
8
8
|
import { connectToCluster } from "../../../../../utils/cluster";
|
|
9
9
|
import { upsertAllVariables } from "../../../../../utils/gitlab";
|
|
@@ -35,7 +35,7 @@ export const setupKubernetes = async (
|
|
|
35
35
|
const serviceAccountName = `cl-${context.componentName}-deploy`;
|
|
36
36
|
const KUBE_URL = await exec(
|
|
37
37
|
`TERM=dumb kubectl cluster-info | grep -E 'Kubernetes master|Kubernetes control plane' | awk '/http/ {print $NF}'`
|
|
38
|
-
).then((s
|
|
38
|
+
).then((s) => s.stdout.trim());
|
|
39
39
|
|
|
40
40
|
// first upsert service acount in the ns
|
|
41
41
|
try {
|
|
@@ -88,14 +88,14 @@ EOF
|
|
|
88
88
|
// get token name
|
|
89
89
|
const tokenName = await exec(
|
|
90
90
|
`kubectl get serviceaccount --namespace ${namespace} ${serviceAccountName} -o jsonpath='{.secrets[0].name}'`
|
|
91
|
-
).then((c
|
|
91
|
+
).then((c) => c.stdout.trim());
|
|
92
92
|
|
|
93
93
|
const KUBE_CA_PEM = await exec(
|
|
94
94
|
`kubectl get secret ${tokenName} --namespace ${namespace} -o jsonpath="{['data']['ca\\.crt']}"`
|
|
95
|
-
).then((c
|
|
95
|
+
).then((c) => c.stdout.trim());
|
|
96
96
|
const KUBE_TOKEN = await exec(
|
|
97
97
|
`kubectl get secret ${tokenName} --namespace ${namespace} -o jsonpath="{['data']['token']}" | base64 --decode`
|
|
98
|
-
).then((c
|
|
98
|
+
).then((c) => c.stdout.trim());
|
|
99
99
|
|
|
100
100
|
const vars = {
|
|
101
101
|
KUBE_TOKEN,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Context
|
|
2
|
-
import {
|
|
1
|
+
import type { Context} from "@catladder/pipeline";
|
|
2
|
+
import { getKubernetesNamespace } from "@catladder/pipeline";
|
|
3
|
+
import type { V1ObjectMeta } from "@kubernetes/client-node";
|
|
4
|
+
import { V1Namespace } from "@kubernetes/client-node";
|
|
3
5
|
import { getk8sApi } from "../../../../../k8sApi";
|
|
4
6
|
|
|
5
7
|
export default async function (context: Context) {
|