@catladder/cli 0.0.0-test7 → 0.0.0-update-meteor-53480fed
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/.nvmrc +1 -1
- package/README.md +6 -3
- package/bin/catenv +3 -0
- package/bin/catenv-dev +3 -0
- package/bin/catladder +1 -1
- package/bin/catladder-dev +3 -0
- package/dist/apps/catenv/catenv.d.ts +3 -0
- package/dist/apps/catenv/catenv.js +66 -0
- package/dist/apps/catenv/catenv.js.map +1 -0
- package/dist/apps/catenv/printVariables.d.ts +3 -0
- package/dist/apps/catenv/printVariables.js +115 -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.d.ts +2 -0
- package/dist/apps/cli/cli.js +83 -0
- package/dist/apps/cli/cli.js.map +1 -0
- package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.d.ts +3 -0
- 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 +4 -0
- package/dist/apps/cli/commands/general/index.js +216 -0
- package/dist/apps/cli/commands/general/index.js.map +1 -0
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +3 -0
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +56 -0
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -0
- package/dist/apps/cli/commands/general/portForward.d.ts +3 -0
- package/dist/apps/cli/commands/general/portForward.js +97 -0
- package/dist/apps/cli/commands/general/portForward.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/index.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/index.js +53 -0
- package/dist/apps/cli/commands/mongodb/index.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +191 -0
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +96 -0
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +121 -0
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/utils/index.d.ts +13 -0
- package/dist/apps/cli/commands/mongodb/utils/index.js +179 -0
- package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -0
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +164 -0
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -0
- package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +5 -0
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +334 -0
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -0
- package/dist/apps/cli/commands/project/commandDeletePods.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandDeletePods.js +121 -0
- package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -0
- package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandDeleteProject.js +97 -0
- package/dist/apps/cli/commands/project/commandDeleteProject.js.map +1 -0
- package/dist/apps/cli/commands/project/commandEnvVars.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandEnvVars.js +74 -0
- package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -0
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +58 -0
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -0
- package/dist/apps/cli/commands/project/commandGetShell.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandGetShell.js +96 -0
- package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -0
- package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandGitlabCi.js +185 -0
- package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -0
- package/dist/apps/cli/commands/project/commandInitProject.old.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandInitProject.old.js +345 -0
- package/dist/apps/cli/commands/project/commandInitProject.old.js.map +1 -0
- package/dist/apps/cli/commands/project/commandListPods.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandListPods.js +78 -0
- package/dist/apps/cli/commands/project/commandListPods.js.map +1 -0
- package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +7 -0
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js +112 -0
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -0
- package/dist/apps/cli/commands/project/commandNamespace.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandNamespace.js +70 -0
- package/dist/apps/cli/commands/project/commandNamespace.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +83 -0
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenDashboard.js +84 -0
- package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenEnv.js +80 -0
- package/dist/apps/cli/commands/project/commandOpenEnv.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenGit.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenGit.js +56 -0
- package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenGrafana.js +83 -0
- package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +100 -0
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenLogs.js +74 -0
- package/dist/apps/cli/commands/project/commandOpenLogs.js.map +1 -0
- package/dist/apps/cli/commands/project/commandPauseProject.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandPauseProject.js +97 -0
- package/dist/apps/cli/commands/project/commandPauseProject.js.map +1 -0
- package/dist/apps/cli/commands/project/commandPortForward.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandPortForward.js +168 -0
- package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -0
- 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 +3 -0
- package/dist/apps/cli/commands/project/commandSetup.js +58 -0
- package/dist/apps/cli/commands/project/commandSetup.js.map +1 -0
- package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js +144 -0
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -0
- package/dist/apps/cli/commands/project/index.d.ts +3 -0
- package/dist/apps/cli/commands/project/index.js +94 -0
- package/dist/apps/cli/commands/project/index.js.map +1 -0
- package/dist/apps/cli/commands/project/setup/index.d.ts +2 -0
- package/dist/apps/cli/commands/project/setup/index.js +107 -0
- package/dist/apps/cli/commands/project/setup/index.js.map +1 -0
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.d.ts +2 -0
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.js +116 -0
- package/dist/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -0
- 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 +3 -0
- package/dist/apps/cli/commands/project/setup/setupContext.js +81 -0
- package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -0
- package/dist/apps/cli/commands/project/setup/setupKubernetes.d.ts +3 -0
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js +139 -0
- package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -0
- 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/autocompletions.d.ts +3 -0
- package/dist/apps/cli/commands/project/utils/autocompletions.js +96 -0
- package/dist/apps/cli/commands/project/utils/autocompletions.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -0
- package/dist/apps/cli/commands/project/utils/ensureCluster.js +84 -0
- package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +2 -0
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js +104 -0
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +2 -0
- package/dist/apps/cli/commands/project/utils/showProjectBanner.js +58 -0
- package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -0
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +3 -0
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +101 -0
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -0
- package/dist/apps/cli/config/writeConfig.d.ts +5 -0
- package/dist/apps/cli/config/writeConfig.js +106 -0
- package/dist/apps/cli/config/writeConfig.js.map +1 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
- package/dist/apps/cli/verify/index.d.ts +2 -0
- package/dist/apps/cli/verify/index.js +94 -0
- package/dist/apps/cli/verify/index.js.map +1 -0
- package/dist/apps/cli/verify/migration/fromv2.d.ts +4 -0
- package/dist/apps/cli/verify/migration/fromv2.js +349 -0
- package/dist/apps/cli/verify/migration/fromv2.js.map +1 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +4 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.js +91 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -0
- package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +18 -0
- package/dist/apps/cli/verify/migration/oldGitlabCi.js +30 -0
- package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -0
- package/dist/bundles/catenv/index.js +46512 -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 +363134 -0
- package/dist/bundles/cli/xdg-open +1066 -0
- package/dist/bundles/cli/xsel +0 -0
- package/dist/catenv.d.ts +1 -0
- package/dist/catenv.js +13 -0
- package/dist/catenv.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/constants.d.ts +2 -0
- package/dist/config/constants.js +6 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/getProjectConfig.d.ts +24 -0
- package/dist/config/getProjectConfig.js +313 -0
- package/dist/config/getProjectConfig.js.map +1 -0
- 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/gcloud/openDashboard.js +66 -0
- 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/k8sApi/index.d.ts +8 -0
- package/dist/k8sApi/index.js +29 -0
- package/dist/k8sApi/index.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/packageInfos.d.ts +2 -0
- package/dist/packageInfos.js +6 -0
- package/dist/packageInfos.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/types.d.ts +18 -0
- package/dist/types/types.js +3 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/cluster.d.ts +3 -0
- package/dist/utils/cluster.js +68 -0
- package/dist/utils/cluster.js.map +1 -0
- package/dist/utils/editAsFile.d.ts +1 -0
- package/dist/utils/editAsFile.js +85 -0
- package/dist/utils/editAsFile.js.map +1 -0
- package/dist/utils/files.d.ts +2 -0
- package/dist/utils/files.js +83 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/getEditor.d.ts +4 -0
- package/dist/utils/getEditor.js +70 -0
- package/dist/utils/getEditor.js.map +1 -0
- package/dist/utils/gitlab.d.ts +24 -0
- package/dist/utils/gitlab.js +397 -0
- package/dist/utils/gitlab.js.map +1 -0
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/log.js +14 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/passwordstore/index.d.ts +7 -0
- package/dist/utils/passwordstore/index.js +315 -0
- package/dist/utils/passwordstore/index.js.map +1 -0
- package/dist/utils/portForwards.d.ts +12 -0
- package/dist/utils/portForwards.js +120 -0
- package/dist/utils/portForwards.js.map +1 -0
- package/dist/utils/preferences/index.d.ts +3 -0
- package/dist/utils/preferences/index.js +119 -0
- package/dist/utils/preferences/index.js.map +1 -0
- package/dist/utils/projects/index.d.ts +5 -0
- package/dist/utils/projects/index.js +103 -0
- package/dist/utils/projects/index.js.map +1 -0
- package/dist/utils/promise.d.ts +2 -0
- package/dist/utils/promise.js +62 -0
- package/dist/utils/promise.js.map +1 -0
- package/dist/utils/shell.d.ts +1 -0
- package/dist/utils/shell.js +81 -0
- package/dist/utils/shell.js.map +1 -0
- package/package.json +32 -35
- package/scripts/bundle +4 -0
- package/src/apps/catenv/catenv.ts +14 -37
- package/src/apps/catenv/printVariables.ts +58 -0
- package/src/apps/catenv/types.ts +6 -0
- package/src/apps/catenv/utils.ts +49 -0
- package/src/apps/catenv/writeDotEnvFiles.ts +44 -0
- package/src/apps/catenv/writeEnvDTs.ts +71 -0
- package/src/apps/{shell/shell.ts → cli/cli.ts} +13 -3
- package/src/apps/cli/commands/cloudSQL/commandRestoreDb.ts +154 -0
- package/src/apps/cli/commands/cloudSQL/index.ts +8 -0
- package/src/apps/{shell → cli}/commands/general/index.ts +16 -52
- package/src/apps/{shell → cli}/commands/general/portForward.ts +7 -6
- package/src/apps/{shell → cli}/commands/mongodb/index.ts +2 -2
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoDestroyMember.ts +20 -22
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoGetShell.ts +13 -11
- package/src/apps/cli/commands/mongodb/projectMongoPortForward.ts +65 -0
- package/src/apps/{shell → cli}/commands/mongodb/utils/index.ts +28 -19
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +139 -0
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +234 -0
- package/src/apps/{shell → cli}/commands/project/commandDeletePods.ts +13 -15
- package/src/apps/{shell → cli}/commands/project/commandDeleteProject.ts +8 -9
- package/src/apps/cli/commands/project/commandEnvVars.ts +18 -0
- package/src/apps/{shell → cli}/commands/project/commandGetMyTotalWorktime.ts +4 -4
- package/src/apps/cli/commands/project/commandGetShell.ts +36 -0
- package/src/apps/{shell → cli}/commands/project/commandGitlabCi.ts +3 -2
- package/src/apps/{shell/commands/project/commandInitProject.ts → cli/commands/project/commandInitProject.old.ts} +15 -7
- package/src/apps/cli/commands/project/commandListPods.ts +18 -0
- package/src/apps/{shell → cli}/commands/project/commandMigrateHelm3.ts +18 -8
- package/src/apps/cli/commands/project/commandNamespace.ts +14 -0
- package/src/apps/cli/commands/project/commandOpenCostDashboard.ts +32 -0
- package/src/apps/cli/commands/project/commandOpenDashboard.ts +28 -0
- package/src/apps/cli/commands/project/commandOpenEnv.ts +22 -0
- package/src/apps/{shell → cli}/commands/project/commandOpenGit.ts +2 -2
- package/src/apps/{shell → cli}/commands/project/commandOpenGrafana.ts +10 -10
- package/src/apps/{shell → cli}/commands/project/commandOpenGrafanaPod.ts +14 -17
- package/src/apps/cli/commands/project/commandOpenLogs.ts +21 -0
- package/src/apps/{shell → cli}/commands/project/commandPauseProject.ts +10 -8
- package/src/apps/cli/commands/project/commandPortForward.ts +86 -0
- package/src/apps/cli/commands/project/commandSecretsClearBackups.ts +27 -0
- package/src/apps/cli/commands/project/commandSetup.ts +12 -0
- package/src/apps/{shell → cli}/commands/project/commandTriggerCronjob.ts +13 -12
- package/src/apps/{shell → cli}/commands/project/index.ts +10 -10
- package/src/apps/cli/commands/project/setup/index.ts +44 -0
- package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +84 -0
- package/src/apps/cli/commands/project/setup/setupCloudRun.ts +84 -0
- package/src/apps/cli/commands/project/setup/setupContext.ts +44 -0
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +140 -0
- package/src/apps/cli/commands/project/setup/setupTopic.ts +22 -0
- package/src/apps/cli/commands/project/utils/autocompletions.ts +26 -0
- package/src/apps/cli/commands/project/utils/ensureCluster.ts +42 -0
- package/src/apps/cli/commands/project/utils/ensureNamespace.ts +58 -0
- package/src/apps/cli/commands/project/utils/showProjectBanner.ts +11 -0
- package/src/apps/cli/commands/theStuffThatReallyMatters/index.ts +32 -0
- package/src/apps/cli/config/writeConfig.ts +71 -0
- package/src/apps/cli/verify/index.ts +30 -0
- package/src/apps/cli/verify/migration/fromv2.ts +262 -0
- package/src/apps/cli/verify/migration/migrateSecrets.ts +47 -0
- package/src/apps/cli/verify/migration/oldGitlabCi.ts +48 -0
- package/src/catenv.ts +10 -0
- package/src/cli.ts +3 -0
- package/src/config/constants.ts +0 -3
- package/src/config/getProjectConfig.ts +200 -0
- 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/k8sApi/index.ts +22 -6
- 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/types/types.ts +0 -2
- package/src/utils/cluster.ts +5 -14
- package/src/utils/editAsFile.ts +31 -0
- package/src/utils/files.ts +6 -2
- package/src/utils/gitlab.ts +263 -42
- package/src/utils/passwordstore/index.ts +6 -36
- package/src/utils/{portForward.ts → portForwards.ts} +27 -22
- package/src/utils/preferences/index.ts +6 -3
- package/src/utils/projects/index.ts +9 -149
- package/tsconfig.json +3 -7
- package/bin/catenv.sh +0 -1
- package/src/apps/shell/commands/mongodb/projectMongoPortForward.ts +0 -42
- package/src/apps/shell/commands/project/commandCloudSqlProxy.ts +0 -65
- package/src/apps/shell/commands/project/commandConfigSecrets.ts +0 -245
- package/src/apps/shell/commands/project/commandCopyDB.ts +0 -93
- package/src/apps/shell/commands/project/commandEnvVars.ts +0 -17
- package/src/apps/shell/commands/project/commandGetShell.ts +0 -35
- package/src/apps/shell/commands/project/commandInitGitlab.ts +0 -157
- package/src/apps/shell/commands/project/commandListPods.ts +0 -21
- package/src/apps/shell/commands/project/commandNamespace.ts +0 -12
- package/src/apps/shell/commands/project/commandOpenCostDashboard.ts +0 -29
- package/src/apps/shell/commands/project/commandOpenDashboard.ts +0 -27
- package/src/apps/shell/commands/project/commandOpenEnv.ts +0 -18
- package/src/apps/shell/commands/project/commandOpenLogs.ts +0 -23
- package/src/apps/shell/commands/project/commandPortForward.ts +0 -45
- package/src/apps/shell/commands/project/commandVariables.ts +0 -13
- package/src/apps/shell/commands/project/utils/autocompletions.ts +0 -7
- package/src/apps/shell/commands/project/utils/ensureCluster.ts +0 -31
- package/src/apps/shell/commands/project/utils/ensureNamespace.ts +0 -32
- package/src/apps/shell/commands/project/utils/monorepo.ts +0 -45
- package/src/apps/shell/commands/shared/index.ts +0 -31
- package/src/apps/shell/commands/theStuffThatReallyMatters/index.ts +0 -51
- package/src/config/clusters.ts +0 -45
- package/src/index.ts +0 -17
- package/src/types/git-repo-name.d.ts +0 -1
- package/src/types/yawn-yaml.d.ts +0 -1
- package/src/utils/dashboardToken.ts +0 -20
- package/src/utils/formatEnvVars.ts +0 -7
- /package/src/apps/{shell → cli}/commands/general/namespaceAutoCompletion.ts +0 -0
- /package/src/apps/{shell → cli}/utils/getGoogleAuthUserNumber.ts +0 -0
|
Binary file
|
package/dist/catenv.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/catenv.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var catenv_1 = __importDefault(require("./apps/catenv/catenv"));
|
|
7
|
+
var parseChoice_1 = require("./config/parseChoice");
|
|
8
|
+
var choice = process.argv[2] ? (0, parseChoice_1.parseChoice)(process.argv[2]) : null;
|
|
9
|
+
(0, catenv_1["default"])(choice).then(function () {
|
|
10
|
+
// we have to exit manually, because we have some file watches
|
|
11
|
+
process.exit();
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=catenv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catenv.js","sourceRoot":"","sources":["../src/catenv.ts"],"names":[],"mappings":";;;;;AAAA,gEAA0C;AAE1C,oDAAmD;AAEnD,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,yBAAW,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAErE,IAAA,mBAAM,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC;IAClB,8DAA8D;IAC9D,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var cli_1 = __importDefault(require("./apps/cli/cli"));
|
|
7
|
+
(0, cli_1["default"])();
|
|
8
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;AAAA,uDAAiC;AAEjC,IAAA,gBAAG,GAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAG,IAAI,CAAC;AAChC,QAAA,yBAAyB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Config } from "@catladder/pipeline";
|
|
2
|
+
import type { CommandInstance } from "vorpal";
|
|
3
|
+
export { parseChoice } from "./parseChoice";
|
|
4
|
+
export declare const getProjectConfig: () => Promise<Config<never>>;
|
|
5
|
+
export declare const getGitlabCiFilePath: () => Promise<string>;
|
|
6
|
+
export declare const getGitlabCi: <T = Record<string, any>>() => Promise<T>;
|
|
7
|
+
export declare const getProjectComponents: () => Promise<string[]>;
|
|
8
|
+
export declare const getPipelineContextByChoice: (env: string, componentName: string) => Promise<import("@catladder/pipeline").Context>;
|
|
9
|
+
export declare const getAllComponentsWithAllEnvsFlat: () => Promise<Array<{
|
|
10
|
+
env: string;
|
|
11
|
+
componentName: string;
|
|
12
|
+
}>>;
|
|
13
|
+
export declare const getAllComponentsWithAllEnvsHierarchical: () => Promise<{
|
|
14
|
+
[componentName: string]: string[];
|
|
15
|
+
}>;
|
|
16
|
+
export declare const getAllPipelineContexts: () => Promise<import("@catladder/pipeline").Context[]>;
|
|
17
|
+
export declare const getEnvironment: (env: string, componentName: string) => Promise<import("@catladder/pipeline").Environment>;
|
|
18
|
+
export declare const getGitlabVar: (vorpal: CommandInstance, env: string, componentName: string, variableName: string) => Promise<string>;
|
|
19
|
+
export declare const getEnvVarsResolved: (vorpal: CommandInstance | null, env: string, componentName: string | null) => Promise<Record<string, string>>;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* is used to get job only vars that should also be editable locally with catladder.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getJobOnlyEnvVarsResolved: (vorpal: CommandInstance, env: string, componentName: string) => Promise<Record<string, string>>;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
13
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
14
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
15
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
19
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
20
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
21
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
22
|
+
function step(op) {
|
|
23
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
24
|
+
while (_) try {
|
|
25
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
26
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
27
|
+
switch (op[0]) {
|
|
28
|
+
case 0: case 1: t = op; break;
|
|
29
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
30
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
31
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
32
|
+
default:
|
|
33
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
34
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
35
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
36
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
37
|
+
if (t[2]) _.ops.pop();
|
|
38
|
+
_.trys.pop(); continue;
|
|
39
|
+
}
|
|
40
|
+
op = body.call(thisArg, _);
|
|
41
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
42
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.__esModule = true;
|
|
46
|
+
exports.getJobOnlyEnvVarsResolved = exports.getEnvVarsResolved = exports.getGitlabVar = exports.getEnvironment = exports.getAllPipelineContexts = exports.getAllComponentsWithAllEnvsHierarchical = exports.getAllComponentsWithAllEnvsFlat = exports.getPipelineContextByChoice = exports.getProjectComponents = exports.getGitlabCi = exports.getGitlabCiFilePath = exports.getProjectConfig = exports.parseChoice = void 0;
|
|
47
|
+
var pipeline_1 = require("@catladder/pipeline");
|
|
48
|
+
var gitlab_1 = require("../utils/gitlab");
|
|
49
|
+
var projects_1 = require("../utils/projects");
|
|
50
|
+
var files_1 = require("../utils/files");
|
|
51
|
+
var fs_1 = require("fs");
|
|
52
|
+
var parseChoice_1 = require("./parseChoice");
|
|
53
|
+
__createBinding(exports, parseChoice_1, "parseChoice");
|
|
54
|
+
var currentConfig = null;
|
|
55
|
+
// reload the config on change
|
|
56
|
+
var reloadConfigAndObserve = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
+
var gitRoot, result, config, path, watcher;
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
switch (_a.label) {
|
|
60
|
+
case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
|
|
61
|
+
case 1:
|
|
62
|
+
gitRoot = _a.sent();
|
|
63
|
+
result = (0, pipeline_1.readConfigSync)(gitRoot);
|
|
64
|
+
if (!result) {
|
|
65
|
+
// can't do anything, there is no config
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
config = result.config, path = result.path;
|
|
69
|
+
watcher = (0, fs_1.watch)(path, function () {
|
|
70
|
+
watcher.close();
|
|
71
|
+
reloadConfigAndObserve();
|
|
72
|
+
});
|
|
73
|
+
currentConfig = config;
|
|
74
|
+
return [2 /*return*/];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}); };
|
|
78
|
+
var getProjectConfig = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0:
|
|
82
|
+
if (!!currentConfig) return [3 /*break*/, 2];
|
|
83
|
+
// initially
|
|
84
|
+
return [4 /*yield*/, reloadConfigAndObserve()];
|
|
85
|
+
case 1:
|
|
86
|
+
// initially
|
|
87
|
+
_a.sent();
|
|
88
|
+
_a.label = 2;
|
|
89
|
+
case 2: return [2 /*return*/, currentConfig];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}); };
|
|
93
|
+
exports.getProjectConfig = getProjectConfig;
|
|
94
|
+
var getGitlabCiFilePath = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
+
var gitRoot;
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
switch (_a.label) {
|
|
98
|
+
case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
|
|
99
|
+
case 1:
|
|
100
|
+
gitRoot = _a.sent();
|
|
101
|
+
return [2 /*return*/, gitRoot + "/.gitlab-ci.yml"];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}); };
|
|
105
|
+
exports.getGitlabCiFilePath = getGitlabCiFilePath;
|
|
106
|
+
var getGitlabCi = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
+
var _a, e_1;
|
|
108
|
+
return __generator(this, function (_b) {
|
|
109
|
+
switch (_b.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
_b.trys.push([0, 2, , 3]);
|
|
112
|
+
_a = files_1.readYaml;
|
|
113
|
+
return [4 /*yield*/, (0, exports.getGitlabCiFilePath)()];
|
|
114
|
+
case 1: return [2 /*return*/, _a.apply(void 0, [_b.sent()])];
|
|
115
|
+
case 2:
|
|
116
|
+
e_1 = _b.sent();
|
|
117
|
+
// ignore
|
|
118
|
+
return [2 /*return*/, null];
|
|
119
|
+
case 3: return [2 /*return*/];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}); };
|
|
123
|
+
exports.getGitlabCi = getGitlabCi;
|
|
124
|
+
var getProjectComponents = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
+
var config;
|
|
126
|
+
return __generator(this, function (_a) {
|
|
127
|
+
switch (_a.label) {
|
|
128
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
|
|
129
|
+
case 1:
|
|
130
|
+
config = _a.sent();
|
|
131
|
+
if (!config)
|
|
132
|
+
return [2 /*return*/, []];
|
|
133
|
+
return [2 /*return*/, Object.keys(config.components)];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}); };
|
|
137
|
+
exports.getProjectComponents = getProjectComponents;
|
|
138
|
+
var getPipelineContextByChoice = function (env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
139
|
+
var config;
|
|
140
|
+
return __generator(this, function (_a) {
|
|
141
|
+
switch (_a.label) {
|
|
142
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
|
|
143
|
+
case 1:
|
|
144
|
+
config = _a.sent();
|
|
145
|
+
return [4 /*yield*/, (0, pipeline_1.createContext)(config, componentName, env)];
|
|
146
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}); };
|
|
150
|
+
exports.getPipelineContextByChoice = getPipelineContextByChoice;
|
|
151
|
+
var getAllComponentsWithAllEnvsFlat = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
152
|
+
var config;
|
|
153
|
+
return __generator(this, function (_a) {
|
|
154
|
+
switch (_a.label) {
|
|
155
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
|
|
156
|
+
case 1:
|
|
157
|
+
config = _a.sent();
|
|
158
|
+
if (!config) {
|
|
159
|
+
return [2 /*return*/, []];
|
|
160
|
+
}
|
|
161
|
+
return [2 /*return*/, Object.keys(config.components).flatMap(function (componentName) {
|
|
162
|
+
return (0, pipeline_1.getAllEnvs)(config, componentName).map(function (env) { return ({ env: env, componentName: componentName }); });
|
|
163
|
+
})];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}); };
|
|
167
|
+
exports.getAllComponentsWithAllEnvsFlat = getAllComponentsWithAllEnvsFlat;
|
|
168
|
+
var getAllComponentsWithAllEnvsHierarchical = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
169
|
+
var config;
|
|
170
|
+
return __generator(this, function (_a) {
|
|
171
|
+
switch (_a.label) {
|
|
172
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
|
|
173
|
+
case 1:
|
|
174
|
+
config = _a.sent();
|
|
175
|
+
if (!config) {
|
|
176
|
+
return [2 /*return*/, {}];
|
|
177
|
+
}
|
|
178
|
+
return [2 /*return*/, Object.fromEntries(Object.keys(config.components).map(function (componentName) { return [
|
|
179
|
+
componentName,
|
|
180
|
+
(0, pipeline_1.getAllEnvs)(config, componentName),
|
|
181
|
+
]; }))];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}); };
|
|
185
|
+
exports.getAllComponentsWithAllEnvsHierarchical = getAllComponentsWithAllEnvsHierarchical;
|
|
186
|
+
var getAllPipelineContexts = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
|
+
var _a, _b;
|
|
188
|
+
return __generator(this, function (_c) {
|
|
189
|
+
switch (_c.label) {
|
|
190
|
+
case 0:
|
|
191
|
+
_b = (_a = Promise).all;
|
|
192
|
+
return [4 /*yield*/, (0, exports.getAllComponentsWithAllEnvsFlat)()];
|
|
193
|
+
case 1: return [2 /*return*/, _b.apply(_a, [(_c.sent())
|
|
194
|
+
.filter(function (c) { return c.env !== "local"; })
|
|
195
|
+
.map(function (_a) {
|
|
196
|
+
var env = _a.env, componentName = _a.componentName;
|
|
197
|
+
return (0, exports.getPipelineContextByChoice)(env, componentName);
|
|
198
|
+
})])];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}); };
|
|
202
|
+
exports.getAllPipelineContexts = getAllPipelineContexts;
|
|
203
|
+
var getEnvironment = function (env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
204
|
+
var config;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
switch (_a.label) {
|
|
207
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
|
|
208
|
+
case 1:
|
|
209
|
+
config = _a.sent();
|
|
210
|
+
return [2 /*return*/, (0, pipeline_1.getEnvironment)(config, componentName, env)];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}); };
|
|
214
|
+
exports.getEnvironment = getEnvironment;
|
|
215
|
+
var getGitlabVar = function (vorpal, env, componentName, variableName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
|
+
var rawVariableName;
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
|
+
case 0:
|
|
220
|
+
rawVariableName = (0, pipeline_1.getSecretVarName)(env, componentName, variableName);
|
|
221
|
+
return [4 /*yield*/, (0, gitlab_1.getVariableValueByRawName)(vorpal, rawVariableName)];
|
|
222
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}); };
|
|
226
|
+
exports.getGitlabVar = getGitlabVar;
|
|
227
|
+
var resolveSecrets = function (vorpal, varSets) { return __awaiter(void 0, void 0, void 0, function () {
|
|
228
|
+
var allVariablesInGitlab;
|
|
229
|
+
return __generator(this, function (_a) {
|
|
230
|
+
switch (_a.label) {
|
|
231
|
+
case 0: return [4 /*yield*/, (0, gitlab_1.getAllVariables)(vorpal)];
|
|
232
|
+
case 1:
|
|
233
|
+
allVariablesInGitlab = _a.sent();
|
|
234
|
+
return [2 /*return*/, Object.fromEntries(varSets.flatMap(function (set) {
|
|
235
|
+
return Object.entries(set.envVars)
|
|
236
|
+
.map(function (_a) {
|
|
237
|
+
var key = _a[0], value = _a[1];
|
|
238
|
+
var secretKey = set.secretEnvVarKeys.find(function (k) { return k.key === key; });
|
|
239
|
+
if (secretKey) {
|
|
240
|
+
if (secretKey.hidden) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
for (var _i = 0, allVariablesInGitlab_1 = allVariablesInGitlab; _i < allVariablesInGitlab_1.length; _i++) {
|
|
244
|
+
var variable = allVariablesInGitlab_1[_i];
|
|
245
|
+
value = value.replace(new RegExp("\\$" + variable.key, "g"), variable.value);
|
|
246
|
+
}
|
|
247
|
+
return [key, value];
|
|
248
|
+
}
|
|
249
|
+
return [key, value];
|
|
250
|
+
})
|
|
251
|
+
.filter(Boolean);
|
|
252
|
+
}))];
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}); };
|
|
256
|
+
var getEnvVarsResolved = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
|
+
var envionment, e_2;
|
|
258
|
+
return __generator(this, function (_a) {
|
|
259
|
+
switch (_a.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
if (!componentName) {
|
|
262
|
+
return [2 /*return*/, {}];
|
|
263
|
+
}
|
|
264
|
+
_a.label = 1;
|
|
265
|
+
case 1:
|
|
266
|
+
_a.trys.push([1, 3, , 4]);
|
|
267
|
+
return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
|
|
268
|
+
case 2:
|
|
269
|
+
envionment = _a.sent();
|
|
270
|
+
// in the pipeline the secrets alreadyy exists and bash will expand them
|
|
271
|
+
// but here we need to manually load them
|
|
272
|
+
return [2 /*return*/, resolveSecrets(vorpal, [
|
|
273
|
+
{
|
|
274
|
+
envVars: envionment.envVars,
|
|
275
|
+
secretEnvVarKeys: envionment.secretEnvVarKeys
|
|
276
|
+
},
|
|
277
|
+
])];
|
|
278
|
+
case 3:
|
|
279
|
+
e_2 = _a.sent();
|
|
280
|
+
// env is disabled
|
|
281
|
+
return [2 /*return*/, {}];
|
|
282
|
+
case 4: return [2 /*return*/];
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}); };
|
|
286
|
+
exports.getEnvVarsResolved = getEnvVarsResolved;
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
* is used to get job only vars that should also be editable locally with catladder.
|
|
290
|
+
*/
|
|
291
|
+
var getJobOnlyEnvVarsResolved = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
292
|
+
var envionment, e_3;
|
|
293
|
+
return __generator(this, function (_a) {
|
|
294
|
+
switch (_a.label) {
|
|
295
|
+
case 0:
|
|
296
|
+
_a.trys.push([0, 2, , 3]);
|
|
297
|
+
return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
|
|
298
|
+
case 1:
|
|
299
|
+
envionment = _a.sent();
|
|
300
|
+
return [2 /*return*/, resolveSecrets(vorpal, [
|
|
301
|
+
envionment.jobOnlyVars.build,
|
|
302
|
+
envionment.jobOnlyVars.deploy,
|
|
303
|
+
])];
|
|
304
|
+
case 2:
|
|
305
|
+
e_3 = _a.sent();
|
|
306
|
+
// env is disabled
|
|
307
|
+
return [2 /*return*/, {}];
|
|
308
|
+
case 3: return [2 /*return*/];
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}); };
|
|
312
|
+
exports.getJobOnlyEnvVarsResolved = getJobOnlyEnvVarsResolved;
|
|
313
|
+
//# sourceMappingURL=getProjectConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProjectConfig.js","sourceRoot":"","sources":["../../src/config/getProjectConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAM6B;AAG7B,0CAA6E;AAE7E,8CAA+C;AAC/C,wCAA0C;AAC1C,yBAA2B;AAE3B,6CAA4C;AAAnC,uDAAW;AAEpB,IAAI,aAAa,GAAkB,IAAI,CAAC;AAExC,8BAA8B;AAC9B,IAAM,sBAAsB,GAAG;;;;oBACb,qBAAM,IAAA,qBAAU,GAAE,EAAA;;gBAA5B,OAAO,GAAG,SAAkB;gBAC5B,MAAM,GAAG,IAAA,yBAAc,EAAC,OAAO,CAAC,CAAC;gBACvC,IAAI,CAAC,MAAM,EAAE;oBACX,wCAAwC;oBACxC,sBAAO;iBACR;gBACO,MAAM,GAAW,MAAM,OAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAY;gBAC1B,OAAO,GAAG,IAAA,UAAK,EAAC,IAAI,EAAE;oBAC1B,OAAO,CAAC,KAAK,EAAE,CAAC;oBAChB,sBAAsB,EAAE,CAAC;gBAC3B,CAAC,CAAC,CAAC;gBACH,aAAa,GAAG,MAAM,CAAC;;;;KACxB,CAAC;AAEK,IAAM,gBAAgB,GAAG;;;;qBAC1B,CAAC,aAAa,EAAd,wBAAc;gBAChB,YAAY;gBACZ,qBAAM,sBAAsB,EAAE,EAAA;;gBAD9B,YAAY;gBACZ,SAA8B,CAAC;;oBAEjC,sBAAO,aAAuB,EAA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
|
3
|
+
exports.parseChoice = void 0;
|
|
4
|
+
var parseChoice = function (envComponent) {
|
|
5
|
+
var _a = envComponent.split(":").map(function (x) { return x || null; }), env = _a[0], componentName = _a[1];
|
|
6
|
+
return { env: env, componentName: componentName };
|
|
7
|
+
};
|
|
8
|
+
exports.parseChoice = parseChoice;
|
|
9
|
+
//# sourceMappingURL=parseChoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseChoice.js","sourceRoot":"","sources":["../../src/config/parseChoice.ts"],"names":[],"mappings":";;;AAAO,IAAM,WAAW,GAAG,UAAC,YAAoB;IACxC,IAAA,KAAuB,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,IAAI,IAAI,EAAT,CAAS,CAAC,EAAnE,GAAG,QAAA,EAAE,aAAa,QAAiD,CAAC;IAC3E,OAAO,EAAE,GAAG,EAAE,GAAa,EAAE,aAAa,eAAA,EAAE,CAAC;AAC/C,CAAC,CAAC;AAHW,QAAA,WAAW,eAGtB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.upsertGcloudArtifactsRegistry = void 0;
|
|
40
|
+
var child_process_promise_1 = require("child-process-promise");
|
|
41
|
+
var upsertGcloudArtifactsRegistry = function (config) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var e_1;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
switch (_a.label) {
|
|
45
|
+
case 0:
|
|
46
|
+
_a.trys.push([0, 2, , 3]);
|
|
47
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("gcloud artifacts repositories create catladder-deploy --project=\"".concat(config.projectId, "\" --repository-format=docker --location=").concat(config.region))];
|
|
48
|
+
case 1:
|
|
49
|
+
_a.sent();
|
|
50
|
+
return [3 /*break*/, 3];
|
|
51
|
+
case 2:
|
|
52
|
+
e_1 = _a.sent();
|
|
53
|
+
return [3 /*break*/, 3];
|
|
54
|
+
case 3: return [2 /*return*/];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}); };
|
|
58
|
+
exports.upsertGcloudArtifactsRegistry = upsertGcloudArtifactsRegistry;
|
|
59
|
+
//# sourceMappingURL=artifactsRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifactsRegistry.js","sourceRoot":"","sources":["../../src/gcloud/artifactsRegistry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAA6C;AAEtC,IAAM,6BAA6B,GAAG,UAAO,MAGnD;;;;;;gBAEG,qBAAM,IAAA,4BAAI,EACR,4EAAoE,MAAM,CAAC,SAAS,sDAA2C,MAAM,CAAC,MAAM,CAAE,CAC/I,EAAA;;gBAFD,SAEC,CAAC;;;;;;;;KAKL,CAAC;AAZW,QAAA,6BAA6B,iCAYxC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.getCloudRunDomainSuffix = void 0;
|
|
40
|
+
var child_process_promise_1 = require("child-process-promise");
|
|
41
|
+
var getSuffixFromService = function (service) {
|
|
42
|
+
var fullUrl = service.status.url;
|
|
43
|
+
var name = service.metadata.name;
|
|
44
|
+
return fullUrl.replace("https://" + name + "-", "");
|
|
45
|
+
};
|
|
46
|
+
var getCloudRunDomainSuffix = function (config) { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var dummyServiceName, existingServices, result;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
dummyServiceName = "cl-dummy-service-delete-me";
|
|
52
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("gcloud run services list --format=json --project=\"".concat(config.projectId, "\" --region=").concat(config.region, " --limit=1")).then(function (r) { return JSON.parse(r.stdout); })];
|
|
53
|
+
case 1:
|
|
54
|
+
existingServices = _a.sent();
|
|
55
|
+
if (existingServices.length > 0) {
|
|
56
|
+
return [2 /*return*/, getSuffixFromService(existingServices[0])];
|
|
57
|
+
}
|
|
58
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("gcloud run deploy ".concat(dummyServiceName, " --region=").concat(config.region, " --allow-unauthenticated --project ").concat(config.projectId, " --image=us-docker.pkg.dev/cloudrun/container/hello --format=json")).then(function (r) { return JSON.parse(r.stdout); })];
|
|
59
|
+
case 2:
|
|
60
|
+
result = _a.sent();
|
|
61
|
+
return [4 /*yield*/, getSuffixFromService(result)];
|
|
62
|
+
case 3: return [2 /*return*/, _a.sent()];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}); };
|
|
66
|
+
exports.getCloudRunDomainSuffix = getCloudRunDomainSuffix;
|
|
67
|
+
//# sourceMappingURL=getCloudRunDomainSuffix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCloudRunDomainSuffix.js","sourceRoot":"","sources":["../../../src/gcloud/cloudRun/getCloudRunDomainSuffix.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAA6C;AAE7C,IAAM,oBAAoB,GAAG,UAAC,OAAY;IACxC,IAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;IACnC,IAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEnC,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC,CAAC;AACK,IAAM,uBAAuB,GAAG,UAAO,MAA4B;;;;;gBAUlE,gBAAgB,GAAG,4BAA4B,CAAC;gBAE7B,qBAAM,IAAA,4BAAI,EACjC,8DAAsD,MAAM,CAAC,SAAS,0BAAe,MAAM,CAAC,MAAM,eAAY,CAC/G,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAApB,CAAoB,CAAC,EAAA;;gBAF7B,gBAAgB,GAAG,SAEU;gBAEnC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC/B,sBAAO,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAC;iBAClD;gBAEc,qBAAM,IAAA,4BAAI,EACvB,4BAAqB,gBAAgB,uBAAa,MAAM,CAAC,MAAM,gDAAsC,MAAM,CAAC,SAAS,sEAAmE,CACzL,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAApB,CAAoB,CAAC,EAAA;;gBAF7B,MAAM,GAAG,SAEoB;gBAE5B,qBAAM,oBAAoB,CAAC,MAAM,CAAC,EAAA;oBAAzC,sBAAO,SAAkC,EAAC;;;KAC3C,CAAC;AAzBW,QAAA,uBAAuB,2BAyBlC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.openGoogleCloudRunDashboard = void 0;
|
|
40
|
+
var pipeline_1 = require("@catladder/pipeline");
|
|
41
|
+
var openDashboard_1 = require("../openDashboard");
|
|
42
|
+
var openGoogleCloudRunDashboard = function (instance, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
43
|
+
var fullName, _a, region, projectId;
|
|
44
|
+
return __generator(this, function (_b) {
|
|
45
|
+
switch (_b.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")) {
|
|
48
|
+
throw new Error("deploy type is not google-cloudrun ");
|
|
49
|
+
}
|
|
50
|
+
fullName = context.environment.fullName;
|
|
51
|
+
_a = context.componentConfig.deploy, region = _a.region, projectId = _a.projectId;
|
|
52
|
+
return [4 /*yield*/, (0, openDashboard_1.openGoogleCloudDashboard)(instance, "run/detail/".concat(region, "/").concat(fullName, "/metrics"), {
|
|
53
|
+
project: projectId
|
|
54
|
+
})];
|
|
55
|
+
case 1:
|
|
56
|
+
_b.sent();
|
|
57
|
+
return [2 /*return*/];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}); };
|
|
61
|
+
exports.openGoogleCloudRunDashboard = openGoogleCloudRunDashboard;
|
|
62
|
+
//# sourceMappingURL=openCloudRunDashboards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openCloudRunDashboards.js","sourceRoot":"","sources":["../../../src/gcloud/cloudRun/openCloudRunDashboards.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAqD;AAErD,kDAA4D;AAErD,IAAM,2BAA2B,GAAG,UACzC,QAAyB,EACzB,OAAgB;;;;;gBAEhB,IAAI,CAAC,IAAA,yBAAc,EAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE;oBACtE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;iBACxD;gBACO,QAAQ,GAAK,OAAO,CAAC,WAAW,SAAxB,CAAyB;gBACnC,KAAwB,OAAO,CAAC,eAAe,CAAC,MAAM,EAApD,MAAM,YAAA,EAAE,SAAS,eAAA,CAAoC;gBAC7D,qBAAM,IAAA,wCAAwB,EAC5B,QAAQ,EACR,qBAAc,MAAM,cAAI,QAAQ,aAAU,EAC1C;wBACE,OAAO,EAAE,SAAS;qBACnB,CACF,EAAA;;gBAND,SAMC,CAAC;;;;KACH,CAAC;AAhBW,QAAA,2BAA2B,+BAgBtC"}
|