@catladder/cli 0.0.0-node16-ddfae617 → 0.0.0-pipeline-variables-ed2d2565
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/catenv/catenv.d.ts +2 -1
- package/dist/apps/catenv/catenv.js +13 -82
- package/dist/apps/catenv/catenv.js.map +1 -1
- package/dist/apps/catenv/printVariables.d.ts +3 -0
- package/dist/apps/catenv/printVariables.js +112 -0
- package/dist/apps/catenv/printVariables.js.map +1 -0
- package/dist/apps/catenv/types.d.ts +5 -0
- package/dist/apps/catenv/types.js +3 -0
- package/dist/apps/catenv/types.js.map +1 -0
- package/dist/apps/catenv/utils.d.ts +12 -0
- package/dist/apps/catenv/utils.js +108 -0
- package/dist/apps/catenv/utils.js.map +1 -0
- package/dist/apps/catenv/writeDotEnvFiles.d.ts +3 -0
- package/dist/apps/catenv/writeDotEnvFiles.js +94 -0
- package/dist/apps/catenv/writeDotEnvFiles.js.map +1 -0
- package/dist/apps/catenv/writeEnvDTs.d.ts +3 -0
- package/dist/apps/catenv/writeEnvDTs.js +114 -0
- package/dist/apps/catenv/writeEnvDTs.js.map +1 -0
- package/dist/apps/cli/cli.js +4 -2
- package/dist/apps/cli/cli.js.map +1 -1
- package/dist/apps/cli/commands/{project/commandCopyDB.d.ts → cloudSQL/commandRestoreDb.d.ts} +1 -1
- package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js +180 -0
- package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +1 -0
- package/dist/apps/cli/commands/cloudSQL/index.d.ts +3 -0
- package/dist/apps/cli/commands/cloudSQL/index.js +50 -0
- package/dist/apps/cli/commands/cloudSQL/index.js.map +1 -0
- package/dist/apps/cli/commands/general/index.d.ts +1 -1
- package/dist/apps/cli/commands/general/index.js +11 -11
- package/dist/apps/cli/commands/general/index.js.map +1 -1
- package/dist/apps/cli/commands/general/portForward.d.ts +1 -1
- package/dist/apps/cli/commands/general/portForward.js +3 -3
- package/dist/apps/cli/commands/general/portForward.js.map +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/projectMongoPortForward.js +27 -11
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -1
- package/dist/apps/cli/commands/mongodb/utils/index.js +16 -4
- 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/commandCloudSqlProxy.js +89 -62
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +2 -1
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +71 -57
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +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/commandEnvVars.js +1 -1
- package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -1
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +1 -1
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -1
- package/dist/apps/cli/commands/project/commandGetShell.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandGetShell.js +10 -6
- 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/commandMigrateHelm3.js +1 -2
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +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/commandOpenCostDashboard.js +2 -2
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -1
- package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenDashboard.js +19 -20
- package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +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/commandOpenGit.js +2 -7
- package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafana.js +2 -2
- package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +1 -1
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +4 -3
- 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/commandOpenLogs.js +7 -20
- package/dist/apps/cli/commands/project/commandOpenLogs.js.map +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 +98 -36
- package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -1
- package/dist/apps/cli/commands/project/commandSecretsClearBackups.d.ts +5 -0
- package/dist/apps/cli/commands/project/commandSecretsClearBackups.js +90 -0
- package/dist/apps/cli/commands/project/commandSecretsClearBackups.js.map +1 -0
- 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/index.js +2 -2
- package/dist/apps/cli/commands/project/index.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/index.d.ts +1 -1
- package/dist/apps/cli/commands/project/setup/index.js +11 -7
- package/dist/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.d.ts +1 -1
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.js +5 -4
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupCloudRun.d.ts +3 -0
- package/dist/apps/cli/commands/project/setup/setupCloudRun.js +118 -0
- package/dist/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -0
- package/dist/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
- package/dist/apps/cli/commands/project/setup/setupContext.js +10 -3
- 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 +25 -18
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupTopic.d.ts +2 -0
- package/dist/apps/cli/commands/project/setup/setupTopic.js +69 -0
- package/dist/apps/cli/commands/project/setup/setupTopic.js.map +1 -0
- 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/theStuffThatReallyMatters/index.d.ts +1 -1
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +1 -1
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +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 +2 -0
- 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 +6 -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/apps/cli/verify/migration/oldGitlabCi.js +1 -1
- package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -1
- package/dist/bundles/catenv/index.js +45988 -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 +359559 -0
- package/dist/bundles/cli/xdg-open +1066 -0
- package/dist/bundles/cli/xsel +0 -0
- package/dist/catenv.js +3 -3
- package/dist/catenv.js.map +1 -1
- package/dist/cli.js +0 -7
- package/dist/cli.js.map +1 -1
- package/dist/config/constants.d.ts +0 -1
- package/dist/config/constants.js +1 -2
- package/dist/config/constants.js.map +1 -1
- package/dist/config/getProjectConfig.d.ts +10 -10
- package/dist/config/getProjectConfig.js +77 -23
- 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/gcloud/artifactsRegistry.d.ts +5 -0
- package/dist/gcloud/artifactsRegistry.js +59 -0
- package/dist/gcloud/artifactsRegistry.js.map +1 -0
- package/dist/gcloud/cloudRun/getCloudRunDomainSuffix.d.ts +2 -0
- package/dist/gcloud/cloudRun/getCloudRunDomainSuffix.js +67 -0
- package/dist/gcloud/cloudRun/getCloudRunDomainSuffix.js.map +1 -0
- package/dist/gcloud/cloudRun/openCloudRunDashboards.d.ts +3 -0
- package/dist/gcloud/cloudRun/openCloudRunDashboards.js +62 -0
- package/dist/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -0
- package/dist/gcloud/cloudSql/startProxy.d.ts +10 -0
- package/dist/gcloud/cloudSql/startProxy.js +121 -0
- package/dist/gcloud/cloudSql/startProxy.js.map +1 -0
- package/dist/gcloud/enableServices.d.ts +3 -0
- package/dist/gcloud/enableServices.js +63 -0
- package/dist/gcloud/enableServices.js.map +1 -0
- package/dist/gcloud/openDashboard.d.ts +2 -0
- package/dist/{apps/cli/commands/shared/index.js → gcloud/openDashboard.js} +23 -27
- package/dist/gcloud/openDashboard.js.map +1 -0
- package/dist/gcloud/serviceAccounts.d.ts +12 -0
- package/dist/gcloud/serviceAccounts.js +144 -0
- package/dist/gcloud/serviceAccounts.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/kubernetes/openKubernetesDashboards.d.ts +4 -0
- package/dist/kubernetes/openKubernetesDashboards.js +94 -0
- package/dist/kubernetes/openKubernetesDashboards.js.map +1 -0
- package/dist/kubernetes/portForward.d.ts +1 -0
- package/dist/kubernetes/portForward.js +55 -0
- package/dist/kubernetes/portForward.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cluster.js +3 -8
- package/dist/utils/cluster.js.map +1 -1
- package/dist/utils/gitlab.d.ts +8 -6
- package/dist/utils/gitlab.js +165 -46
- package/dist/utils/gitlab.js.map +1 -1
- package/dist/utils/passwordstore/index.d.ts +0 -1
- package/dist/utils/passwordstore/index.js +1 -64
- package/dist/utils/passwordstore/index.js.map +1 -1
- package/dist/utils/portForwards.d.ts +12 -0
- package/dist/utils/{portForward.js → portForwards.js} +20 -16
- package/dist/utils/portForwards.js.map +1 -0
- package/dist/utils/projects/index.d.ts +0 -3
- package/dist/utils/projects/index.js +3 -53
- package/dist/utils/projects/index.js.map +1 -1
- package/package.json +24 -22
- package/scripts/bundle +4 -0
- package/src/apps/catenv/catenv.ts +10 -54
- package/src/apps/catenv/printVariables.ts +53 -0
- package/src/apps/catenv/types.ts +6 -0
- package/src/apps/catenv/utils.ts +49 -0
- package/src/apps/catenv/writeDotEnvFiles.ts +46 -0
- package/src/apps/catenv/writeEnvDTs.ts +71 -0
- package/src/apps/cli/cli.ts +3 -1
- package/src/apps/cli/commands/cloudSQL/commandRestoreDb.ts +154 -0
- package/src/apps/cli/commands/cloudSQL/index.ts +8 -0
- package/src/apps/cli/commands/general/index.ts +11 -8
- package/src/apps/cli/commands/general/portForward.ts +4 -4
- 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 +21 -3
- package/src/apps/cli/commands/mongodb/utils/index.ts +19 -11
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +106 -55
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +49 -35
- 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 +6 -3
- package/src/apps/cli/commands/project/commandGetMyTotalWorktime.ts +2 -2
- package/src/apps/cli/commands/project/commandGetShell.ts +10 -9
- 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 +4 -3
- package/src/apps/cli/commands/project/commandNamespace.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenCostDashboard.ts +3 -3
- package/src/apps/cli/commands/project/commandOpenDashboard.ts +12 -32
- package/src/apps/cli/commands/project/commandOpenEnv.ts +1 -1
- package/src/apps/cli/commands/project/commandOpenGit.ts +3 -3
- package/src/apps/cli/commands/project/commandOpenGrafana.ts +3 -3
- package/src/apps/cli/commands/project/commandOpenGrafanaPod.ts +5 -7
- package/src/apps/cli/commands/project/commandOpenLogs.ts +4 -35
- package/src/apps/cli/commands/project/commandPauseProject.ts +1 -1
- package/src/apps/cli/commands/project/commandPortForward.ts +75 -34
- package/src/apps/cli/commands/project/commandSecretsClearBackups.ts +27 -0
- 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 +4 -3
- package/src/apps/cli/commands/project/setup/index.ts +3 -1
- package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +23 -11
- package/src/apps/cli/commands/project/setup/setupCloudRun.ts +84 -0
- package/src/apps/cli/commands/project/setup/setupContext.ts +9 -2
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +56 -28
- package/src/apps/cli/commands/project/setup/setupTopic.ts +22 -0
- 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/theStuffThatReallyMatters/index.ts +2 -2
- 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 +5 -7
- package/src/apps/cli/verify/migration/migrateSecrets.ts +15 -5
- package/src/apps/cli/verify/migration/oldGitlabCi.ts +2 -2
- package/src/catenv.ts +6 -3
- package/src/cli.ts +1 -7
- package/src/config/constants.ts +0 -2
- package/src/config/getProjectConfig.ts +70 -30
- package/src/config/parseChoice.ts +4 -0
- package/src/gcloud/artifactsRegistry.ts +16 -0
- package/src/gcloud/cloudRun/getCloudRunDomainSuffix.ts +35 -0
- package/src/gcloud/cloudRun/openCloudRunDashboards.ts +22 -0
- package/src/gcloud/cloudSql/startProxy.ts +74 -0
- package/src/gcloud/enableServices.ts +14 -0
- package/src/gcloud/openDashboard.ts +19 -0
- package/src/gcloud/serviceAccounts.ts +101 -0
- package/src/kubernetes/index.ts +27 -0
- package/src/kubernetes/openKubernetesDashboards.ts +52 -0
- package/src/kubernetes/portForward.ts +15 -0
- package/src/types/child-process-promise.d.ts +37 -1
- package/src/utils/cluster.ts +3 -3
- package/src/utils/gitlab.ts +141 -30
- package/src/utils/passwordstore/index.ts +2 -30
- package/src/utils/{portForward.ts → portForwards.ts} +27 -22
- package/src/utils/projects/index.ts +3 -24
- package/tsconfig.json +1 -1
- package/dist/apps/cli/commands/project/commandCopyDB.js +0 -102
- package/dist/apps/cli/commands/project/commandCopyDB.js.map +0 -1
- package/dist/apps/cli/commands/shared/index.d.ts +0 -3
- package/dist/apps/cli/commands/shared/index.js.map +0 -1
- package/dist/utils/portForward.d.ts +0 -4
- package/dist/utils/portForward.js.map +0 -1
- package/src/apps/cli/commands/project/commandCopyDB.ts +0 -91
- package/src/apps/cli/commands/shared/index.ts +0 -36
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizee from "memoizee";
|
|
2
|
-
import Vorpal from "vorpal";
|
|
2
|
+
import type Vorpal from "vorpal";
|
|
3
3
|
import { getk8sApi } from "../../../../k8sApi";
|
|
4
4
|
import { getCurrentContext } from "../../../../utils/cluster";
|
|
5
5
|
import { logError } from "../../../../utils/log";
|
|
@@ -7,7 +7,7 @@ import { syncBitwarden } from "../../../../utils/passwordstore";
|
|
|
7
7
|
import {
|
|
8
8
|
getAllRunningPortForwards,
|
|
9
9
|
stopPortForward,
|
|
10
|
-
} from "../../../../utils/
|
|
10
|
+
} from "../../../../utils/portForwards";
|
|
11
11
|
import { getShell } from "../../../../utils/shell";
|
|
12
12
|
import { namespaceAutoCompletion } from "./namespaceAutoCompletion";
|
|
13
13
|
import portForward from "./portForward";
|
|
@@ -26,19 +26,19 @@ export const getAllNamespacesNames = async () => {
|
|
|
26
26
|
return namespaces.map((n) => n.metadata.name);
|
|
27
27
|
};
|
|
28
28
|
export default async (vorpal: Vorpal) => {
|
|
29
|
-
vorpal.command("current-context").action(async function () {
|
|
29
|
+
vorpal.command("kube-current-context").action(async function () {
|
|
30
30
|
this.log(await getCurrentContext());
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
vorpal
|
|
34
|
-
.command("list-namespaces", "list all namespaces")
|
|
34
|
+
.command("kube-list-namespaces", "list all namespaces")
|
|
35
35
|
.action(async function () {
|
|
36
36
|
const namespaces = await getAllNamespacesNames();
|
|
37
37
|
this.log(namespaces.join("\n"));
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
vorpal
|
|
41
|
-
.command("list-secrets <namespace>", "show secrets")
|
|
41
|
+
.command("kube-list-secrets <namespace>", "show secrets")
|
|
42
42
|
.autocomplete(namespaceAutoCompletion)
|
|
43
43
|
.action(async function ({ namespace }) {
|
|
44
44
|
const k8sApi = getk8sApi();
|
|
@@ -53,7 +53,7 @@ export default async (vorpal: Vorpal) => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
vorpal
|
|
56
|
-
.command("list-pods <namespace>", "list all pods of namespace")
|
|
56
|
+
.command("kube-list-pods <namespace>", "list all pods of namespace")
|
|
57
57
|
.autocomplete(namespaceAutoCompletion)
|
|
58
58
|
.action(async function ({ namespace }) {
|
|
59
59
|
const k8sApi = getk8sApi();
|
|
@@ -62,14 +62,17 @@ export default async (vorpal: Vorpal) => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
vorpal
|
|
65
|
-
.command("stop-portforward <name>", "stop a running port forward")
|
|
65
|
+
.command("kube-stop-portforward <name>", "stop a running port forward")
|
|
66
66
|
.autocomplete({ data: async () => getAllRunningPortForwards() })
|
|
67
67
|
.action(async function ({ name }) {
|
|
68
68
|
stopPortForward(name.trim());
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
vorpal
|
|
72
|
-
.command(
|
|
72
|
+
.command(
|
|
73
|
+
"kube-get-shell <namespace>",
|
|
74
|
+
"get a shell to a pod in the environment"
|
|
75
|
+
)
|
|
73
76
|
.autocomplete(namespaceAutoCompletion)
|
|
74
77
|
.action(async function ({ namespace }) {
|
|
75
78
|
const k8sApi = getk8sApi();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
2
|
import { logError } from "../../../../utils/log";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { startKubePortForward } from "../../../../kubernetes/portForward";
|
|
5
5
|
|
|
6
6
|
import { getk8sApi } from "../../../../k8sApi";
|
|
7
7
|
import { namespaceAutoCompletion } from "./namespaceAutoCompletion";
|
|
8
8
|
|
|
9
9
|
export default async (vorpal: Vorpal) =>
|
|
10
10
|
vorpal
|
|
11
|
-
.command("port-forward <namespace>", "start port-forwarding")
|
|
11
|
+
.command("kube-port-forward <namespace>", "start port-forwarding")
|
|
12
12
|
.autocomplete(namespaceAutoCompletion)
|
|
13
13
|
.action(async function ({ namespace }) {
|
|
14
14
|
const k8sApi = getk8sApi();
|
|
@@ -44,5 +44,5 @@ export default async (vorpal: Vorpal) =>
|
|
|
44
44
|
message: "Remote port: ",
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
return
|
|
47
|
+
return startKubePortForward(podName, localPort, remotePort, namespace);
|
|
48
48
|
});
|
|
@@ -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,10 +1,15 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
|
+
import {
|
|
3
|
+
getEnvVarsResolved,
|
|
4
|
+
parseChoice,
|
|
5
|
+
} from "../../../../config/getProjectConfig";
|
|
2
6
|
import { logError } from "../../../../utils/log";
|
|
3
|
-
import {
|
|
7
|
+
import { startKubePortForward } from "../../../../kubernetes/portForward";
|
|
4
8
|
import { getProjectNamespace } from "../../../../utils/projects";
|
|
5
9
|
import { envAndComponents } from "../project/utils/autocompletions";
|
|
6
10
|
import ensureCluster from "../project/utils/ensureCluster";
|
|
7
11
|
import { getProjectMongodbAllPodsSortedWithLabel } from "./utils";
|
|
12
|
+
import clipboard from "clipboardy";
|
|
8
13
|
|
|
9
14
|
export default async (vorpal: Vorpal) =>
|
|
10
15
|
vorpal
|
|
@@ -43,5 +48,18 @@ export default async (vorpal: Vorpal) =>
|
|
|
43
48
|
default: "30000",
|
|
44
49
|
message: "Local port: ",
|
|
45
50
|
});
|
|
46
|
-
|
|
51
|
+
const { env, componentName } = parseChoice(envComponent);
|
|
52
|
+
const envVars = await getEnvVarsResolved(this, env, componentName);
|
|
53
|
+
const MONGODB_ROOT_PASSWORD = envVars?.MONGODB_ROOT_PASSWORD;
|
|
54
|
+
const connectionUrl = `mongodb://root:${MONGODB_ROOT_PASSWORD}@localhost:${localPort}`;
|
|
55
|
+
clipboard.writeSync(connectionUrl);
|
|
56
|
+
this.log("");
|
|
57
|
+
this.log("username: root");
|
|
58
|
+
this.log(`password: ${MONGODB_ROOT_PASSWORD}`);
|
|
59
|
+
this.log(`connection string: ${connectionUrl}`);
|
|
60
|
+
this.log("");
|
|
61
|
+
this.log("👆 connection string has been copied to your clipboard!");
|
|
62
|
+
this.log("");
|
|
63
|
+
|
|
64
|
+
return startKubePortForward(podName, localPort, 27017, namespace);
|
|
47
65
|
});
|
|
@@ -1,11 +1,14 @@
|
|
|
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
|
-
podNames.filter(
|
|
6
|
+
podNames.filter(
|
|
7
|
+
(name) =>
|
|
8
|
+
name.includes("mongodb") &&
|
|
9
|
+
!name.includes("mongodb-backup") &&
|
|
10
|
+
!name.includes("arbiter")
|
|
11
|
+
);
|
|
9
12
|
|
|
10
13
|
export const getProjectMongodbAllPods = async (envComponent: string) =>
|
|
11
14
|
filterMongoDbs(await getProjectPodNames(envComponent));
|
|
@@ -43,13 +46,18 @@ export const executeMongodbCommand = async (
|
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
export const podIsMaster = async (namespace: string, podName: string) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
try {
|
|
50
|
+
const result = await executeMongodbCommand(
|
|
51
|
+
namespace,
|
|
52
|
+
podName,
|
|
53
|
+
"db.isMaster()"
|
|
54
|
+
);
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
return result.ismaster;
|
|
57
|
+
} catch (e) {
|
|
58
|
+
// maybe shutting down ?
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
53
61
|
};
|
|
54
62
|
|
|
55
63
|
const spaces = (n: number) => " ".repeat(n);
|
|
@@ -1,27 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { spawn } from "child-process-promise";
|
|
3
|
-
import { writeFile } from "fs-extra";
|
|
4
|
-
import { withFile } from "tmp-promise";
|
|
5
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type { Context } from "@catladder/pipeline";
|
|
6
2
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
createKubernetesCloudsqlBaseValues,
|
|
4
|
+
isOfDeployType,
|
|
5
|
+
} from "@catladder/pipeline";
|
|
6
|
+
import type Vorpal from "vorpal";
|
|
7
|
+
import type { CommandInstance } from "vorpal";
|
|
8
|
+
import {
|
|
9
|
+
getEnvVarsResolved,
|
|
9
10
|
getPipelineContextByChoice,
|
|
10
|
-
getProjectConfig,
|
|
11
11
|
parseChoice,
|
|
12
12
|
} from "../../../../config/getProjectConfig";
|
|
13
13
|
import { envAndComponents } from "./utils/autocompletions";
|
|
14
|
+
import { startCloudSqlProxyInCurrentShell } from "../../../../gcloud/cloudSql/startProxy";
|
|
14
15
|
|
|
16
|
+
type ProxyInfo = {
|
|
17
|
+
instanceName: string;
|
|
18
|
+
DB_NAME: string;
|
|
19
|
+
DB_PASSWORD: string;
|
|
20
|
+
DB_USER: string;
|
|
21
|
+
};
|
|
15
22
|
export default async (vorpal: Vorpal) =>
|
|
16
23
|
vorpal
|
|
17
24
|
.command("project-cloud-sql-proxy <envComponent>", "proxy to cloud sql db")
|
|
18
25
|
.autocomplete(await envAndComponents())
|
|
19
26
|
.action(async function ({ envComponent }) {
|
|
20
27
|
const { env, componentName } = parseChoice(envComponent);
|
|
28
|
+
if (!componentName) {
|
|
29
|
+
this.log("need componentName");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
21
32
|
|
|
22
|
-
const
|
|
23
|
-
|
|
33
|
+
const context = await getPipelineContextByChoice(env, componentName);
|
|
34
|
+
let proxyInfo: ProxyInfo;
|
|
35
|
+
|
|
36
|
+
if (env === "review") {
|
|
37
|
+
vorpal.log(
|
|
38
|
+
"⚠️ connection string does not include mr information on review environments"
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
if (isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
|
|
42
|
+
proxyInfo = await getProxyInfoForKubernetes(this, context);
|
|
43
|
+
} else if (
|
|
44
|
+
isOfDeployType(context.componentConfig.deploy, "google-cloudrun")
|
|
45
|
+
) {
|
|
46
|
+
proxyInfo = await getProxyInfoForCloudRun(this, context);
|
|
47
|
+
} else {
|
|
48
|
+
throw new Error("unsupported environment");
|
|
49
|
+
}
|
|
24
50
|
|
|
51
|
+
// skynet-164509:europe-west6:pvl-cyclomania-review=tcp:5432
|
|
52
|
+
const { DB_PASSWORD, DB_NAME, DB_USER, instanceName } = proxyInfo;
|
|
25
53
|
const { localPort } = await this.prompt({
|
|
26
54
|
type: "number",
|
|
27
55
|
name: "localPort",
|
|
@@ -29,60 +57,83 @@ export default async (vorpal: Vorpal) =>
|
|
|
29
57
|
message: "Local port: ",
|
|
30
58
|
});
|
|
31
59
|
|
|
32
|
-
const envVars = await getEnvVars(this, env, componentName);
|
|
33
|
-
const POSTGRESQL_PASSWORD = envVars?.POSTGRESQL_PASSWORD;
|
|
34
|
-
|
|
35
|
-
const context = await getPipelineContextByChoice(env, componentName);
|
|
36
|
-
if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
|
|
37
|
-
throw new Error("currently only supported for kubernetes deployment");
|
|
38
|
-
}
|
|
39
60
|
this.log("");
|
|
40
|
-
this.log(`postgres-PW: ${
|
|
61
|
+
this.log(`postgres-PW: ${DB_PASSWORD}`);
|
|
62
|
+
this.log("");
|
|
63
|
+
this.log("connection strings:");
|
|
41
64
|
this.log("");
|
|
42
65
|
this.log(
|
|
43
|
-
`
|
|
66
|
+
`DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@localhost:${localPort}/${DB_NAME}?schema=public`
|
|
67
|
+
);
|
|
68
|
+
this.log("");
|
|
69
|
+
this.log(
|
|
70
|
+
`DATABASE_JDBC_URL=jdbc:postgresql://localhost:${localPort}/${DB_NAME}?schema=public&user=${DB_USER}&password=${DB_PASSWORD}`
|
|
44
71
|
);
|
|
45
72
|
this.log("");
|
|
46
73
|
|
|
47
|
-
|
|
74
|
+
await startCloudSqlProxyInCurrentShell({
|
|
75
|
+
instanceName,
|
|
76
|
+
localPort,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
48
79
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
80
|
+
const getProxyInfoForKubernetes = async (
|
|
81
|
+
vorpal: CommandInstance,
|
|
82
|
+
context: Context
|
|
83
|
+
): Promise<ProxyInfo> => {
|
|
84
|
+
if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
|
|
85
|
+
throw new Error("unsupported");
|
|
86
|
+
}
|
|
52
87
|
|
|
53
|
-
|
|
54
|
-
|
|
88
|
+
const envVars = await getEnvVarsResolved(
|
|
89
|
+
vorpal,
|
|
90
|
+
context.environment.shortName,
|
|
91
|
+
context.componentName
|
|
92
|
+
);
|
|
93
|
+
// bit hacky, would be nicer if we would also declare this through env vars
|
|
94
|
+
const cloudSqlValues = createKubernetesCloudsqlBaseValues(context);
|
|
55
95
|
|
|
56
|
-
|
|
57
|
-
const region = values?.cloudsql?.region || defaultRegion;
|
|
96
|
+
const DB_PASSWORD = envVars?.DB_PASSWORD || envVars?.POSTGRESQL_PASSWORD;
|
|
58
97
|
|
|
59
|
-
|
|
98
|
+
const DB_NAME = cloudSqlValues.cloudsql.fullDbName;
|
|
60
99
|
|
|
61
|
-
|
|
62
|
-
this,
|
|
63
|
-
env,
|
|
64
|
-
componentName,
|
|
65
|
-
"cloudsqlProxyCredentials"
|
|
66
|
-
);
|
|
100
|
+
const instanceName = cloudSqlValues.cloudsql.instanceConnectionName;
|
|
67
101
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
return {
|
|
103
|
+
instanceName,
|
|
104
|
+
DB_PASSWORD,
|
|
105
|
+
DB_NAME,
|
|
106
|
+
DB_USER: "postgres",
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const getProxyInfoForCloudRun = async (
|
|
111
|
+
vorpal: CommandInstance,
|
|
112
|
+
context: Context
|
|
113
|
+
): Promise<ProxyInfo> => {
|
|
114
|
+
if (
|
|
115
|
+
!isOfDeployType(context.componentConfig.deploy, "google-cloudrun") ||
|
|
116
|
+
!context.componentConfig.deploy.cloudSql
|
|
117
|
+
) {
|
|
118
|
+
throw new Error("unsupported");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const envVars = await getEnvVarsResolved(
|
|
122
|
+
vorpal,
|
|
123
|
+
context.environment.shortName,
|
|
124
|
+
context.componentName
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const DB_PASSWORD = envVars?.DB_PASSWORD;
|
|
128
|
+
const DB_USER = envVars?.DB_USER;
|
|
129
|
+
|
|
130
|
+
const DB_NAME = context.environment.envVars.DB_NAME;
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
instanceName:
|
|
134
|
+
context.componentConfig.deploy.cloudSql.instanceConnectionName,
|
|
135
|
+
DB_PASSWORD,
|
|
136
|
+
DB_NAME,
|
|
137
|
+
DB_USER,
|
|
138
|
+
};
|
|
139
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* eslint-disable no-constant-condition */
|
|
2
|
+
import { getSecretVarName } from "@catladder/pipeline";
|
|
2
3
|
import { stripIndents } from "common-tags";
|
|
3
4
|
import { difference } from "lodash";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
5
|
+
import type { CommandInstance } from "vorpal";
|
|
6
|
+
import type Vorpal from "vorpal";
|
|
6
7
|
import {
|
|
7
8
|
getAllComponentsWithAllEnvsHierarchical,
|
|
8
9
|
getEnvironment,
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
getEnvVarsResolved,
|
|
11
|
+
getJobOnlyEnvVarsResolved,
|
|
11
12
|
getProjectComponents,
|
|
12
13
|
parseChoice,
|
|
13
14
|
} from "../../../../config/getProjectConfig";
|
|
14
15
|
import { editAsFile } from "../../../../utils/editAsFile";
|
|
15
16
|
import { upsertAllVariables } from "../../../../utils/gitlab";
|
|
16
|
-
import { hasBitwarden, readPass } from "../../../../utils/passwordstore";
|
|
17
17
|
import { delay } from "../../../../utils/promise";
|
|
18
18
|
import { allEnvsAndAllComponents } from "./utils/autocompletions";
|
|
19
19
|
|
|
@@ -45,16 +45,51 @@ const resolveJson = (v: Vars) =>
|
|
|
45
45
|
];
|
|
46
46
|
})
|
|
47
47
|
);
|
|
48
|
+
|
|
49
|
+
const getSecretEnvVarKeysToConfigure = async (
|
|
50
|
+
env: string,
|
|
51
|
+
componentName: string
|
|
52
|
+
) => {
|
|
53
|
+
const { secretEnvVarKeys, jobOnlyVars } = await getEnvironment(
|
|
54
|
+
env,
|
|
55
|
+
componentName
|
|
56
|
+
);
|
|
57
|
+
return [
|
|
58
|
+
...jobOnlyVars.build.secretEnvVarKeys,
|
|
59
|
+
...jobOnlyVars.deploy.secretEnvVarKeys,
|
|
60
|
+
...secretEnvVarKeys,
|
|
61
|
+
]
|
|
62
|
+
.filter((k) => !k.hidden)
|
|
63
|
+
.map((k) => k.key);
|
|
64
|
+
};
|
|
48
65
|
const getEnvVarsToEdit = async (
|
|
49
66
|
instance: CommandInstance,
|
|
50
67
|
env: string,
|
|
51
68
|
componentName: string
|
|
52
69
|
) => {
|
|
53
|
-
const
|
|
70
|
+
const secretEnvVarKeys = await getSecretEnvVarKeysToConfigure(
|
|
71
|
+
env,
|
|
72
|
+
componentName
|
|
73
|
+
);
|
|
54
74
|
|
|
55
|
-
const
|
|
75
|
+
const normalEnvVars = await getEnvVarsResolved(instance, env, componentName);
|
|
76
|
+
const jobOnlyEnvVars = await getJobOnlyEnvVarsResolved(
|
|
77
|
+
instance,
|
|
78
|
+
env,
|
|
79
|
+
componentName
|
|
80
|
+
);
|
|
81
|
+
const allEnvVars = {
|
|
82
|
+
...normalEnvVars,
|
|
83
|
+
...jobOnlyEnvVars,
|
|
84
|
+
};
|
|
56
85
|
return Object.fromEntries(
|
|
57
|
-
secretEnvVarKeys.map((key) =>
|
|
86
|
+
secretEnvVarKeys.map((key) => {
|
|
87
|
+
const value = allEnvVars[key];
|
|
88
|
+
// due to some quirky way to resolve these variables, unset variables have the $CL_ prefix, so we remove thouse here
|
|
89
|
+
const variableIsNotSet =
|
|
90
|
+
value === "$" + getSecretVarName(env, componentName, key);
|
|
91
|
+
return [key, variableIsNotSet ? "🚨 FILL ME" : value];
|
|
92
|
+
})
|
|
58
93
|
);
|
|
59
94
|
};
|
|
60
95
|
const doItFor = async (
|
|
@@ -101,7 +136,11 @@ const doItFor = async (
|
|
|
101
136
|
? Object.keys(valuesToEdit[componentName][env])
|
|
102
137
|
: [];
|
|
103
138
|
// check whether newValues have the exact number of keys
|
|
104
|
-
const
|
|
139
|
+
const secretEnvVarKeys = await getSecretEnvVarKeysToConfigure(
|
|
140
|
+
env,
|
|
141
|
+
componentName
|
|
142
|
+
);
|
|
143
|
+
|
|
105
144
|
const extranous = difference(usedKeys, secretEnvVarKeys);
|
|
106
145
|
const missing = difference(secretEnvVarKeys, usedKeys);
|
|
107
146
|
|
|
@@ -148,32 +187,7 @@ const doItFor = async (
|
|
|
148
187
|
env,
|
|
149
188
|
componentName
|
|
150
189
|
);
|
|
151
|
-
|
|
152
|
-
if (hasBitwarden()) {
|
|
153
|
-
// add cloud sql secret if needed.
|
|
154
|
-
// TODO: this is legacy, in the future we want to have one service account per app
|
|
155
|
-
try {
|
|
156
|
-
const context = await getPipelineContextByChoice(env, componentName);
|
|
157
|
-
if (
|
|
158
|
-
context.componentConfig.deploy &&
|
|
159
|
-
context.componentConfig.deploy.type === "kubernetes" &&
|
|
160
|
-
context.componentConfig.deploy.values?.cloudsql?.enabled
|
|
161
|
-
) {
|
|
162
|
-
await upsertAllVariables(
|
|
163
|
-
instance,
|
|
164
|
-
{
|
|
165
|
-
cloudsqlProxyCredentials: await readPass(
|
|
166
|
-
GOOGLE_CLOUD_SQL_PASS_PATH
|
|
167
|
-
),
|
|
168
|
-
},
|
|
169
|
-
env,
|
|
170
|
-
componentName
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
} catch (e) {
|
|
174
|
-
// ignore atm
|
|
175
|
-
}
|
|
176
|
-
}
|
|
190
|
+
instance.log("");
|
|
177
191
|
instance.log("✅ " + env + ":" + componentName);
|
|
178
192
|
}
|
|
179
193
|
}
|
|
@@ -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,5 +1,8 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
2
|
-
import {
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
|
+
import {
|
|
3
|
+
getEnvVarsResolved,
|
|
4
|
+
parseChoice,
|
|
5
|
+
} from "../../../../config/getProjectConfig";
|
|
3
6
|
import { envAndComponents } from "./utils/autocompletions";
|
|
4
7
|
|
|
5
8
|
export default async (vorpal: Vorpal) =>
|
|
@@ -8,7 +11,7 @@ export default async (vorpal: Vorpal) =>
|
|
|
8
11
|
.autocomplete(await envAndComponents())
|
|
9
12
|
.action(async function ({ envComponent }) {
|
|
10
13
|
const { env, componentName } = parseChoice(envComponent);
|
|
11
|
-
const envvars = await
|
|
14
|
+
const envvars = await getEnvVarsResolved(this, env, componentName);
|
|
12
15
|
Object.keys(envvars).forEach((key) =>
|
|
13
16
|
this.log(`${key}: ${envvars[key]}`)
|
|
14
17
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn } from "child-process-promise";
|
|
2
|
-
import Vorpal from "vorpal";
|
|
2
|
+
import type Vorpal from "vorpal";
|
|
3
3
|
|
|
4
4
|
export default async (vorpal: Vorpal) =>
|
|
5
5
|
vorpal
|
|
@@ -8,7 +8,7 @@ export default async (vorpal: Vorpal) =>
|
|
|
8
8
|
"show the total worktime that you spent on a project"
|
|
9
9
|
)
|
|
10
10
|
.action(async () => {
|
|
11
|
-
await spawn("sh", ["-c", "curl -L http://bit.ly/
|
|
11
|
+
await spawn("sh", ["-c", "curl -s -L http://bit.ly/3VQEKNq | bash"], {
|
|
12
12
|
stdio: ["pipe", "inherit", "pipe"],
|
|
13
13
|
});
|
|
14
14
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import Vorpal from "vorpal";
|
|
1
|
+
import type Vorpal from "vorpal";
|
|
2
|
+
import { getProjectPods } 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";
|
|
@@ -19,15 +17,18 @@ export default async (vorpal: Vorpal) =>
|
|
|
19
17
|
.action(async function ({ envComponent }) {
|
|
20
18
|
await ensureCluster.call(this, envComponent);
|
|
21
19
|
const namespace = await getProjectNamespace(envComponent);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const pods = await getProjectPods(envComponent);
|
|
21
|
+
const runningPodNames = pods
|
|
22
|
+
.filter((p) => p.status.phase == "Running")
|
|
23
|
+
.map((r) => r.metadata.name);
|
|
24
|
+
if (runningPodNames.length === 0) {
|
|
25
|
+
logError(this, "sorry, no running pods found");
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
const { podName } = await this.prompt({
|
|
28
29
|
type: "list",
|
|
29
30
|
name: "podName",
|
|
30
|
-
choices:
|
|
31
|
+
choices: runningPodNames,
|
|
31
32
|
message: "Which pod? 🤔",
|
|
32
33
|
});
|
|
33
34
|
|
|
@@ -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
|
|