@catladder/cli 0.0.0-new-release-a895e12e → 0.0.0-new-cli-80ac360a
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/README.md +23 -5
- package/babel-inline.json +11 -0
- package/dist/bundles/catci/index.js +2258 -2364
- package/dist/bundles/catenv/index.js +6528 -6469
- package/dist/bundles/cli/index.js +136142 -160208
- package/dist/cli/src/adapters/baseContext.d.ts +22 -0
- package/dist/cli/src/adapters/baseContext.js +31 -0
- package/dist/cli/src/adapters/baseContext.js.map +1 -0
- package/dist/cli/src/adapters/programmatic.d.ts +26 -0
- package/dist/cli/src/adapters/programmatic.js +67 -0
- package/dist/cli/src/adapters/programmatic.js.map +1 -0
- package/dist/cli/src/adapters/terminal.d.ts +28 -0
- package/dist/cli/src/adapters/terminal.js +201 -0
- package/dist/cli/src/adapters/terminal.js.map +1 -0
- package/dist/cli/src/apps/catci/catci.d.ts +1 -1
- package/dist/cli/src/apps/catci/catci.js +23 -20
- package/dist/cli/src/apps/catci/commands/security/auditDocument.d.ts +16 -16
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js +54 -65
- package/dist/cli/src/apps/catci/commands/security/commands.d.ts +1 -1
- package/dist/cli/src/apps/catci/commands/security/commands.js +91 -83
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.d.ts +11 -6
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js +43 -43
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.d.ts +5 -3
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js +16 -12
- package/dist/cli/src/apps/catenv/catenv.d.ts +5 -2
- package/dist/cli/src/apps/catenv/catenv.js +17 -16
- package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/cli/src/apps/catenv/printVariables.d.ts +1 -1
- package/dist/cli/src/apps/catenv/printVariables.js +42 -39
- package/dist/cli/src/apps/catenv/types.d.ts +3 -3
- package/dist/cli/src/apps/catenv/types.js +4 -2
- package/dist/cli/src/apps/catenv/utils.d.ts +9 -6
- package/dist/cli/src/apps/catenv/utils.js +25 -21
- package/dist/cli/src/apps/catenv/verboseBanner.d.ts +1 -0
- package/dist/cli/src/apps/catenv/verboseBanner.js +26 -0
- package/dist/cli/src/apps/catenv/verboseBanner.js.map +1 -0
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.d.ts +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +25 -22
- package/dist/cli/src/apps/catenv/writeEnvDTs.d.ts +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js +31 -32
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.d.ts +6 -6
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.js +56 -52
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.d.ts +2 -5
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js +97 -127
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +25 -29
- package/dist/cli/src/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.js +15 -13
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js +40 -31
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAgents.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupAgents.js +137 -133
- package/dist/cli/src/apps/cli/commands/project/setup/setupAgents.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +42 -47
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +15 -13
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +70 -69
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js +15 -7
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js +21 -16
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.d.ts +9 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js +35 -28
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js +35 -30
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.d.ts +2 -1
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js +17 -15
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -1
- package/dist/cli/src/catci.d.ts +1 -1
- package/dist/cli/src/catci.js +5 -3
- package/dist/cli/src/catenv.d.ts +1 -1
- package/dist/cli/src/catenv.js +21 -12
- package/dist/cli/src/catenv.js.map +1 -1
- package/dist/cli/src/cli.d.ts +1 -1
- package/dist/cli/src/cli.js +181 -6
- package/dist/cli/src/cli.js.map +1 -1
- package/dist/cli/src/commands/cloudSQL/commandRestoreDb.d.ts +46 -0
- package/dist/cli/src/commands/cloudSQL/commandRestoreDb.js +111 -0
- package/dist/cli/src/commands/cloudSQL/commandRestoreDb.js.map +1 -0
- package/dist/cli/src/commands/fun/commandDadjoke.d.ts +1 -0
- package/dist/cli/src/commands/fun/commandDadjoke.js +30 -0
- package/dist/cli/src/commands/fun/commandDadjoke.js.map +1 -0
- package/dist/cli/src/commands/fun/commandStarwars.d.ts +1 -0
- package/dist/cli/src/commands/fun/commandStarwars.js +19 -0
- package/dist/cli/src/commands/fun/commandStarwars.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubeCurrentContext.d.ts +1 -0
- package/dist/cli/src/commands/general/commandKubeCurrentContext.js +17 -0
- package/dist/cli/src/commands/general/commandKubeCurrentContext.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubeGetShell.d.ts +12 -0
- package/dist/cli/src/commands/general/commandKubeGetShell.js +36 -0
- package/dist/cli/src/commands/general/commandKubeGetShell.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubeListNamespaces.d.ts +1 -0
- package/dist/cli/src/commands/general/commandKubeListNamespaces.js +20 -0
- package/dist/cli/src/commands/general/commandKubeListNamespaces.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubeListPods.d.ts +7 -0
- package/dist/cli/src/commands/general/commandKubeListPods.js +26 -0
- package/dist/cli/src/commands/general/commandKubeListPods.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubeListSecrets.d.ts +7 -0
- package/dist/cli/src/commands/general/commandKubeListSecrets.js +26 -0
- package/dist/cli/src/commands/general/commandKubeListSecrets.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubePortForward.d.ts +20 -0
- package/dist/cli/src/commands/general/commandKubePortForward.js +46 -0
- package/dist/cli/src/commands/general/commandKubePortForward.js.map +1 -0
- package/dist/cli/src/commands/general/commandKubeStopPortforward.d.ts +7 -0
- package/dist/cli/src/commands/general/commandKubeStopPortforward.js +24 -0
- package/dist/cli/src/commands/general/commandKubeStopPortforward.js.map +1 -0
- package/dist/cli/src/commands/index.d.ts +34 -0
- package/dist/cli/src/commands/index.js +261 -0
- package/dist/cli/src/commands/index.js.map +1 -0
- package/dist/cli/src/commands/mongodb/commandMongoDestroyMember.d.ts +16 -0
- package/dist/cli/src/commands/mongodb/commandMongoDestroyMember.js +89 -0
- package/dist/cli/src/commands/mongodb/commandMongoDestroyMember.js.map +1 -0
- package/dist/cli/src/commands/mongodb/commandMongoGetShell.d.ts +16 -0
- package/dist/cli/src/commands/mongodb/commandMongoGetShell.js +36 -0
- package/dist/cli/src/commands/mongodb/commandMongoGetShell.js.map +1 -0
- package/dist/cli/src/commands/mongodb/commandMongoPortForward.d.ts +21 -0
- package/dist/cli/src/commands/mongodb/commandMongoPortForward.js +65 -0
- package/dist/cli/src/commands/mongodb/commandMongoPortForward.js.map +1 -0
- package/dist/cli/src/commands/project/commandCloudSqlProxy.d.ts +13 -0
- package/dist/cli/src/commands/project/commandCloudSqlProxy.js +127 -0
- package/dist/cli/src/commands/project/commandCloudSqlProxy.js.map +1 -0
- package/dist/cli/src/commands/project/commandConfigSecrets.d.ts +8 -0
- package/dist/cli/src/commands/project/commandConfigSecrets.js +35 -0
- package/dist/cli/src/commands/project/commandConfigSecrets.js.map +1 -0
- package/dist/cli/src/commands/project/commandDeletePods.d.ts +13 -0
- package/dist/cli/src/commands/project/commandDeletePods.js +49 -0
- package/dist/cli/src/commands/project/commandDeletePods.js.map +1 -0
- package/dist/cli/src/commands/project/commandDeleteProject.d.ts +8 -0
- package/dist/cli/src/commands/project/commandDeleteProject.js +41 -0
- package/dist/cli/src/commands/project/commandDeleteProject.js.map +1 -0
- package/dist/cli/src/commands/project/commandEnvVars.d.ts +8 -0
- package/dist/cli/src/commands/project/commandEnvVars.js +32 -0
- package/dist/cli/src/commands/project/commandEnvVars.js.map +1 -0
- package/dist/cli/src/commands/project/commandGetMyTotalWorktime.d.ts +1 -0
- package/dist/cli/src/commands/project/commandGetMyTotalWorktime.js +19 -0
- package/dist/cli/src/commands/project/commandGetMyTotalWorktime.js.map +1 -0
- package/dist/cli/src/commands/project/commandGetShell.d.ts +13 -0
- package/dist/cli/src/commands/project/commandGetShell.js +41 -0
- package/dist/cli/src/commands/project/commandGetShell.js.map +1 -0
- package/dist/cli/src/commands/project/commandGitlabCi.d.ts +14 -0
- package/dist/cli/src/commands/project/commandGitlabCi.js +109 -0
- package/dist/cli/src/commands/project/commandGitlabCi.js.map +1 -0
- package/dist/cli/src/commands/project/commandListPods.d.ts +8 -0
- package/dist/cli/src/commands/project/commandListPods.js +31 -0
- package/dist/cli/src/commands/project/commandListPods.js.map +1 -0
- package/dist/cli/src/commands/project/commandNamespace.d.ts +8 -0
- package/dist/cli/src/commands/project/commandNamespace.js +26 -0
- package/dist/cli/src/commands/project/commandNamespace.js.map +1 -0
- package/dist/cli/src/commands/project/commandOpenEnv.d.ts +8 -0
- package/dist/cli/src/commands/project/commandOpenEnv.js +40 -0
- package/dist/cli/src/commands/project/commandOpenEnv.js.map +1 -0
- package/dist/cli/src/commands/project/commandOpenGit.d.ts +1 -0
- package/dist/cli/src/commands/project/commandOpenGit.js +17 -0
- package/dist/cli/src/commands/project/commandOpenGit.js.map +1 -0
- package/dist/cli/src/commands/project/commandOpenLogs.d.ts +8 -0
- package/dist/cli/src/commands/project/commandOpenLogs.js +32 -0
- package/dist/cli/src/commands/project/commandOpenLogs.js.map +1 -0
- package/dist/cli/src/commands/project/commandPauseProject.d.ts +8 -0
- package/dist/cli/src/commands/project/commandPauseProject.js +41 -0
- package/dist/cli/src/commands/project/commandPauseProject.js.map +1 -0
- package/dist/cli/src/commands/project/commandPortForward.d.ts +25 -0
- package/dist/cli/src/commands/project/commandPortForward.js +95 -0
- package/dist/cli/src/commands/project/commandPortForward.js.map +1 -0
- package/dist/cli/src/commands/project/commandProjectRestoreDb.d.ts +19 -0
- package/dist/cli/src/commands/project/commandProjectRestoreDb.js +159 -0
- package/dist/cli/src/commands/project/commandProjectRestoreDb.js.map +1 -0
- package/dist/cli/src/commands/project/commandRenewToken.d.ts +1 -0
- package/dist/cli/src/commands/project/commandRenewToken.js +17 -0
- package/dist/cli/src/commands/project/commandRenewToken.js.map +1 -0
- package/dist/cli/src/commands/project/commandSecretsClearBackups.d.ts +7 -0
- package/dist/cli/src/commands/project/commandSecretsClearBackups.js +24 -0
- package/dist/cli/src/commands/project/commandSecretsClearBackups.js.map +1 -0
- package/dist/cli/src/commands/project/commandSecurityEvaluate.d.ts +1 -0
- package/dist/cli/src/commands/project/commandSecurityEvaluate.js +26 -0
- package/dist/cli/src/commands/project/commandSecurityEvaluate.js.map +1 -0
- package/dist/cli/src/commands/project/commandSetup.d.ts +7 -0
- package/dist/cli/src/commands/project/commandSetup.js +24 -0
- package/dist/cli/src/commands/project/commandSetup.js.map +1 -0
- package/dist/cli/src/commands/project/commandTriggerCronjob.d.ts +25 -0
- package/dist/cli/src/commands/project/commandTriggerCronjob.js +95 -0
- package/dist/cli/src/commands/project/commandTriggerCronjob.js.map +1 -0
- package/dist/cli/src/completion.d.ts +23 -0
- package/dist/cli/src/completion.js +173 -0
- package/dist/cli/src/completion.js.map +1 -0
- package/dist/cli/src/config/getProjectConfig.d.ts +12 -8
- package/dist/cli/src/config/getProjectConfig.js +97 -95
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/config/parseChoice.d.ts +3 -3
- package/dist/cli/src/config/parseChoice.js +11 -6
- package/dist/cli/src/core/defineCommand.d.ts +27 -0
- package/dist/cli/src/core/defineCommand.js +35 -0
- package/dist/cli/src/core/defineCommand.js.map +1 -0
- package/dist/cli/src/core/index.d.ts +5 -0
- package/dist/cli/src/core/index.js +52 -0
- package/dist/cli/src/core/index.js.map +1 -0
- package/dist/cli/src/core/registry.d.ts +5 -0
- package/dist/cli/src/core/registry.js +26 -0
- package/dist/cli/src/core/registry.js.map +1 -0
- package/dist/cli/src/core/runner.d.ts +19 -0
- package/dist/cli/src/core/runner.js +29 -0
- package/dist/cli/src/core/runner.js.map +1 -0
- package/dist/cli/src/core/types.d.ts +100 -0
- package/dist/cli/src/core/types.js +17 -0
- package/dist/cli/src/core/types.js.map +1 -0
- package/dist/cli/src/gcloud/artifactsRegistry.d.ts +3 -3
- package/dist/cli/src/gcloud/artifactsRegistry.js +12 -11
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.d.ts +1 -1
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.js +23 -22
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.d.ts +2 -2
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js +19 -12
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/copyDb.d.ts +9 -9
- package/dist/cli/src/gcloud/cloudSql/copyDb.js +30 -16
- package/dist/cli/src/gcloud/cloudSql/copyDb.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.d.ts +9 -0
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.js +24 -0
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.js.map +1 -0
- package/dist/cli/src/gcloud/cloudSql/startProxy.d.ts +4 -4
- package/dist/cli/src/gcloud/cloudSql/startProxy.js +55 -39
- package/dist/cli/src/gcloud/enableServices.d.ts +2 -2
- package/dist/cli/src/gcloud/enableServices.js +8 -6
- package/dist/cli/src/gcloud/openDashboard.d.ts +2 -2
- package/dist/cli/src/gcloud/openDashboard.js +17 -13
- package/dist/cli/src/gcloud/openDashboard.js.map +1 -1
- package/dist/cli/src/gcloud/serviceAccounts.d.ts +8 -8
- package/dist/cli/src/gcloud/serviceAccounts.js +64 -58
- package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
- package/dist/cli/src/git/getGetMainBranch.d.ts +1 -1
- package/dist/cli/src/git/getGetMainBranch.js +9 -5
- package/dist/cli/src/git/gitConfig.d.ts +11 -6
- package/dist/cli/src/git/gitConfig.js +17 -11
- package/dist/cli/src/git/gitProjectInformation.d.ts +6 -6
- package/dist/cli/src/git/gitProjectInformation.js +30 -20
- package/dist/cli/src/git/index.d.ts +1 -1
- package/dist/cli/src/git/index.js +23 -16
- package/dist/cli/src/index.d.ts +1 -1
- package/dist/cli/src/index.js +4 -2
- package/dist/cli/src/k8sApi/index.d.ts +1 -1
- package/dist/cli/src/k8sApi/index.js +14 -12
- package/dist/cli/src/kubernetes/index.d.ts +1 -1
- package/dist/cli/src/kubernetes/index.js +24 -17
- package/dist/cli/src/kubernetes/openKubernetesDashboards.d.ts +3 -3
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js +35 -33
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
- package/dist/cli/src/kubernetes/portForward.d.ts +1 -1
- package/dist/cli/src/kubernetes/portForward.js +7 -5
- package/dist/cli/src/packageInfos.d.ts +1 -1
- package/dist/cli/src/packageInfos.js +5 -3
- package/dist/cli/src/types/types.d.ts +13 -13
- package/dist/cli/src/types/types.js +4 -2
- package/dist/cli/src/utils/boxWithAscii.d.ts +1 -1
- package/dist/cli/src/utils/boxWithAscii.js +12 -10
- package/dist/cli/src/utils/cluster.d.ts +1 -1
- package/dist/cli/src/utils/cluster.js +8 -6
- package/dist/cli/src/utils/editAsFile.d.ts +1 -1
- package/dist/cli/src/utils/editAsFile.js +25 -17
- package/dist/cli/src/utils/files.d.ts +1 -1
- package/dist/cli/src/utils/files.js +15 -12
- package/dist/cli/src/utils/getEditor.d.ts +2 -2
- package/dist/cli/src/utils/getEditor.js +20 -14
- package/dist/cli/src/utils/gitlab.d.ts +18 -18
- package/dist/cli/src/utils/gitlab.js +187 -174
- package/dist/cli/src/utils/gitlab.js.map +1 -1
- package/dist/cli/src/utils/log.d.ts +4 -4
- package/dist/cli/src/utils/log.js +18 -16
- package/dist/cli/src/utils/portForwards.d.ts +5 -5
- package/dist/cli/src/utils/portForwards.js +32 -31
- package/dist/cli/src/utils/preferences.d.ts +1 -1
- package/dist/cli/src/utils/preferences.js +43 -36
- package/dist/cli/src/utils/projects/index.d.ts +1 -1
- package/dist/cli/src/utils/projects/index.js +24 -21
- package/dist/cli/src/utils/promise.d.ts +1 -1
- package/dist/cli/src/utils/promise.js +8 -6
- package/dist/cli/src/utils/shell.d.ts +1 -1
- package/dist/cli/src/utils/shell.js +20 -19
- package/dist/pipeline/src/bash/BashExpression.d.ts +18 -18
- package/dist/pipeline/src/bash/BashExpression.js +44 -45
- package/dist/pipeline/src/bash/bashEscape.d.ts +6 -4
- package/dist/pipeline/src/bash/bashEscape.js +63 -73
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.d.ts +3 -5
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.js +7 -6
- package/dist/pipeline/src/bash/bashYaml.d.ts +1 -1
- package/dist/pipeline/src/bash/bashYaml.js +41 -46
- package/dist/pipeline/src/bash/getInjectVarsScript.d.ts +1 -1
- package/dist/pipeline/src/bash/getInjectVarsScript.js +11 -14
- package/dist/pipeline/src/bash/index.d.ts +1 -1
- package/dist/pipeline/src/bash/index.js +23 -16
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.d.ts +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +46 -41
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -1
- package/dist/pipeline/src/build/base/constants.d.ts +4 -4
- package/dist/pipeline/src/build/base/constants.js +8 -6
- package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +7 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js +37 -43
- package/dist/pipeline/src/build/base/createArtifactsConfig.d.ts +1 -1
- package/dist/pipeline/src/build/base/createArtifactsConfig.js +16 -25
- package/dist/pipeline/src/build/base/createBuildJobDefinition.d.ts +3 -3
- package/dist/pipeline/src/build/base/createBuildJobDefinition.js +16 -22
- package/dist/pipeline/src/build/base/createBuildJobDefinition.js.map +1 -1
- package/dist/pipeline/src/build/base/index.d.ts +4 -4
- package/dist/pipeline/src/build/base/index.js +15 -37
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/base/writeBuildInfo.d.ts +1 -1
- package/dist/pipeline/src/build/base/writeBuildInfo.js +7 -7
- package/dist/pipeline/src/build/base/writeDotEnv.d.ts +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +19 -21
- package/dist/pipeline/src/build/cache/createJobCache.d.ts +1 -1
- package/dist/pipeline/src/build/cache/createJobCache.js +47 -49
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.d.ts +1 -1
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +16 -23
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.d.ts +1 -1
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.js +14 -12
- package/dist/pipeline/src/build/custom/buildJob.d.ts +1 -1
- package/dist/pipeline/src/build/custom/buildJob.js +16 -16
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/index.d.ts +1 -1
- package/dist/pipeline/src/build/custom/index.js +7 -5
- package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
- package/dist/pipeline/src/build/custom/testJob.js +67 -59
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +50 -46
- package/dist/pipeline/src/build/docker.js +112 -123
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/index.d.ts +13 -17
- package/dist/pipeline/src/build/index.js +80 -72
- package/dist/pipeline/src/build/index.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.d.ts +1 -1
- package/dist/pipeline/src/build/node/buildJob.js +34 -37
- package/dist/pipeline/src/build/node/cache.d.ts +1 -1
- package/dist/pipeline/src/build/node/cache.js +34 -44
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/constants.d.ts +4 -4
- package/dist/pipeline/src/build/node/constants.js +8 -6
- package/dist/pipeline/src/build/node/index.d.ts +1 -1
- package/dist/pipeline/src/build/node/index.js +11 -9
- package/dist/pipeline/src/build/node/meteor.d.ts +1 -1
- package/dist/pipeline/src/build/node/meteor.js +52 -45
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.d.ts +1 -1
- package/dist/pipeline/src/build/node/testJob.js +71 -81
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.d.ts +3 -2
- package/dist/pipeline/src/build/node/yarn.js +33 -39
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.d.ts +1 -1
- package/dist/pipeline/src/build/rails/build.js +37 -43
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/index.d.ts +1 -1
- package/dist/pipeline/src/build/rails/index.js +8 -6
- package/dist/pipeline/src/build/rails/index.js.map +1 -1
- package/dist/pipeline/src/build/rails/{test.d.ts → testJob.d.ts} +1 -1
- package/dist/pipeline/src/build/rails/testJob.js +76 -0
- package/dist/pipeline/src/build/rails/testJob.js.map +1 -0
- package/dist/pipeline/src/build/types.d.ts +294 -265
- package/dist/pipeline/src/build/types.js +10 -10
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/catenv/index.d.ts +3 -3
- package/dist/pipeline/src/catenv/index.js +10 -8
- package/dist/pipeline/src/config/configruedEnvs.d.ts +1 -1
- package/dist/pipeline/src/config/configruedEnvs.js +18 -23
- package/dist/pipeline/src/config/index.d.ts +1 -1
- package/dist/pipeline/src/config/index.js +23 -16
- package/dist/pipeline/src/config/readConfig.d.ts +4 -4
- package/dist/pipeline/src/config/readConfig.js +45 -24
- package/dist/pipeline/src/config/readConfig.js.map +1 -1
- package/dist/pipeline/src/constants.d.ts +1 -1
- package/dist/pipeline/src/constants.js +6 -5
- package/dist/pipeline/src/context/createAllComponentsContext.d.ts +8 -4
- package/dist/pipeline/src/context/createAllComponentsContext.js +22 -16
- package/dist/pipeline/src/context/createComponentContext.d.ts +6 -6
- package/dist/pipeline/src/context/createComponentContext.js +87 -96
- package/dist/pipeline/src/context/createWorkspaceContext.d.ts +15 -8
- package/dist/pipeline/src/context/createWorkspaceContext.js +37 -28
- package/dist/pipeline/src/context/getBuildInfoVariables.d.ts +2 -2
- package/dist/pipeline/src/context/getBuildInfoVariables.js +22 -21
- package/dist/pipeline/src/context/getEnvConfig.d.ts +1 -1
- package/dist/pipeline/src/context/getEnvConfig.js +29 -28
- package/dist/pipeline/src/context/getEnvType.d.ts +2 -2
- package/dist/pipeline/src/context/getEnvType.js +10 -9
- package/dist/pipeline/src/context/getEnvironment.d.ts +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +20 -16
- package/dist/pipeline/src/context/getEnvironmentContext.d.ts +6 -1
- package/dist/pipeline/src/context/getEnvironmentContext.js +35 -28
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +11 -11
- package/dist/pipeline/src/context/getEnvironmentVariables.js +102 -95
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/getLabels.d.ts +7 -7
- package/dist/pipeline/src/context/getLabels.js +26 -25
- package/dist/pipeline/src/context/getReviewSlug.d.ts +1 -1
- package/dist/pipeline/src/context/getReviewSlug.js +12 -10
- package/dist/pipeline/src/context/index.d.ts +1 -1
- package/dist/pipeline/src/context/index.js +23 -16
- package/dist/pipeline/src/context/transformJobOnlyVars.d.ts +3 -3
- package/dist/pipeline/src/context/transformJobOnlyVars.js +21 -21
- package/dist/pipeline/src/context/utils/envVars.d.ts +3 -3
- package/dist/pipeline/src/context/utils/envVars.js +12 -12
- package/dist/pipeline/src/defaults/index.d.ts +1 -1
- package/dist/pipeline/src/defaults/index.js +6 -5
- package/dist/pipeline/src/defaults/index.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +75 -101
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/base/index.d.ts +4 -4
- package/dist/pipeline/src/deploy/base/index.js +6 -10
- package/dist/pipeline/src/deploy/base/rollback.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/rollback.js +30 -26
- package/dist/pipeline/src/deploy/base/stop.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/stop.js +30 -31
- package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
- package/dist/pipeline/src/deploy/base/variables.d.ts +4 -4
- package/dist/pipeline/src/deploy/base/variables.js +8 -6
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +55 -67
- package/dist/pipeline/src/deploy/cloudRun/cleanup.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js +16 -17
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js +44 -41
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +4 -4
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +58 -63
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +63 -72
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunWorkerPools.d.ts +4 -0
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunWorkerPools.js +52 -0
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunWorkerPools.js.map +1 -0
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.d.ts +7 -7
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js +33 -38
- package/dist/pipeline/src/deploy/cloudRun/createJobs/constants.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/constants.js +5 -3
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js +54 -61
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js +115 -118
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +11 -31
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +10 -22
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.d.ts +3 -3
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.js +36 -39
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js +36 -37
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js +19 -13
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.js +72 -76
- package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.d.ts +9 -5
- package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.js +13 -7
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.js +13 -17
- package/dist/pipeline/src/deploy/cloudRun/utils/database.d.ts +5 -5
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js +46 -79
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +6 -6
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.js +7 -9
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js +6 -4
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js +5 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +6 -4
- package/dist/pipeline/src/deploy/cloudSql/utils.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudSql/utils.js +7 -9
- package/dist/pipeline/src/deploy/custom/deployJob.d.ts +1 -1
- package/dist/pipeline/src/deploy/custom/deployJob.js +30 -39
- package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/custom/index.js +9 -7
- package/dist/pipeline/src/deploy/dockerTag/deployJob.d.ts +1 -1
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js +18 -22
- package/dist/pipeline/src/deploy/dockerTag/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/dockerTag/index.js +9 -7
- package/dist/pipeline/src/deploy/index.d.ts +6 -8
- package/dist/pipeline/src/deploy/index.js +27 -20
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.d.ts +5 -3
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js +25 -19
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +7 -7
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +36 -35
- package/dist/pipeline/src/deploy/kubernetes/deployJob.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +46 -67
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.js +54 -45
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +3 -3
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js +35 -34
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +84 -84
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +70 -63
- package/dist/pipeline/src/deploy/kubernetes/mongodb.d.ts +28 -24
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js +88 -89
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
- package/dist/pipeline/src/deploy/types/base.d.ts +27 -27
- package/dist/pipeline/src/deploy/types/base.js +4 -2
- package/dist/pipeline/src/deploy/types/custom.d.ts +25 -25
- package/dist/pipeline/src/deploy/types/custom.js +4 -2
- package/dist/pipeline/src/deploy/types/dockerTag.d.ts +10 -10
- package/dist/pipeline/src/deploy/types/dockerTag.js +4 -2
- package/dist/pipeline/src/deploy/types/executeBase.d.ts +24 -0
- package/dist/pipeline/src/deploy/types/executeBase.js +5 -0
- package/dist/pipeline/src/deploy/types/executeBase.js.map +1 -0
- package/dist/pipeline/src/deploy/types/googleCloudRun.d.ts +442 -389
- package/dist/pipeline/src/deploy/types/googleCloudRun.js +16 -14
- package/dist/pipeline/src/deploy/types/googleCloudRun.js.map +1 -1
- package/dist/pipeline/src/deploy/types/index.d.ts +6 -6
- package/dist/pipeline/src/deploy/types/index.js +27 -21
- package/dist/pipeline/src/deploy/types/kubernetes.d.ts +255 -255
- package/dist/pipeline/src/deploy/types/kubernetes.js +4 -2
- package/dist/pipeline/src/deploy/utils.d.ts +1 -1
- package/dist/pipeline/src/deploy/utils.js +23 -21
- package/dist/pipeline/src/globalScriptFunctions/index.d.ts +6 -6
- package/dist/pipeline/src/globalScriptFunctions/index.js +21 -19
- package/dist/pipeline/src/index.d.ts +2 -1
- package/dist/pipeline/src/index.js +24 -16
- package/dist/pipeline/src/index.js.map +1 -1
- package/dist/pipeline/src/pipeline/agent/createAgentContext.d.ts +19 -19
- package/dist/pipeline/src/pipeline/agent/createAgentContext.js +41 -37
- package/dist/pipeline/src/pipeline/agent/createAgentEventJob.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/createAgentEventJob.js +30 -31
- package/dist/pipeline/src/pipeline/agent/createAgentReviewJob.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/createAgentReviewJob.js +36 -43
- package/dist/pipeline/src/pipeline/agent/createAgentReviewJob.js.map +1 -1
- package/dist/pipeline/src/pipeline/agent/createJobsForAgentContext.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/createJobsForAgentContext.js +7 -5
- package/dist/pipeline/src/pipeline/agent/prompts.d.ts +2 -2
- package/dist/pipeline/src/pipeline/agent/prompts.js +32 -14
- package/dist/pipeline/src/pipeline/agent/shared.d.ts +6 -4
- package/dist/pipeline/src/pipeline/agent/shared.js +26 -25
- package/dist/pipeline/src/pipeline/agent/shared.js.map +1 -1
- package/dist/pipeline/src/pipeline/agent/utils.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/utils.js +11 -9
- package/dist/pipeline/src/pipeline/createAllJobs.d.ts +17 -13
- package/dist/pipeline/src/pipeline/createAllJobs.js +56 -44
- package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +28 -27
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js +8 -6
- package/dist/pipeline/src/pipeline/createMainPipeline.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createMainPipeline.js +85 -78
- package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +78 -58
- package/dist/pipeline/src/pipeline/getPipelineStages.d.ts +1 -1
- package/dist/pipeline/src/pipeline/getPipelineStages.js +8 -10
- package/dist/pipeline/src/pipeline/gitlab/cache.d.ts +9 -0
- package/dist/pipeline/src/pipeline/gitlab/cache.js +38 -0
- package/dist/pipeline/src/pipeline/gitlab/cache.js.map +1 -0
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.d.ts +4 -4
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +229 -241
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.d.ts +7 -2
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js +64 -59
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.d.ts +34 -32
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js +38 -46
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.d.ts +1 -1
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.js +10 -40
- package/dist/pipeline/src/pipeline/index.d.ts +1 -1
- package/dist/pipeline/src/pipeline/index.js +23 -16
- package/dist/pipeline/src/pipeline/packageManager.d.ts +1 -1
- package/dist/pipeline/src/pipeline/packageManager.js +47 -59
- package/dist/pipeline/src/rules/index.d.ts +1 -1
- package/dist/pipeline/src/rules/index.js +15 -13
- package/dist/pipeline/src/runner/index.d.ts +1 -1
- package/dist/pipeline/src/runner/index.js +6 -4
- package/dist/pipeline/src/types/agent.d.ts +15 -15
- package/dist/pipeline/src/types/agent.js +4 -2
- package/dist/pipeline/src/types/config.d.ts +152 -150
- package/dist/pipeline/src/types/config.js +24 -28
- package/dist/pipeline/src/types/context.d.ts +104 -104
- package/dist/pipeline/src/types/context.js +9 -7
- package/dist/pipeline/src/types/environmentContext.d.ts +25 -25
- package/dist/pipeline/src/types/environmentContext.js +4 -2
- package/dist/pipeline/src/types/gitlab-ci-yml.d.ts +497 -497
- package/dist/pipeline/src/types/gitlab-ci-yml.js +4 -2
- package/dist/pipeline/src/types/gitlab-types.d.ts +15 -15
- package/dist/pipeline/src/types/gitlab-types.js +4 -2
- package/dist/pipeline/src/types/hooks.d.ts +31 -22
- package/dist/pipeline/src/types/hooks.js +4 -2
- package/dist/pipeline/src/types/index.d.ts +1 -1
- package/dist/pipeline/src/types/index.js +23 -16
- package/dist/pipeline/src/types/jobDefinition.d.ts +3 -3
- package/dist/pipeline/src/types/jobDefinition.js +4 -2
- package/dist/pipeline/src/types/jobs.d.ts +93 -94
- package/dist/pipeline/src/types/jobs.js +5 -12
- package/dist/pipeline/src/types/pipeline.d.ts +1 -1
- package/dist/pipeline/src/types/pipeline.js +4 -2
- package/dist/pipeline/src/types/release.d.ts +6 -6
- package/dist/pipeline/src/types/release.js +4 -2
- package/dist/pipeline/src/types/utils.d.ts +1 -3
- package/dist/pipeline/src/types/utils.js +4 -2
- package/dist/pipeline/src/utils/gitlab.d.ts +2 -2
- package/dist/pipeline/src/utils/gitlab.js +12 -15
- package/dist/pipeline/src/utils/index.d.ts +1 -1
- package/dist/pipeline/src/utils/index.js +12 -9
- package/dist/pipeline/src/utils/jsonParse.d.ts +1 -1
- package/dist/pipeline/src/utils/jsonParse.js +11 -10
- package/dist/pipeline/src/utils/measureTime.d.ts +6 -0
- package/dist/pipeline/src/utils/measureTime.js +47 -0
- package/dist/pipeline/src/utils/measureTime.js.map +1 -0
- package/dist/pipeline/src/utils/removeUndefined.d.ts +1 -1
- package/dist/pipeline/src/utils/removeUndefined.js +6 -4
- package/dist/pipeline/src/utils/writeFiles.d.ts +11 -9
- package/dist/pipeline/src/utils/writeFiles.js +53 -47
- package/dist/pipeline/src/utils/writeFiles.js.map +1 -1
- package/dist/pipeline/src/variables/VariableValue.d.ts +1 -1
- package/dist/pipeline/src/variables/VariableValue.js +4 -2
- package/dist/pipeline/src/variables/VariableValueContainingReferences.d.ts +12 -12
- package/dist/pipeline/src/variables/VariableValueContainingReferences.js +45 -51
- package/dist/pipeline/src/variables/resolveAllReferences.d.ts +1 -1
- package/dist/pipeline/src/variables/resolveAllReferences.js +17 -18
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.d.ts +2 -2
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.js +14 -17
- package/dist/pipeline/src/variables/resolveReferencesOnce.d.ts +3 -3
- package/dist/pipeline/src/variables/resolveReferencesOnce.js +17 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -5
- package/src/adapters/baseContext.ts +55 -0
- package/src/adapters/programmatic.ts +88 -0
- package/src/adapters/terminal.ts +202 -0
- package/src/apps/catenv/catenv.ts +8 -2
- package/src/apps/catenv/verboseBanner.ts +33 -0
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +8 -33
- package/src/apps/cli/commands/project/setup/index.ts +2 -2
- package/src/apps/cli/commands/project/setup/logSection.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupAgents.ts +18 -18
- package/src/apps/cli/commands/project/setup/setupCloudRun.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupContext.ts +2 -5
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupTopic.ts +2 -2
- package/src/apps/cli/commands/project/utils/ensureCluster.ts +19 -12
- package/src/apps/cli/utils/getGoogleAuthUserNumber.ts +5 -4
- package/src/catenv.ts +6 -2
- package/src/cli.ts +192 -2
- package/src/commands/cloudSQL/commandRestoreDb.ts +105 -0
- package/src/commands/fun/commandDadjoke.ts +18 -0
- package/src/commands/fun/commandStarwars.ts +14 -0
- package/src/commands/general/commandKubeCurrentContext.ts +12 -0
- package/src/commands/general/commandKubeGetShell.ts +32 -0
- package/src/commands/general/commandKubeListNamespaces.ts +15 -0
- package/src/commands/general/commandKubeListPods.ts +21 -0
- package/src/commands/general/commandKubeListSecrets.ts +21 -0
- package/src/commands/general/commandKubePortForward.ts +35 -0
- package/src/commands/general/commandKubeStopPortforward.ts +15 -0
- package/src/commands/index.ts +46 -0
- package/src/commands/mongodb/commandMongoDestroyMember.ts +133 -0
- package/src/commands/mongodb/commandMongoGetShell.ts +36 -0
- package/src/commands/mongodb/commandMongoPortForward.ts +56 -0
- package/src/commands/project/commandCloudSqlProxy.ts +189 -0
- package/src/commands/project/commandConfigSecrets.ts +30 -0
- package/src/commands/project/commandDeletePods.ts +53 -0
- package/src/commands/project/commandDeleteProject.ts +33 -0
- package/src/commands/project/commandEnvVars.ts +24 -0
- package/src/commands/project/commandGetMyTotalWorktime.ts +14 -0
- package/src/commands/project/commandGetShell.ts +39 -0
- package/src/commands/project/commandGitlabCi.ts +122 -0
- package/src/commands/project/commandListPods.ts +30 -0
- package/src/commands/project/commandNamespace.ts +21 -0
- package/src/commands/project/commandOpenEnv.ts +27 -0
- package/src/commands/project/commandOpenGit.ts +12 -0
- package/src/commands/project/commandOpenLogs.ts +27 -0
- package/src/commands/project/commandPauseProject.ts +33 -0
- package/src/commands/project/commandPortForward.ts +74 -0
- package/src/commands/project/commandProjectRestoreDb.ts +201 -0
- package/src/commands/project/commandRenewToken.ts +12 -0
- package/src/commands/project/commandSecretsClearBackups.ts +19 -0
- package/src/commands/project/commandSecurityEvaluate.ts +22 -0
- package/src/commands/project/commandSetup.ts +16 -0
- package/src/commands/project/commandTriggerCronjob.ts +99 -0
- package/src/completion.ts +221 -0
- package/src/config/getProjectConfig.ts +11 -10
- package/src/core/defineCommand.ts +32 -0
- package/src/core/index.ts +23 -0
- package/src/core/registry.ts +22 -0
- package/src/core/runner.ts +31 -0
- package/src/core/types.ts +136 -0
- package/src/gcloud/cloudRun/openCloudRunDashboards.ts +2 -2
- package/src/gcloud/cloudSql/copyDb.ts +7 -3
- package/src/gcloud/cloudSql/parseConnectionString.ts +28 -0
- package/src/gcloud/openDashboard.ts +3 -3
- package/src/gcloud/serviceAccounts.ts +2 -2
- package/src/kubernetes/openKubernetesDashboards.ts +3 -3
- package/src/utils/gitlab.ts +46 -58
- package/src/utils/log.ts +2 -2
- package/dist/cli/src/apps/cli/cli.d.ts +0 -2
- package/dist/cli/src/apps/cli/cli.js +0 -39
- package/dist/cli/src/apps/cli/cli.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js +0 -111
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js +0 -10
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/general/index.d.ts +0 -4
- package/dist/cli/src/apps/cli/commands/general/index.js +0 -78
- package/dist/cli/src/apps/cli/commands/general/index.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js +0 -11
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/general/portForward.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/general/portForward.js +0 -40
- package/dist/cli/src/apps/cli/commands/general/portForward.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/mongodb/index.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/mongodb/index.js +0 -14
- package/dist/cli/src/apps/cli/commands/mongodb/index.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js +0 -94
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js +0 -36
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js +0 -57
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +0 -126
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +0 -121
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js +0 -47
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js +0 -28
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js +0 -13
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js +0 -11
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js +0 -34
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js +0 -86
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandListPods.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js +0 -19
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js +0 -11
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js +0 -20
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js +0 -9
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js +0 -14
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js +0 -28
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js +0 -80
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js +0 -9
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.d.ts +0 -5
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js +0 -24
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js +0 -19
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandSetup.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js +0 -11
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js +0 -56
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/index.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/project/index.js +0 -50
- package/dist/cli/src/apps/cli/commands/project/index.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.d.ts +0 -2
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js +0 -14
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js.map +0 -1
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +0 -3
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js +0 -35
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js.map +0 -1
- package/dist/cli/src/apps/cli/verify/index.d.ts +0 -2
- package/dist/cli/src/apps/cli/verify/index.js +0 -15
- package/dist/cli/src/apps/cli/verify/index.js.map +0 -1
- package/dist/pipeline/src/build/rails/test.js +0 -105
- package/dist/pipeline/src/build/rails/test.js.map +0 -1
- package/dist/pipeline/src/build/sbom.d.ts +0 -5
- package/dist/pipeline/src/build/sbom.js +0 -45
- package/dist/pipeline/src/build/sbom.js.map +0 -1
- package/dist/pipeline/src/deploy/sbom.d.ts +0 -4
- package/dist/pipeline/src/deploy/sbom.js +0 -30
- package/dist/pipeline/src/deploy/sbom.js.map +0 -1
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.d.ts +0 -5
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js +0 -51
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js.map +0 -1
- package/src/apps/cli/cli.ts +0 -43
- package/src/apps/cli/commands/cloudSQL/commandRestoreDb.ts +0 -136
- package/src/apps/cli/commands/cloudSQL/index.ts +0 -7
- package/src/apps/cli/commands/general/index.ts +0 -90
- package/src/apps/cli/commands/general/namespaceAutoCompletion.ts +0 -7
- package/src/apps/cli/commands/general/portForward.ts +0 -48
- package/src/apps/cli/commands/mongodb/index.ts +0 -10
- package/src/apps/cli/commands/mongodb/projectMongoDestroyMember.ts +0 -132
- package/src/apps/cli/commands/mongodb/projectMongoGetShell.ts +0 -42
- package/src/apps/cli/commands/mongodb/projectMongoPortForward.ts +0 -64
- package/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts +0 -181
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +0 -194
- package/src/apps/cli/commands/project/commandDeletePods.ts +0 -48
- package/src/apps/cli/commands/project/commandDeleteProject.ts +0 -33
- package/src/apps/cli/commands/project/commandEnvVars.ts +0 -18
- package/src/apps/cli/commands/project/commandGetMyTotalWorktime.ts +0 -14
- package/src/apps/cli/commands/project/commandGetShell.ts +0 -36
- package/src/apps/cli/commands/project/commandGitlabCi.ts +0 -115
- package/src/apps/cli/commands/project/commandListPods.ts +0 -20
- package/src/apps/cli/commands/project/commandNamespace.ts +0 -14
- package/src/apps/cli/commands/project/commandOpenEnv.ts +0 -22
- package/src/apps/cli/commands/project/commandOpenGit.ts +0 -12
- package/src/apps/cli/commands/project/commandOpenLogs.ts +0 -21
- package/src/apps/cli/commands/project/commandPauseProject.ts +0 -33
- package/src/apps/cli/commands/project/commandPortForward.ts +0 -91
- package/src/apps/cli/commands/project/commandRenewToken.ts +0 -12
- package/src/apps/cli/commands/project/commandSecretsClearBackups.ts +0 -26
- package/src/apps/cli/commands/project/commandSecurityEvaluate.ts +0 -26
- package/src/apps/cli/commands/project/commandSetup.ts +0 -14
- package/src/apps/cli/commands/project/commandTriggerCronjob.ts +0 -62
- package/src/apps/cli/commands/project/index.ts +0 -56
- package/src/apps/cli/commands/project/utils/showProjectBanner.ts +0 -11
- package/src/apps/cli/commands/theStuffThatReallyMatters/index.ts +0 -32
- package/src/apps/cli/verify/index.ts +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IO } from "../../../../../core/types";
|
|
2
2
|
import { doGitlabRequest, getProjectInfo } from "../../../../../utils/gitlab";
|
|
3
3
|
import { getProjectConfig } from "../../../../../config/getProjectConfig";
|
|
4
4
|
import { getGitRemoteHostAndPath } from "../../../../../git/gitProjectInformation";
|
|
@@ -60,14 +60,14 @@ type WebhookData = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const listTriggerTokens = async (
|
|
63
|
-
instance:
|
|
63
|
+
instance: IO,
|
|
64
64
|
projectId: string,
|
|
65
65
|
): Promise<TriggerToken[]> => {
|
|
66
66
|
return await doGitlabRequest(instance, `projects/${projectId}/triggers`);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const deleteTriggerToken = async (
|
|
70
|
-
instance:
|
|
70
|
+
instance: IO,
|
|
71
71
|
projectId: string,
|
|
72
72
|
triggerId: number,
|
|
73
73
|
): Promise<void> => {
|
|
@@ -80,7 +80,7 @@ const deleteTriggerToken = async (
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const createTriggerToken = async (
|
|
83
|
-
instance:
|
|
83
|
+
instance: IO,
|
|
84
84
|
projectId: string,
|
|
85
85
|
description: string,
|
|
86
86
|
): Promise<TriggerToken> => {
|
|
@@ -93,14 +93,14 @@ const createTriggerToken = async (
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
const listWebhooks = async (
|
|
96
|
-
instance:
|
|
96
|
+
instance: IO,
|
|
97
97
|
projectId: string,
|
|
98
98
|
): Promise<Webhook[]> => {
|
|
99
99
|
return await doGitlabRequest(instance, `projects/${projectId}/hooks`);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
const createWebhook = async (
|
|
103
|
-
instance:
|
|
103
|
+
instance: IO,
|
|
104
104
|
projectId: string,
|
|
105
105
|
webhookData: WebhookData,
|
|
106
106
|
): Promise<Webhook> => {
|
|
@@ -113,7 +113,7 @@ const createWebhook = async (
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
const updateWebhook = async (
|
|
116
|
-
instance:
|
|
116
|
+
instance: IO,
|
|
117
117
|
projectId: string,
|
|
118
118
|
hookId: number,
|
|
119
119
|
webhookData: WebhookData,
|
|
@@ -127,7 +127,7 @@ const updateWebhook = async (
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
const setupAgentWebhook = async (
|
|
130
|
-
instance:
|
|
130
|
+
instance: IO,
|
|
131
131
|
projectId: string,
|
|
132
132
|
agentName: string,
|
|
133
133
|
triggerToken: string,
|
|
@@ -181,13 +181,11 @@ const setupAgentWebhook = async (
|
|
|
181
181
|
merge_request_title: "{{merge_request.title}}",
|
|
182
182
|
merge_request_source_branch: "{{merge_request.source_branch}}",
|
|
183
183
|
merge_request_time_estimate: "{{merge_request.time_estimate}}",
|
|
184
|
-
|
|
185
|
-
//merge_request_description: "{{merge_request.description}}",
|
|
184
|
+
merge_request_description: "{{merge_request.description}}",
|
|
186
185
|
merge_request_merge_status: "{{merge_request.merge_status}}",
|
|
187
186
|
merge_request_last_commit_title: "{{merge_request.last_commit.title}}",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
// "{{merge_request.last_commit.message}}",
|
|
187
|
+
merge_request_last_commit_message:
|
|
188
|
+
"{{merge_request.last_commit.message}}",
|
|
191
189
|
merge_request_last_commit_author_name:
|
|
192
190
|
"{{merge_request.last_commit.author.name}}",
|
|
193
191
|
merge_request_last_commit_author_email:
|
|
@@ -233,7 +231,7 @@ const setupAgentWebhook = async (
|
|
|
233
231
|
};
|
|
234
232
|
|
|
235
233
|
const setupAgentTriggerToken = async (
|
|
236
|
-
instance:
|
|
234
|
+
instance: IO,
|
|
237
235
|
projectId: string,
|
|
238
236
|
agentName: string,
|
|
239
237
|
): Promise<TriggerToken> => {
|
|
@@ -268,7 +266,7 @@ const setupAgentTriggerToken = async (
|
|
|
268
266
|
};
|
|
269
267
|
|
|
270
268
|
const setupAgent = async (
|
|
271
|
-
instance:
|
|
269
|
+
instance: IO,
|
|
272
270
|
agentName: string,
|
|
273
271
|
agentConfig: AgentConfig,
|
|
274
272
|
) => {
|
|
@@ -289,7 +287,7 @@ const setupAgent = async (
|
|
|
289
287
|
instance.log(`✅ Agent ${agentName} setup complete!`);
|
|
290
288
|
};
|
|
291
289
|
|
|
292
|
-
export const setupAgents = async (instance:
|
|
290
|
+
export const setupAgents = async (instance: IO) => {
|
|
293
291
|
const config = await getProjectConfig();
|
|
294
292
|
|
|
295
293
|
instance.log("");
|
|
@@ -312,10 +310,12 @@ export const setupAgents = async (instance: CommandInstance) => {
|
|
|
312
310
|
instance.log("✅ All agents setup complete!");
|
|
313
311
|
instance.log("");
|
|
314
312
|
instance.log("🔧 Manual setup required:");
|
|
315
|
-
instance.log(
|
|
313
|
+
instance.log(
|
|
314
|
+
"Please configure these environment variables in GitLab CI/CD unless they are already set (by group or global):",
|
|
315
|
+
);
|
|
316
316
|
instance.log(" Go to Settings > CI/CD > Variables and add:");
|
|
317
317
|
instance.log(
|
|
318
|
-
" - ANTHROPIC_API_KEY (your Anthropic API key, mark as Protected & Masked)",
|
|
318
|
+
" - CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY (your Anthropic API key, mark as Protected & Masked)",
|
|
319
319
|
);
|
|
320
320
|
instance.log(
|
|
321
321
|
" - AGENT_GITLAB_PERSONAL_ACCESS_TOKEN (token from agent.claude user, mark as Protected & Masked)",
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isOfDeployType,
|
|
6
6
|
} from "@catladder/pipeline";
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { IO } from "../../../../../core/types";
|
|
9
9
|
import { upsertGcloudArtifactsRegistry } from "../../../../../gcloud/artifactsRegistry";
|
|
10
10
|
import { getCloudRunDomainSuffix } from "../../../../../gcloud/cloudRun/getCloudRunDomainSuffix";
|
|
11
11
|
import { enableGCloudServices } from "../../../../../gcloud/enableServices";
|
|
@@ -13,7 +13,7 @@ import { upsertGcloudServiceAccountAndSaveSecret } from "../../../../../gcloud/s
|
|
|
13
13
|
import { upsertAllVariables } from "../../../../../utils/gitlab";
|
|
14
14
|
|
|
15
15
|
export const setupCloudRun = async (
|
|
16
|
-
instance:
|
|
16
|
+
instance: IO,
|
|
17
17
|
context: ComponentContext,
|
|
18
18
|
) => {
|
|
19
19
|
if (!isOfDeployType(context.deploy?.config, "google-cloudrun")) {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import type { ComponentContext } from "@catladder/pipeline";
|
|
2
2
|
import { isOfDeployType } from "@catladder/pipeline";
|
|
3
|
-
import type {
|
|
3
|
+
import type { IO } from "../../../../../core/types";
|
|
4
4
|
import { setupCloudRun } from "./setupCloudRun";
|
|
5
5
|
|
|
6
6
|
import { setupKubernetes } from "./setupKubernetes";
|
|
7
7
|
import { logSection } from "./logSection";
|
|
8
8
|
|
|
9
|
-
export const setupContext = async (
|
|
10
|
-
instance: CommandInstance,
|
|
11
|
-
context: ComponentContext,
|
|
12
|
-
) => {
|
|
9
|
+
export const setupContext = async (instance: IO, context: ComponentContext) => {
|
|
13
10
|
await logSection(
|
|
14
11
|
instance,
|
|
15
12
|
"setting up " + context.env + ":" + context.name,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getFullKubernetesClusterName,
|
|
4
4
|
isOfDeployType,
|
|
5
5
|
} from "@catladder/pipeline";
|
|
6
|
-
import type {
|
|
6
|
+
import type { IO } from "../../../../../core/types";
|
|
7
7
|
import { exec } from "child-process-promise";
|
|
8
8
|
import { connectToCluster } from "../../../../../utils/cluster";
|
|
9
9
|
import {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import ensureNamespace from "../utils/ensureNamespace";
|
|
15
15
|
|
|
16
16
|
export const setupKubernetes = async (
|
|
17
|
-
instance:
|
|
17
|
+
instance: IO,
|
|
18
18
|
context: ComponentContext,
|
|
19
19
|
) => {
|
|
20
20
|
const deployConfig = context.deploy?.config;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IO } from "../../../../../core/types";
|
|
2
2
|
import { doGitlabRequest, getProjectInfo } from "../../../../../utils/gitlab";
|
|
3
3
|
|
|
4
4
|
const catladderTopic = "catladder";
|
|
5
5
|
|
|
6
|
-
export const setupTopic = async (instance:
|
|
6
|
+
export const setupTopic = async (instance: IO) => {
|
|
7
7
|
const { id: projectId } = await getProjectInfo(instance);
|
|
8
8
|
|
|
9
9
|
const { topics } = await doGitlabRequest(instance, `projects/${projectId}`);
|
|
@@ -10,7 +10,19 @@ import {
|
|
|
10
10
|
connectToCluster,
|
|
11
11
|
getCurrentConnectedClusterName,
|
|
12
12
|
} from "../../../../../utils/cluster";
|
|
13
|
-
|
|
13
|
+
import type { IO } from "../../../../../core/types";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Ensures the user is connected to the correct Kubernetes cluster for the given envComponent.
|
|
17
|
+
* If already connected, does nothing. If not, prompts for confirmation to switch (in interactive mode).
|
|
18
|
+
*
|
|
19
|
+
* Accepts an IO instance for logging and prompting.
|
|
20
|
+
* Also works with Vorpal's CommandInstance via .call(this, envComponent) for backward compatibility.
|
|
21
|
+
*/
|
|
22
|
+
export async function ensureCluster(
|
|
23
|
+
io: IO,
|
|
24
|
+
envComponent: string,
|
|
25
|
+
): Promise<void> {
|
|
14
26
|
const { env, componentName } = parseChoice(envComponent);
|
|
15
27
|
const context = await getPipelineContextByChoice(env, componentName);
|
|
16
28
|
if (!isOfDeployType(context.deploy?.config, "kubernetes")) {
|
|
@@ -20,21 +32,16 @@ export default async function (envComponent: string) {
|
|
|
20
32
|
const connectedClusterName = await getCurrentConnectedClusterName();
|
|
21
33
|
|
|
22
34
|
if (cluster !== connectedClusterName) {
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
io.log(`you are currently connected to cluster '${connectedClusterName}'`);
|
|
36
|
+
io.log(`but the project requires cluster '${cluster}'`);
|
|
37
|
+
const shouldContinue = await io.confirm(
|
|
38
|
+
`Do you want to connect to '${cluster}'?`,
|
|
25
39
|
);
|
|
26
|
-
this.log(`but the project requires cluster '${cluster}'`);
|
|
27
|
-
const { shouldContinue } = await this.prompt({
|
|
28
|
-
type: "confirm",
|
|
29
|
-
name: "shouldContinue",
|
|
30
|
-
default: true,
|
|
31
|
-
message: `Do you want to connect to '${cluster}'?`,
|
|
32
|
-
});
|
|
33
40
|
if (!shouldContinue) {
|
|
34
|
-
|
|
41
|
+
io.log("abort");
|
|
35
42
|
} else {
|
|
36
43
|
await connectToCluster(cluster);
|
|
37
|
-
|
|
44
|
+
io.log(`connected to cluster '${cluster}'`);
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IO } from "../../../core/types";
|
|
1
2
|
import {
|
|
2
3
|
getPreference,
|
|
3
4
|
hasPreference,
|
|
@@ -5,16 +6,16 @@ import {
|
|
|
5
6
|
} from "../../../utils/preferences";
|
|
6
7
|
|
|
7
8
|
const KEY = "googleAuthUserNumber";
|
|
8
|
-
export const getGoogleAuthUserNumber = async
|
|
9
|
+
export const getGoogleAuthUserNumber = async (io: IO) => {
|
|
9
10
|
if (!(await hasPreference(KEY))) {
|
|
10
|
-
|
|
11
|
+
io.log(
|
|
11
12
|
"Please type in your google auth user number (0 if you have only one google account or maybe 1 if you have multiple)",
|
|
12
13
|
);
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
+
const authUserNumber = await io.promptDirect({
|
|
15
16
|
type: "number",
|
|
16
17
|
name: "authUserNumber",
|
|
17
|
-
default:
|
|
18
|
+
default: 0,
|
|
18
19
|
message: "Auth user ",
|
|
19
20
|
});
|
|
20
21
|
await setPreference(KEY, authUserNumber);
|
package/src/catenv.ts
CHANGED
|
@@ -9,12 +9,16 @@ if (args.some((arg) => helpFlags.includes(arg))) {
|
|
|
9
9
|
const docLink =
|
|
10
10
|
"https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";
|
|
11
11
|
console.log(
|
|
12
|
-
`\nUsage: catenv [env|env:component]\n\nEnv variable and catenv documentation:\n${docLink}`,
|
|
12
|
+
`\nUsage: catenv [env|env:component] [-v|--verbose]\n\nEnv variable and catenv documentation:\n${docLink}`,
|
|
13
13
|
);
|
|
14
14
|
process.exit(0);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const verbose = args.some((arg) => arg === "-v" || arg === "--verbose");
|
|
18
|
+
// choise arg is deprecated and will be removed in the future
|
|
19
|
+
const choiceArg = args.find((arg) => arg !== "-v" && arg !== "--verbose");
|
|
20
|
+
|
|
21
|
+
catenv(choiceArg ? parseChoice(choiceArg) : null, { verbose }).then(() => {
|
|
18
22
|
// we have to exit manually, because we have some file watches
|
|
19
23
|
process.exit();
|
|
20
24
|
});
|
package/src/cli.ts
CHANGED
|
@@ -1,3 +1,193 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import packageInfos from "./packageInfos";
|
|
3
|
+
import { stopAllPortForwards } from "./utils/portForwards";
|
|
4
|
+
import { createTerminalContext } from "./adapters/terminal";
|
|
5
|
+
import type { CommandDef } from "./core/types";
|
|
6
|
+
import {
|
|
7
|
+
getCompletions,
|
|
8
|
+
generateZshCompletionScript,
|
|
9
|
+
installCompletions,
|
|
10
|
+
uninstallCompletions,
|
|
11
|
+
} from "./completion";
|
|
2
12
|
|
|
3
|
-
|
|
13
|
+
// Import all commands
|
|
14
|
+
import * as commands from "./commands";
|
|
15
|
+
|
|
16
|
+
const program = new Command();
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.name("catladder")
|
|
20
|
+
.description("Panter CLI tool for cloud CI/CD and DevOps")
|
|
21
|
+
.version(packageInfos.version)
|
|
22
|
+
.option("-y, --yes", "skip all confirmation prompts");
|
|
23
|
+
|
|
24
|
+
// Collect all command defs for completion
|
|
25
|
+
const allCommandDefs: CommandDef[] = [];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Register a CommandDef with Commander.js.
|
|
29
|
+
* - Inputs with `positional: true` become Commander positional args
|
|
30
|
+
* - Other inputs become optional --flags
|
|
31
|
+
* - --inputs accepts JSON for programmatic use
|
|
32
|
+
*/
|
|
33
|
+
function registerCommand(def: CommandDef): void {
|
|
34
|
+
allCommandDefs.push(def);
|
|
35
|
+
|
|
36
|
+
// Separate positional inputs from flag inputs
|
|
37
|
+
const positionalInputs: [string, (typeof def.inputs)[string]][] = [];
|
|
38
|
+
const flagInputs: [string, (typeof def.inputs)[string]][] = [];
|
|
39
|
+
|
|
40
|
+
for (const [name, inputDef] of Object.entries(def.inputs)) {
|
|
41
|
+
if (inputDef.positional) {
|
|
42
|
+
positionalInputs.push([name, inputDef]);
|
|
43
|
+
} else {
|
|
44
|
+
flagInputs.push([name, inputDef]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Build the command string with positional args.
|
|
49
|
+
// All positionals are registered as optional in Commander so that
|
|
50
|
+
// ctx.get() can prompt for them interactively when missing.
|
|
51
|
+
let cmdStr = def.name;
|
|
52
|
+
for (const [name] of positionalInputs) {
|
|
53
|
+
cmdStr += ` [${name}]`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const cmd = program.command(cmdStr).description(def.description);
|
|
57
|
+
|
|
58
|
+
// Add --flag for each non-positional input
|
|
59
|
+
for (const [name, inputDef] of flagInputs) {
|
|
60
|
+
const flagName = name.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
61
|
+
const desc = inputDef.message.replace(/\s*🤔\s*$/, "").trim();
|
|
62
|
+
if (inputDef.type === "boolean") {
|
|
63
|
+
cmd.option(`--${flagName}`, desc);
|
|
64
|
+
cmd.option(`--no-${flagName}`, `negate: ${desc}`);
|
|
65
|
+
} else {
|
|
66
|
+
cmd.option(`--${flagName} <value>`, desc);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Add --inputs for JSON input
|
|
71
|
+
cmd.option("--inputs <json>", "JSON object with input values");
|
|
72
|
+
|
|
73
|
+
cmd.action(async (...rawArgs: any[]) => {
|
|
74
|
+
// Commander passes positional args first, then options object, then the Command
|
|
75
|
+
const opts = rawArgs[rawArgs.length - 2];
|
|
76
|
+
|
|
77
|
+
// Parse positional args into cliOptions
|
|
78
|
+
const cliOptions: Record<string, unknown> = {};
|
|
79
|
+
positionalInputs.forEach(([name], i) => {
|
|
80
|
+
if (rawArgs[i] !== undefined) {
|
|
81
|
+
cliOptions[name] = rawArgs[i];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Parse CLI flag overrides
|
|
86
|
+
for (const [name, inputDef] of flagInputs) {
|
|
87
|
+
const flagName = name.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
88
|
+
const camelName = flagName.replace(/-([a-z])/g, (_, c) =>
|
|
89
|
+
c.toUpperCase(),
|
|
90
|
+
);
|
|
91
|
+
if (opts[camelName] !== undefined) {
|
|
92
|
+
let value = opts[camelName];
|
|
93
|
+
if (inputDef.type === "number" && typeof value === "string") {
|
|
94
|
+
value = Number(value);
|
|
95
|
+
}
|
|
96
|
+
cliOptions[name] = value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Parse --inputs JSON
|
|
101
|
+
let jsonInputs: Record<string, unknown> = {};
|
|
102
|
+
if (opts.inputs) {
|
|
103
|
+
try {
|
|
104
|
+
jsonInputs = JSON.parse(opts.inputs);
|
|
105
|
+
} catch {
|
|
106
|
+
console.error("Error: --inputs must be valid JSON");
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const ctx = createTerminalContext(def, {
|
|
112
|
+
cliOptions,
|
|
113
|
+
jsonInputs,
|
|
114
|
+
yes: program.opts().yes,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
await def.execute(ctx);
|
|
119
|
+
} catch (err: any) {
|
|
120
|
+
if (err.name === "MissingInputError") {
|
|
121
|
+
console.error(`\n${err.message}\n`);
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Register all commands
|
|
130
|
+
for (const cmd of Object.values(commands)) {
|
|
131
|
+
if (cmd && typeof cmd === "object" && "name" in cmd && "execute" in cmd) {
|
|
132
|
+
registerCommand(cmd as CommandDef);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Hidden __complete command for shell completion
|
|
137
|
+
program
|
|
138
|
+
.command("__complete", { hidden: true })
|
|
139
|
+
.argument("[words]", "words typed so far")
|
|
140
|
+
.argument("[cursor]", "word at cursor")
|
|
141
|
+
.action(async (wordsStr: string | undefined, cursor: string | undefined) => {
|
|
142
|
+
const words = wordsStr ? wordsStr.split(" ").filter(Boolean) : [];
|
|
143
|
+
const cursorWord = cursor ?? "";
|
|
144
|
+
try {
|
|
145
|
+
const completions = await getCompletions(
|
|
146
|
+
allCommandDefs,
|
|
147
|
+
words,
|
|
148
|
+
cursorWord,
|
|
149
|
+
);
|
|
150
|
+
for (const c of completions) {
|
|
151
|
+
console.log(c);
|
|
152
|
+
}
|
|
153
|
+
} catch {
|
|
154
|
+
// Silently fail -- completion should never break the shell
|
|
155
|
+
}
|
|
156
|
+
process.exit(0);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// completion commands
|
|
160
|
+
const completionCmd = program
|
|
161
|
+
.command("completion")
|
|
162
|
+
.description("shell completion setup");
|
|
163
|
+
|
|
164
|
+
completionCmd
|
|
165
|
+
.command("zsh")
|
|
166
|
+
.description("output zsh completion script")
|
|
167
|
+
.action(() => {
|
|
168
|
+
const binaryName = process.argv[1].split("/").pop() ?? "catladder";
|
|
169
|
+
console.log(generateZshCompletionScript(binaryName));
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
completionCmd
|
|
173
|
+
.command("install")
|
|
174
|
+
.description("install shell completions into your .zshrc")
|
|
175
|
+
.action(async () => {
|
|
176
|
+
const binaryName = process.argv[1].split("/").pop() ?? "catladder";
|
|
177
|
+
await installCompletions(binaryName);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
completionCmd
|
|
181
|
+
.command("uninstall")
|
|
182
|
+
.description("remove shell completions from your .zshrc")
|
|
183
|
+
.action(async () => {
|
|
184
|
+
const binaryName = process.argv[1].split("/").pop() ?? "catladder";
|
|
185
|
+
await uninstallCompletions(binaryName);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Cleanup on exit
|
|
189
|
+
process.on("exit", () => {
|
|
190
|
+
stopAllPortForwards();
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
program.parse();
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineCommand } from "../../core/defineCommand";
|
|
2
|
+
import { spawnCopyDb } from "../../gcloud/cloudSql/copyDb";
|
|
3
|
+
import type { CloudSqlBackgroundProxy } from "../../gcloud/cloudSql/startProxy";
|
|
4
|
+
import { startCloudSqlProxyInBackground } from "../../gcloud/cloudSql/startProxy";
|
|
5
|
+
|
|
6
|
+
export const commandRestoreDb = defineCommand({
|
|
7
|
+
name: "cloud-sql-restore-db",
|
|
8
|
+
description: "restore a db from one source to another target",
|
|
9
|
+
group: "cloudSQL",
|
|
10
|
+
inputs: {
|
|
11
|
+
sourceInstance: {
|
|
12
|
+
type: "string",
|
|
13
|
+
message: "Source instance (connection string or 'local')? 🤔 ",
|
|
14
|
+
},
|
|
15
|
+
sourceLocalPort: {
|
|
16
|
+
type: "number",
|
|
17
|
+
message: "Local Port for source? 🤔 ",
|
|
18
|
+
default: 5432,
|
|
19
|
+
},
|
|
20
|
+
sourceUsername: {
|
|
21
|
+
type: "string",
|
|
22
|
+
message: "Source Username? 🤔 ",
|
|
23
|
+
default: "postgres",
|
|
24
|
+
},
|
|
25
|
+
sourcePassword: { type: "string", message: "Source Password? 🤔 " },
|
|
26
|
+
sourceDbName: { type: "string", message: "Source DB name? 🤔 " },
|
|
27
|
+
targetInstance: {
|
|
28
|
+
type: "string",
|
|
29
|
+
message: "Target INSTANCE (connection string or 'local')? 🤔 ",
|
|
30
|
+
},
|
|
31
|
+
targetLocalPort: {
|
|
32
|
+
type: "number",
|
|
33
|
+
message: "Local Port for target? 🤔 ",
|
|
34
|
+
default: 5432,
|
|
35
|
+
},
|
|
36
|
+
targetUsername: {
|
|
37
|
+
type: "string",
|
|
38
|
+
message: "Target Username? 🤔 ",
|
|
39
|
+
default: "postgres",
|
|
40
|
+
},
|
|
41
|
+
targetPassword: { type: "string", message: "Target Password? 🤔 " },
|
|
42
|
+
targetDbName: { type: "string", message: "Target DB name? 🤔 " },
|
|
43
|
+
},
|
|
44
|
+
execute: async (ctx) => {
|
|
45
|
+
const sourceInstance = await ctx.get("sourceInstance");
|
|
46
|
+
|
|
47
|
+
let sourceProxy: CloudSqlBackgroundProxy;
|
|
48
|
+
let targetProxy: CloudSqlBackgroundProxy;
|
|
49
|
+
let sourcePort: number;
|
|
50
|
+
let targetPort: number;
|
|
51
|
+
|
|
52
|
+
if (sourceInstance === "local") {
|
|
53
|
+
sourcePort = await ctx.get("sourceLocalPort");
|
|
54
|
+
} else {
|
|
55
|
+
sourcePort = 54399;
|
|
56
|
+
sourceProxy = await startCloudSqlProxyInBackground({
|
|
57
|
+
instanceName: sourceInstance,
|
|
58
|
+
localPort: sourcePort,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const sourceUsername = await ctx.get("sourceUsername");
|
|
63
|
+
const sourcePassword = await ctx.get("sourcePassword");
|
|
64
|
+
const sourceDbName = await ctx.get("sourceDbName");
|
|
65
|
+
|
|
66
|
+
const targetInstance = await ctx.get("targetInstance");
|
|
67
|
+
|
|
68
|
+
if (targetInstance === "local") {
|
|
69
|
+
targetPort = await ctx.get("targetLocalPort");
|
|
70
|
+
} else {
|
|
71
|
+
targetPort = 54499;
|
|
72
|
+
targetProxy = await startCloudSqlProxyInBackground({
|
|
73
|
+
instanceName: targetInstance,
|
|
74
|
+
localPort: targetPort,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const targetUsername = await ctx.get("targetUsername");
|
|
79
|
+
const targetPassword = await ctx.get("targetPassword");
|
|
80
|
+
const targetDbName = await ctx.get("targetDbName");
|
|
81
|
+
|
|
82
|
+
const shouldContinue = await ctx.confirm(
|
|
83
|
+
`This will drop ${targetInstance}/${targetDbName} and replace it with ${sourceInstance}/${sourceDbName}. Continue? 🤔 `,
|
|
84
|
+
);
|
|
85
|
+
if (!shouldContinue) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
await spawnCopyDb({
|
|
91
|
+
targetPassword,
|
|
92
|
+
targetPort,
|
|
93
|
+
targetUsername,
|
|
94
|
+
sourceUsername,
|
|
95
|
+
sourcePassword,
|
|
96
|
+
sourcePort,
|
|
97
|
+
sourceDbName,
|
|
98
|
+
targetDbName,
|
|
99
|
+
});
|
|
100
|
+
} finally {
|
|
101
|
+
sourceProxy?.stop();
|
|
102
|
+
targetProxy?.stop();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fetch from "node-fetch";
|
|
2
|
+
import { defineCommand } from "../../core/defineCommand";
|
|
3
|
+
|
|
4
|
+
export const commandDadjoke = defineCommand({
|
|
5
|
+
name: "dadjoke",
|
|
6
|
+
description: "something for jonas.",
|
|
7
|
+
group: "fun",
|
|
8
|
+
inputs: {},
|
|
9
|
+
execute: async (ctx) => {
|
|
10
|
+
const result = await fetch("https://icanhazdadjoke.com/", {
|
|
11
|
+
headers: { Accept: "text/plain" },
|
|
12
|
+
});
|
|
13
|
+
const text = await result.text();
|
|
14
|
+
ctx.log("");
|
|
15
|
+
ctx.log(text);
|
|
16
|
+
ctx.log("");
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { spawn } from "child-process-promise";
|
|
2
|
+
import { defineCommand } from "../../core/defineCommand";
|
|
3
|
+
|
|
4
|
+
export const commandStarwars = defineCommand({
|
|
5
|
+
name: "starwars",
|
|
6
|
+
description: "Long time ago... in a galaxy far far away...",
|
|
7
|
+
group: "fun",
|
|
8
|
+
inputs: {},
|
|
9
|
+
execute: async () => {
|
|
10
|
+
await spawn("nc", ["towel.blinkenlights.nl", "23"], {
|
|
11
|
+
stdio: ["pipe", "inherit", "pipe"],
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineCommand } from "../../core/defineCommand";
|
|
2
|
+
import { getCurrentContext } from "../../utils/cluster";
|
|
3
|
+
|
|
4
|
+
export const commandKubeCurrentContext = defineCommand({
|
|
5
|
+
name: "kube-current-context",
|
|
6
|
+
description: "show current kubernetes context",
|
|
7
|
+
group: "general",
|
|
8
|
+
inputs: {},
|
|
9
|
+
execute: async (ctx) => {
|
|
10
|
+
ctx.log(await getCurrentContext());
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineCommand } from "../../core/defineCommand";
|
|
2
|
+
import { getk8sApi } from "../../k8sApi";
|
|
3
|
+
|
|
4
|
+
import { getShell } from "../../utils/shell";
|
|
5
|
+
|
|
6
|
+
export const commandKubeGetShell = defineCommand({
|
|
7
|
+
name: "kube-get-shell",
|
|
8
|
+
description: "get a shell to a pod in the environment",
|
|
9
|
+
group: "general",
|
|
10
|
+
inputs: {
|
|
11
|
+
namespace: {
|
|
12
|
+
type: "string",
|
|
13
|
+
message: "kubernetes namespace",
|
|
14
|
+
positional: true,
|
|
15
|
+
},
|
|
16
|
+
podName: {
|
|
17
|
+
type: "string",
|
|
18
|
+
message: "Which pod? 🤔",
|
|
19
|
+
choices: async (ctx) => {
|
|
20
|
+
const namespace = await ctx.get("namespace");
|
|
21
|
+
const k8sApi = getk8sApi();
|
|
22
|
+
const res = await k8sApi.listNamespacedPod(namespace);
|
|
23
|
+
return res.body.items.map((i: any) => i.metadata.name);
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
execute: async (ctx) => {
|
|
28
|
+
const namespace = await ctx.get("namespace");
|
|
29
|
+
const podName = await ctx.get("podName");
|
|
30
|
+
await getShell(namespace, podName);
|
|
31
|
+
},
|
|
32
|
+
});
|