@catladder/cli 1.40.4 → 1.41.0
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/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 +574 -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/gitlab.d.ts +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 +3 -2
- 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/utils/gitlab.ts +1 -1
- package/src/utils/projects/index.ts +1 -25
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>;
|
|
@@ -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;AAC5B,kEAA8E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/projects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,kEAA8E;AAE9E,kCAA2C;AAC3C,+DAA6C;AAEtC,IAAM,UAAU,GAAG;;;oBAChB,qBAAM,IAAA,4BAAI,EAAC,+BAA+B,CAAC,EAAA;oBAAnD,sBAAO,CAAC,SAA2C,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAC;;;KACpE,CAAC;AAFW,QAAA,UAAU,cAErB;AAEK,IAAM,mBAAmB,GAAG;;;;oBACjB,qBAAM,IAAA,kBAAU,GAAE,EAAA;;gBAA5B,OAAO,GAAG,SAAkB;gBAClC,sBAAO,IAAA,WAAI,EAAC,OAAO,EAAE,gBAAgB,CAAC,EAAC;;;KACxC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B;AAEK,IAAM,oBAAoB,GAAG;;;YAClC,KAAA,uBAAe,CAAA;YAAC,qBAAM,IAAA,2BAAmB,GAAE,EAAA;gBAA3C,sBAAA,kBAAgB,SAA2B,EAAC,EAAA;;SAAA,CAAC;AADlC,QAAA,oBAAoB,wBACc;AAExC,IAAM,eAAe,GAAG;;;;oBACP,qBAAM,IAAA,4BAAoB,GAAE,EAAA;;gBAA5C,KAAgB,SAA4B,EAA3C,KAAK,QAAA,EAAE,IAAI,QAAA;gBAClB,IAAI,KAAK,EAAE;oBACT,sBAAO,KAAK,EAAC;iBACd;gBACD,sBAAO,IAAI,EAAC;;;KACb,CAAC;AANW,QAAA,eAAe,mBAM1B;AAEK,IAAM,mBAAmB,GAAG,UAAO,YAAoB;;;;;gBACpD,GAAG,GAAK,IAAA,8BAAW,EAAC,YAAY,CAAC,IAA9B,CAA+B;gBAC3B,qBAAM,IAAA,mCAAgB,GAAE,EAAA;;gBAAjC,MAAM,GAAG,SAAwB;gBACvC,sBAAO,UAAG,MAAM,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.0",
|
|
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": "^6.0.2",
|
|
59
|
+
"vorpal": "^1.12.0"
|
|
57
60
|
},
|
|
58
|
-
"version": "1.
|
|
61
|
+
"version": "1.41.0"
|
|
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,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Context} from "@catladder/pipeline";
|
|
1
3
|
import {
|
|
2
|
-
Context,
|
|
3
4
|
getFullKubernetesClusterName,
|
|
4
5
|
isOfDeployType,
|
|
5
6
|
} from "@catladder/pipeline";
|
|
6
|
-
import { CommandInstance } from "vorpal";
|
|
7
|
+
import type { CommandInstance } from "vorpal";
|
|
7
8
|
import { exec } from "child-process-promise";
|
|
8
9
|
import { connectToCluster } from "../../../../../utils/cluster";
|
|
9
10
|
import { upsertAllVariables } from "../../../../../utils/gitlab";
|
|
@@ -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) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "child-process-promise";
|
|
2
2
|
import fetch from "node-fetch";
|
|
3
|
-
import Vorpal from "vorpal";
|
|
3
|
+
import type Vorpal from "vorpal";
|
|
4
4
|
|
|
5
5
|
export default async (vorpal: Vorpal) => {
|
|
6
6
|
vorpal.command("dadjoke", "something for jonas.").action(async function () {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Config } from "@catladder/pipeline";
|
|
1
|
+
import type { Config } from "@catladder/pipeline";
|
|
2
2
|
import { spawn, exec } from "child-process-promise";
|
|
3
3
|
import { writeFile } from "fs-extra";
|
|
4
4
|
import { dump } from "js-yaml";
|
|
5
5
|
import { format } from "prettier";
|
|
6
|
-
import { CommandInstance } from "vorpal";
|
|
6
|
+
import type { CommandInstance } from "vorpal";
|
|
7
7
|
import { getGitRoot } from "../../../utils/projects";
|
|
8
8
|
|
|
9
9
|
export const writeConfig = async (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
BuildConfig,
|
|
3
3
|
ComponentConfig,
|
|
4
4
|
Config,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "fs-extra";
|
|
15
15
|
import { isEmpty } from "lodash";
|
|
16
16
|
import { join } from "path";
|
|
17
|
-
import Vorpal from "vorpal";
|
|
17
|
+
import type Vorpal from "vorpal";
|
|
18
18
|
import {
|
|
19
19
|
getGitlabCi,
|
|
20
20
|
getGitlabCiFilePath,
|
|
@@ -24,11 +24,8 @@ import { syncBitwarden } from "../../../../utils/passwordstore";
|
|
|
24
24
|
import { getGitRoot } from "../../../../utils/projects";
|
|
25
25
|
import { writeConfig } from "../../config/writeConfig";
|
|
26
26
|
import { migrateSecrets } from "./migrateSecrets";
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
isOldInclude,
|
|
30
|
-
OldGitlabCiFile,
|
|
31
|
-
} from "./oldGitlabCi";
|
|
27
|
+
import type { OldGitlabCiFile } from "./oldGitlabCi";
|
|
28
|
+
import { detectBuildConfig, isOldInclude } from "./oldGitlabCi";
|
|
32
29
|
export const LEGACY_ENVS = [
|
|
33
30
|
"dev-local",
|
|
34
31
|
"dev",
|