@catladder/cli 0.0.0-main-e126076c → 0.0.0-main-4888e4df

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.
Files changed (132) hide show
  1. package/bin/catenv +1 -2
  2. package/bin/catladder +1 -2
  3. package/dist/bundles/catenv/index.js +31 -42
  4. package/dist/bundles/catenv/index.js.map +1 -0
  5. package/dist/bundles/catenv/sourcemap-register.js +1 -0
  6. package/dist/bundles/cli/index.js +478 -400
  7. package/dist/bundles/cli/index.js.map +1 -0
  8. package/dist/bundles/cli/sourcemap-register.js +1 -0
  9. package/dist/cli/src/cli.js +21 -7
  10. package/dist/cli/src/cli.js.map +1 -1
  11. package/dist/cli/src/commands/availability.d.ts +5 -0
  12. package/dist/cli/src/commands/availability.js +26 -0
  13. package/dist/cli/src/commands/availability.js.map +1 -0
  14. package/dist/cli/src/commands/general/commandKubeCurrentContext.js +1 -1
  15. package/dist/cli/src/commands/general/commandKubeCurrentContext.js.map +1 -1
  16. package/dist/cli/src/commands/general/commandKubeGetShell.js +1 -1
  17. package/dist/cli/src/commands/general/commandKubeGetShell.js.map +1 -1
  18. package/dist/cli/src/commands/general/commandKubeListNamespaces.js +1 -1
  19. package/dist/cli/src/commands/general/commandKubeListNamespaces.js.map +1 -1
  20. package/dist/cli/src/commands/general/commandKubeListPods.js +1 -1
  21. package/dist/cli/src/commands/general/commandKubeListPods.js.map +1 -1
  22. package/dist/cli/src/commands/general/commandKubeListSecrets.js +1 -1
  23. package/dist/cli/src/commands/general/commandKubeListSecrets.js.map +1 -1
  24. package/dist/cli/src/commands/general/commandKubePortForward.js +1 -1
  25. package/dist/cli/src/commands/general/commandKubePortForward.js.map +1 -1
  26. package/dist/cli/src/commands/general/commandKubeStopPortforward.js +1 -1
  27. package/dist/cli/src/commands/general/commandKubeStopPortforward.js.map +1 -1
  28. package/dist/cli/src/commands/index.d.ts +9 -8
  29. package/dist/cli/src/commands/index.js +57 -55
  30. package/dist/cli/src/commands/index.js.map +1 -1
  31. package/dist/cli/src/commands/mongodb/commandMongoDestroyMember.js +2 -0
  32. package/dist/cli/src/commands/mongodb/commandMongoDestroyMember.js.map +1 -1
  33. package/dist/cli/src/commands/mongodb/commandMongoGetShell.js +2 -0
  34. package/dist/cli/src/commands/mongodb/commandMongoGetShell.js.map +1 -1
  35. package/dist/cli/src/commands/mongodb/commandMongoPortForward.js +2 -0
  36. package/dist/cli/src/commands/mongodb/commandMongoPortForward.js.map +1 -1
  37. package/dist/cli/src/commands/project/commandCloudSqlProxy.js +2 -0
  38. package/dist/cli/src/commands/project/commandCloudSqlProxy.js.map +1 -1
  39. package/dist/cli/src/commands/project/commandOpenLogs.js +18 -3
  40. package/dist/cli/src/commands/project/commandOpenLogs.js.map +1 -1
  41. package/dist/cli/src/commands/project/commandPortForward.js +2 -0
  42. package/dist/cli/src/commands/project/commandPortForward.js.map +1 -1
  43. package/dist/cli/src/commands/project/commandProjectRestoreDb.js +5 -3
  44. package/dist/cli/src/commands/project/commandProjectRestoreDb.js.map +1 -1
  45. package/dist/cli/src/commands/project/{commandDeletePods.d.ts → k8s/commandDeletePods.d.ts} +1 -1
  46. package/dist/cli/src/commands/project/{commandDeletePods.js → k8s/commandDeletePods.js} +9 -7
  47. package/dist/cli/src/commands/project/k8s/commandDeletePods.js.map +1 -0
  48. package/dist/cli/src/commands/project/{commandDeleteProject.d.ts → k8s/commandDeleteProject.d.ts} +1 -1
  49. package/dist/cli/src/commands/project/{commandDeleteProject.js → k8s/commandDeleteProject.js} +6 -4
  50. package/dist/cli/src/commands/project/k8s/commandDeleteProject.js.map +1 -0
  51. package/dist/cli/src/commands/project/{commandGetShell.d.ts → k8s/commandGetShell.d.ts} +1 -1
  52. package/dist/cli/src/commands/project/{commandGetShell.js → k8s/commandGetShell.js} +9 -7
  53. package/dist/cli/src/commands/project/k8s/commandGetShell.js.map +1 -0
  54. package/dist/cli/src/commands/project/{commandListPods.d.ts → k8s/commandListPods.d.ts} +1 -1
  55. package/dist/cli/src/commands/project/{commandListPods.js → k8s/commandListPods.js} +7 -5
  56. package/dist/cli/src/commands/project/k8s/commandListPods.js.map +1 -0
  57. package/dist/cli/src/commands/project/{commandPauseProject.d.ts → k8s/commandNamespace.d.ts} +1 -1
  58. package/dist/cli/src/commands/project/{commandNamespace.js → k8s/commandNamespace.js} +6 -4
  59. package/dist/cli/src/commands/project/k8s/commandNamespace.js.map +1 -0
  60. package/dist/cli/src/commands/project/{commandNamespace.d.ts → k8s/commandPauseProject.d.ts} +1 -1
  61. package/dist/cli/src/commands/project/{commandPauseProject.js → k8s/commandPauseProject.js} +6 -4
  62. package/dist/cli/src/commands/project/{commandPauseProject.js.map → k8s/commandPauseProject.js.map} +1 -1
  63. package/dist/cli/src/commands/project/{commandTriggerCronjob.d.ts → k8s/commandTriggerCronjob.d.ts} +2 -2
  64. package/dist/cli/src/commands/project/{commandTriggerCronjob.js → k8s/commandTriggerCronjob.js} +10 -8
  65. package/dist/cli/src/commands/project/k8s/commandTriggerCronjob.js.map +1 -0
  66. package/dist/cli/src/config/getProjectConfig.js +3 -15
  67. package/dist/cli/src/config/getProjectConfig.js.map +1 -1
  68. package/dist/cli/src/core/types.d.ts +2 -0
  69. package/dist/cli/src/core/types.js +0 -1
  70. package/dist/cli/src/core/types.js.map +1 -1
  71. package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.d.ts +1 -1
  72. package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +8 -8
  73. package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -1
  74. package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +1 -1
  75. package/dist/pipeline/src/build/base/createAppBuildJob.js +2 -2
  76. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  77. package/dist/pipeline/src/build/base/index.d.ts +2 -2
  78. package/dist/pipeline/src/build/base/index.js +4 -4
  79. package/dist/pipeline/src/build/base/index.js.map +1 -1
  80. package/dist/pipeline/src/build/custom/buildJob.d.ts +1 -1
  81. package/dist/pipeline/src/build/custom/buildJob.js +1 -1
  82. package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
  83. package/dist/pipeline/src/build/custom/index.d.ts +1 -1
  84. package/dist/pipeline/src/build/custom/index.js +2 -2
  85. package/dist/pipeline/src/build/custom/index.js.map +1 -1
  86. package/dist/pipeline/src/build/rails/build.d.ts +1 -1
  87. package/dist/pipeline/src/build/rails/build.js +1 -1
  88. package/dist/pipeline/src/build/rails/build.js.map +1 -1
  89. package/dist/pipeline/src/build/rails/index.d.ts +1 -1
  90. package/dist/pipeline/src/build/rails/index.js +2 -2
  91. package/dist/pipeline/src/build/rails/index.js.map +1 -1
  92. package/dist/pipeline/src/constants.js +1 -1
  93. package/dist/pipeline/src/context/createComponentContext.js +3 -3
  94. package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
  95. package/dist/pipeline/src/context/createWorkspaceContext.js +1 -1
  96. package/dist/pipeline/src/context/createWorkspaceContext.js.map +1 -1
  97. package/dist/pipeline/src/types/context.d.ts +1 -1
  98. package/dist/tsconfig.tsbuildinfo +1 -1
  99. package/package.json +1 -1
  100. package/scripts/bundle +2 -2
  101. package/src/cli.ts +25 -9
  102. package/src/commands/availability.ts +22 -0
  103. package/src/commands/general/commandKubeCurrentContext.ts +1 -1
  104. package/src/commands/general/commandKubeGetShell.ts +1 -1
  105. package/src/commands/general/commandKubeListNamespaces.ts +1 -1
  106. package/src/commands/general/commandKubeListPods.ts +1 -1
  107. package/src/commands/general/commandKubeListSecrets.ts +1 -1
  108. package/src/commands/general/commandKubePortForward.ts +1 -1
  109. package/src/commands/general/commandKubeStopPortforward.ts +1 -1
  110. package/src/commands/index.ts +11 -11
  111. package/src/commands/mongodb/commandMongoDestroyMember.ts +2 -0
  112. package/src/commands/mongodb/commandMongoGetShell.ts +2 -0
  113. package/src/commands/mongodb/commandMongoPortForward.ts +2 -0
  114. package/src/commands/project/commandCloudSqlProxy.ts +2 -0
  115. package/src/commands/project/commandOpenLogs.ts +22 -3
  116. package/src/commands/project/commandPortForward.ts +2 -0
  117. package/src/commands/project/commandProjectRestoreDb.ts +5 -3
  118. package/src/commands/project/{commandDeletePods.ts → k8s/commandDeletePods.ts} +10 -8
  119. package/src/commands/project/{commandDeleteProject.ts → k8s/commandDeleteProject.ts} +6 -4
  120. package/src/commands/project/{commandGetShell.ts → k8s/commandGetShell.ts} +9 -7
  121. package/src/commands/project/{commandListPods.ts → k8s/commandListPods.ts} +7 -5
  122. package/src/commands/project/{commandNamespace.ts → k8s/commandNamespace.ts} +6 -4
  123. package/src/commands/project/{commandPauseProject.ts → k8s/commandPauseProject.ts} +6 -4
  124. package/src/commands/project/{commandTriggerCronjob.ts → k8s/commandTriggerCronjob.ts} +10 -8
  125. package/src/config/getProjectConfig.ts +3 -13
  126. package/src/core/types.ts +3 -0
  127. package/dist/cli/src/commands/project/commandDeletePods.js.map +0 -1
  128. package/dist/cli/src/commands/project/commandDeleteProject.js.map +0 -1
  129. package/dist/cli/src/commands/project/commandGetShell.js.map +0 -1
  130. package/dist/cli/src/commands/project/commandListPods.js.map +0 -1
  131. package/dist/cli/src/commands/project/commandNamespace.js.map +0 -1
  132. package/dist/cli/src/commands/project/commandTriggerCronjob.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /******/ (() => { // webpackBootstrap
1
+ require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
4
  /***/ 48618:
@@ -1221,10 +1221,11 @@ Object.defineProperty(exports, "__esModule", ({
1221
1221
  value: true
1222
1222
  }));
1223
1223
  const commander_1 = __nccwpck_require__(70395);
1224
- const packageInfos_1 = __importDefault(__nccwpck_require__(53568));
1225
- const portForwards_1 = __nccwpck_require__(77090);
1226
1224
  const terminal_1 = __nccwpck_require__(87396);
1227
1225
  const completion_1 = __nccwpck_require__(99407);
1226
+ const getProjectConfig_1 = __nccwpck_require__(50001);
1227
+ const packageInfos_1 = __importDefault(__nccwpck_require__(53568));
1228
+ const portForwards_1 = __nccwpck_require__(77090);
1228
1229
  // Import all commands
1229
1230
  const commands = __importStar(__nccwpck_require__(82432));
1230
1231
  const program = new commander_1.Command();
@@ -1337,10 +1338,23 @@ function registerCommand(def) {
1337
1338
  }
1338
1339
  });
1339
1340
  }
1340
- // Register all commands
1341
- for (const cmd of Object.values(commands)) {
1342
- if (cmd && typeof cmd === "object" && "name" in cmd && "execute" in cmd) {
1343
- registerCommand(cmd);
1341
+ // Register all commands (async to support isAvailable checks)
1342
+ async function registerAllCommands() {
1343
+ // Fetch contexts once for all isAvailable checks
1344
+ let contexts = [];
1345
+ try {
1346
+ contexts = await (0, getProjectConfig_1.getAllPipelineContexts)();
1347
+ } catch (_a) {
1348
+ // No config available (e.g. outside a project) — contexts stays empty
1349
+ }
1350
+ for (const cmd of Object.values(commands)) {
1351
+ if (cmd && typeof cmd === "object" && "name" in cmd && "execute" in cmd) {
1352
+ const def = cmd;
1353
+ if (def.isAvailable) {
1354
+ if (!def.isAvailable(contexts)) continue;
1355
+ }
1356
+ registerCommand(def);
1357
+ }
1344
1358
  }
1345
1359
  }
1346
1360
  // Hidden __complete command for shell completion
@@ -1374,7 +1388,40 @@ completionCmd.command("uninstall").description("remove shell completions from yo
1374
1388
  process.on("exit", () => {
1375
1389
  (0, portForwards_1.stopAllPortForwards)();
1376
1390
  });
1377
- program.parse();
1391
+ registerAllCommands().then(() => program.parse());
1392
+
1393
+ /***/ }),
1394
+
1395
+ /***/ 1377:
1396
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1397
+
1398
+ "use strict";
1399
+
1400
+
1401
+ Object.defineProperty(exports, "__esModule", ({
1402
+ value: true
1403
+ }));
1404
+ exports.hasCloudSql = exports.hasDeployType = void 0;
1405
+ const pipeline_1 = __nccwpck_require__(60241);
1406
+ /** Returns an isAvailable function that checks if ANY component uses one of the given deploy types */
1407
+ function hasDeployType(...types) {
1408
+ return contexts => contexts.some(ctx => {
1409
+ var _a;
1410
+ return (0, pipeline_1.isOfDeployType)((_a = ctx.deploy) === null || _a === void 0 ? void 0 : _a.config, ...types);
1411
+ });
1412
+ }
1413
+ exports.hasDeployType = hasDeployType;
1414
+ /** Returns an isAvailable function that checks if ANY component has cloudSql configured */
1415
+ function hasCloudSql() {
1416
+ return contexts => contexts.some(ctx => {
1417
+ var _a, _b, _c;
1418
+ const cfg = (_a = ctx.deploy) === null || _a === void 0 ? void 0 : _a.config;
1419
+ if ((0, pipeline_1.isOfDeployType)(cfg, "google-cloudrun")) return !!cfg.cloudSql;
1420
+ if ((0, pipeline_1.isOfDeployType)(cfg, "kubernetes")) return !!((_c = (_b = cfg.values) === null || _b === void 0 ? void 0 : _b.cloudsql) === null || _c === void 0 ? void 0 : _c.enabled);
1421
+ return false;
1422
+ });
1423
+ }
1424
+ exports.hasCloudSql = hasCloudSql;
1378
1425
 
1379
1426
  /***/ }),
1380
1427
 
@@ -1572,7 +1619,7 @@ exports.commandKubeCurrentContext = void 0;
1572
1619
  const defineCommand_1 = __nccwpck_require__(39489);
1573
1620
  const cluster_1 = __nccwpck_require__(5581);
1574
1621
  exports.commandKubeCurrentContext = (0, defineCommand_1.defineCommand)({
1575
- name: "kube current-context",
1622
+ name: "k8s current-context",
1576
1623
  description: "show current kubernetes context",
1577
1624
  group: "general",
1578
1625
  inputs: {},
@@ -1597,7 +1644,7 @@ const defineCommand_1 = __nccwpck_require__(39489);
1597
1644
  const k8sApi_1 = __nccwpck_require__(90390);
1598
1645
  const shell_1 = __nccwpck_require__(45381);
1599
1646
  exports.commandKubeGetShell = (0, defineCommand_1.defineCommand)({
1600
- name: "kube get-shell",
1647
+ name: "k8s get-shell",
1601
1648
  description: "get a shell to a pod in the environment",
1602
1649
  group: "general",
1603
1650
  inputs: {
@@ -1639,7 +1686,7 @@ exports.commandKubeListNamespaces = void 0;
1639
1686
  const defineCommand_1 = __nccwpck_require__(39489);
1640
1687
  const k8sApi_1 = __nccwpck_require__(90390);
1641
1688
  exports.commandKubeListNamespaces = (0, defineCommand_1.defineCommand)({
1642
- name: "kube list-namespaces",
1689
+ name: "k8s list-namespaces",
1643
1690
  description: "list all namespaces",
1644
1691
  group: "general",
1645
1692
  inputs: {},
@@ -1666,7 +1713,7 @@ exports.commandKubeListPods = void 0;
1666
1713
  const defineCommand_1 = __nccwpck_require__(39489);
1667
1714
  const k8sApi_1 = __nccwpck_require__(90390);
1668
1715
  exports.commandKubeListPods = (0, defineCommand_1.defineCommand)({
1669
- name: "kube list-pods",
1716
+ name: "k8s list-pods",
1670
1717
  description: "list all pods of namespace",
1671
1718
  group: "general",
1672
1719
  inputs: {
@@ -1699,7 +1746,7 @@ exports.commandKubeListSecrets = void 0;
1699
1746
  const defineCommand_1 = __nccwpck_require__(39489);
1700
1747
  const k8sApi_1 = __nccwpck_require__(90390);
1701
1748
  exports.commandKubeListSecrets = (0, defineCommand_1.defineCommand)({
1702
- name: "kube list-secrets",
1749
+ name: "k8s list-secrets",
1703
1750
  description: "show secrets",
1704
1751
  group: "general",
1705
1752
  inputs: {
@@ -1733,7 +1780,7 @@ const defineCommand_1 = __nccwpck_require__(39489);
1733
1780
  const k8sApi_1 = __nccwpck_require__(90390);
1734
1781
  const portForward_1 = __nccwpck_require__(86070);
1735
1782
  exports.commandKubePortForward = (0, defineCommand_1.defineCommand)({
1736
- name: "kube port-forward",
1783
+ name: "k8s port-forward",
1737
1784
  description: "start port-forwarding",
1738
1785
  group: "general",
1739
1786
  inputs: {
@@ -1785,7 +1832,7 @@ exports.commandKubeStopPortforward = void 0;
1785
1832
  const defineCommand_1 = __nccwpck_require__(39489);
1786
1833
  const portForwards_1 = __nccwpck_require__(77090);
1787
1834
  exports.commandKubeStopPortforward = (0, defineCommand_1.defineCommand)({
1788
- name: "kube stop-portforward",
1835
+ name: "k8s stop-portforward",
1789
1836
  description: "stop a running port forward",
1790
1837
  group: "general",
1791
1838
  inputs: {
@@ -1812,7 +1859,7 @@ exports.commandKubeStopPortforward = (0, defineCommand_1.defineCommand)({
1812
1859
  Object.defineProperty(exports, "__esModule", ({
1813
1860
  value: true
1814
1861
  }));
1815
- exports.commandStarwars = exports.commandDadjoke = exports.commandSecurityAuditCreate = exports.commandSecurityAuditEvaluate = exports.commandSecurityAuditCiJob = exports.commandRestoreDb = exports.commandMongoDestroyMember = exports.commandMongoPortForward = exports.commandMongoGetShell = exports.commandSecurityEvaluate = exports.commandProjectRestoreDb = exports.commandCiJobLog = exports.commandCiJobOpen = exports.commandSetup = exports.commandGetMyTotalWorktime = exports.commandRenewToken = exports.commandTriggerCronjobProject = exports.commandTriggerCronjobGeneral = exports.commandSecretsClearBackups = exports.commandConfigSecrets = exports.commandCloudSqlProxy = exports.commandOpenGit = exports.commandOpenLogs = exports.commandOpenEnv = exports.commandDeleteProject = exports.commandPauseProject = exports.commandDeletePods = exports.commandPortForward = exports.commandGetShell = exports.commandListPods = exports.commandEnvVars = exports.commandNamespace = exports.commandKubePortForward = exports.commandKubeGetShell = exports.commandKubeStopPortforward = exports.commandKubeListPods = exports.commandKubeListSecrets = exports.commandKubeListNamespaces = exports.commandKubeCurrentContext = void 0;
1862
+ exports.commandStarwars = exports.commandDadjoke = exports.commandSecurityAuditCreate = exports.commandSecurityAuditEvaluate = exports.commandSecurityAuditCiJob = exports.commandRestoreDb = exports.commandMongoDestroyMember = exports.commandMongoPortForward = exports.commandMongoGetShell = exports.commandTriggerCronjobProject = exports.commandDeleteProject = exports.commandPauseProject = exports.commandDeletePods = exports.commandGetShell = exports.commandListPods = exports.commandNamespace = exports.commandSecurityEvaluate = exports.commandProjectRestoreDb = exports.commandCiJobLog = exports.commandCiJobOpen = exports.commandSetup = exports.commandGetMyTotalWorktime = exports.commandRenewToken = exports.commandTriggerCronjobGeneral = exports.commandOpenLogs = exports.commandSecretsClearBackups = exports.commandConfigSecrets = exports.commandCloudSqlProxy = exports.commandOpenGit = exports.commandOpenEnv = exports.commandPortForward = exports.commandEnvVars = exports.commandKubePortForward = exports.commandKubeGetShell = exports.commandKubeStopPortforward = exports.commandKubeListPods = exports.commandKubeListSecrets = exports.commandKubeListNamespaces = exports.commandKubeCurrentContext = void 0;
1816
1863
  // General commands
1817
1864
  var commandKubeCurrentContext_1 = __nccwpck_require__(70243);
1818
1865
  Object.defineProperty(exports, "commandKubeCurrentContext", ({
@@ -1864,13 +1911,6 @@ Object.defineProperty(exports, "commandKubePortForward", ({
1864
1911
  }
1865
1912
  }));
1866
1913
  // Project commands
1867
- var commandNamespace_1 = __nccwpck_require__(23636);
1868
- Object.defineProperty(exports, "commandNamespace", ({
1869
- enumerable: true,
1870
- get: function () {
1871
- return commandNamespace_1.commandNamespace;
1872
- }
1873
- }));
1874
1914
  var commandEnvVars_1 = __nccwpck_require__(47838);
1875
1915
  Object.defineProperty(exports, "commandEnvVars", ({
1876
1916
  enumerable: true,
@@ -1878,20 +1918,6 @@ Object.defineProperty(exports, "commandEnvVars", ({
1878
1918
  return commandEnvVars_1.commandEnvVars;
1879
1919
  }
1880
1920
  }));
1881
- var commandListPods_1 = __nccwpck_require__(6111);
1882
- Object.defineProperty(exports, "commandListPods", ({
1883
- enumerable: true,
1884
- get: function () {
1885
- return commandListPods_1.commandListPods;
1886
- }
1887
- }));
1888
- var commandGetShell_1 = __nccwpck_require__(97353);
1889
- Object.defineProperty(exports, "commandGetShell", ({
1890
- enumerable: true,
1891
- get: function () {
1892
- return commandGetShell_1.commandGetShell;
1893
- }
1894
- }));
1895
1921
  var commandPortForward_1 = __nccwpck_require__(89143);
1896
1922
  Object.defineProperty(exports, "commandPortForward", ({
1897
1923
  enumerable: true,
@@ -1899,27 +1925,6 @@ Object.defineProperty(exports, "commandPortForward", ({
1899
1925
  return commandPortForward_1.commandPortForward;
1900
1926
  }
1901
1927
  }));
1902
- var commandDeletePods_1 = __nccwpck_require__(94224);
1903
- Object.defineProperty(exports, "commandDeletePods", ({
1904
- enumerable: true,
1905
- get: function () {
1906
- return commandDeletePods_1.commandDeletePods;
1907
- }
1908
- }));
1909
- var commandPauseProject_1 = __nccwpck_require__(9168);
1910
- Object.defineProperty(exports, "commandPauseProject", ({
1911
- enumerable: true,
1912
- get: function () {
1913
- return commandPauseProject_1.commandPauseProject;
1914
- }
1915
- }));
1916
- var commandDeleteProject_1 = __nccwpck_require__(3383);
1917
- Object.defineProperty(exports, "commandDeleteProject", ({
1918
- enumerable: true,
1919
- get: function () {
1920
- return commandDeleteProject_1.commandDeleteProject;
1921
- }
1922
- }));
1923
1928
  var commandOpenEnv_1 = __nccwpck_require__(86780);
1924
1929
  Object.defineProperty(exports, "commandOpenEnv", ({
1925
1930
  enumerable: true,
@@ -1927,13 +1932,6 @@ Object.defineProperty(exports, "commandOpenEnv", ({
1927
1932
  return commandOpenEnv_1.commandOpenEnv;
1928
1933
  }
1929
1934
  }));
1930
- var commandOpenLogs_1 = __nccwpck_require__(98720);
1931
- Object.defineProperty(exports, "commandOpenLogs", ({
1932
- enumerable: true,
1933
- get: function () {
1934
- return commandOpenLogs_1.commandOpenLogs;
1935
- }
1936
- }));
1937
1935
  var commandOpenGit_1 = __nccwpck_require__(4855);
1938
1936
  Object.defineProperty(exports, "commandOpenGit", ({
1939
1937
  enumerable: true,
@@ -1962,17 +1960,18 @@ Object.defineProperty(exports, "commandSecretsClearBackups", ({
1962
1960
  return commandSecretsClearBackups_1.commandSecretsClearBackups;
1963
1961
  }
1964
1962
  }));
1965
- var commandTriggerCronjob_1 = __nccwpck_require__(35480);
1966
- Object.defineProperty(exports, "commandTriggerCronjobGeneral", ({
1963
+ var commandOpenLogs_1 = __nccwpck_require__(98720);
1964
+ Object.defineProperty(exports, "commandOpenLogs", ({
1967
1965
  enumerable: true,
1968
1966
  get: function () {
1969
- return commandTriggerCronjob_1.commandTriggerCronjobGeneral;
1967
+ return commandOpenLogs_1.commandOpenLogs;
1970
1968
  }
1971
1969
  }));
1972
- Object.defineProperty(exports, "commandTriggerCronjobProject", ({
1970
+ var commandTriggerCronjob_1 = __nccwpck_require__(35815);
1971
+ Object.defineProperty(exports, "commandTriggerCronjobGeneral", ({
1973
1972
  enumerable: true,
1974
1973
  get: function () {
1975
- return commandTriggerCronjob_1.commandTriggerCronjobProject;
1974
+ return commandTriggerCronjob_1.commandTriggerCronjobGeneral;
1976
1975
  }
1977
1976
  }));
1978
1977
  var commandRenewToken_1 = __nccwpck_require__(87253);
@@ -2023,6 +2022,56 @@ Object.defineProperty(exports, "commandSecurityEvaluate", ({
2023
2022
  return commandSecurityEvaluate_1.commandSecurityEvaluate;
2024
2023
  }
2025
2024
  }));
2025
+ // Project k8s commands
2026
+ var commandNamespace_1 = __nccwpck_require__(72585);
2027
+ Object.defineProperty(exports, "commandNamespace", ({
2028
+ enumerable: true,
2029
+ get: function () {
2030
+ return commandNamespace_1.commandNamespace;
2031
+ }
2032
+ }));
2033
+ var commandListPods_1 = __nccwpck_require__(89432);
2034
+ Object.defineProperty(exports, "commandListPods", ({
2035
+ enumerable: true,
2036
+ get: function () {
2037
+ return commandListPods_1.commandListPods;
2038
+ }
2039
+ }));
2040
+ var commandGetShell_1 = __nccwpck_require__(29469);
2041
+ Object.defineProperty(exports, "commandGetShell", ({
2042
+ enumerable: true,
2043
+ get: function () {
2044
+ return commandGetShell_1.commandGetShell;
2045
+ }
2046
+ }));
2047
+ var commandDeletePods_1 = __nccwpck_require__(25487);
2048
+ Object.defineProperty(exports, "commandDeletePods", ({
2049
+ enumerable: true,
2050
+ get: function () {
2051
+ return commandDeletePods_1.commandDeletePods;
2052
+ }
2053
+ }));
2054
+ var commandPauseProject_1 = __nccwpck_require__(75095);
2055
+ Object.defineProperty(exports, "commandPauseProject", ({
2056
+ enumerable: true,
2057
+ get: function () {
2058
+ return commandPauseProject_1.commandPauseProject;
2059
+ }
2060
+ }));
2061
+ var commandDeleteProject_1 = __nccwpck_require__(62270);
2062
+ Object.defineProperty(exports, "commandDeleteProject", ({
2063
+ enumerable: true,
2064
+ get: function () {
2065
+ return commandDeleteProject_1.commandDeleteProject;
2066
+ }
2067
+ }));
2068
+ var commandTriggerCronjob_2 = __nccwpck_require__(35815);
2069
+ Object.defineProperty(exports, "commandTriggerCronjobProject", ({
2070
+ enumerable: true,
2071
+ get: function () {
2072
+ return commandTriggerCronjob_2.commandTriggerCronjobProject;
2073
+ }
2074
+ }));
2026
2075
  // MongoDB commands
2027
2076
  var commandMongoGetShell_1 = __nccwpck_require__(22796);
2028
2077
  Object.defineProperty(exports, "commandMongoGetShell", ({
@@ -2111,6 +2160,7 @@ const projects_1 = __nccwpck_require__(57414);
2111
2160
  const ensureCluster_1 = __nccwpck_require__(2490);
2112
2161
  const utils_1 = __nccwpck_require__(38365);
2113
2162
  const autocompletions_1 = __nccwpck_require__(52468);
2163
+ const availability_1 = __nccwpck_require__(1377);
2114
2164
  const removeFinalizer = async (namespace, type, name) => (0, child_process_promise_1.exec)(`kubectl patch --namespace ${namespace} ${type} ${name} -p '{"metadata":{"finalizers":null}}'`);
2115
2165
  const deleteResource = async (namespace, type, name) => (0, child_process_promise_1.exec)(`kubectl delete --namespace ${namespace} ${type} ${name}`);
2116
2166
  const removeFinalizerAndDelete = async (namespace, type, name) => {
@@ -2120,6 +2170,7 @@ exports.commandMongoDestroyMember = (0, defineCommand_1.defineCommand)({
2120
2170
  name: "project mongo destroy-member",
2121
2171
  description: "DESTROY a member of a replicaset in order to reinitialize it",
2122
2172
  group: "mongodb",
2173
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
2123
2174
  inputs: {
2124
2175
  envComponent: {
2125
2176
  type: "string",
@@ -2204,10 +2255,12 @@ const projects_1 = __nccwpck_require__(57414);
2204
2255
  const ensureCluster_1 = __nccwpck_require__(2490);
2205
2256
  const utils_1 = __nccwpck_require__(38365);
2206
2257
  const autocompletions_1 = __nccwpck_require__(52468);
2258
+ const availability_1 = __nccwpck_require__(1377);
2207
2259
  exports.commandMongoGetShell = (0, defineCommand_1.defineCommand)({
2208
2260
  name: "project mongo get-shell",
2209
2261
  description: "get a shell to a mongodb in the environment",
2210
2262
  group: "mongodb",
2263
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
2211
2264
  inputs: {
2212
2265
  envComponent: {
2213
2266
  type: "string",
@@ -2255,10 +2308,12 @@ const ensureCluster_1 = __nccwpck_require__(2490);
2255
2308
  const utils_1 = __nccwpck_require__(38365);
2256
2309
  const clipboardy_1 = __importDefault(__nccwpck_require__(77983));
2257
2310
  const autocompletions_1 = __nccwpck_require__(52468);
2311
+ const availability_1 = __nccwpck_require__(1377);
2258
2312
  exports.commandMongoPortForward = (0, defineCommand_1.defineCommand)({
2259
2313
  name: "project mongo port-forward",
2260
2314
  description: "port forward to a mongodb",
2261
2315
  group: "mongodb",
2316
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
2262
2317
  inputs: {
2263
2318
  envComponent: {
2264
2319
  type: "string",
@@ -2326,6 +2381,7 @@ const getProjectConfig_1 = __nccwpck_require__(50001);
2326
2381
  const startProxy_1 = __nccwpck_require__(95540);
2327
2382
  const log_1 = __nccwpck_require__(67253);
2328
2383
  const autocompletions_1 = __nccwpck_require__(52468);
2384
+ const availability_1 = __nccwpck_require__(1377);
2329
2385
  const getProxyInfoForKubernetes = async (io, context) => {
2330
2386
  var _a, _b;
2331
2387
  if (!(0, pipeline_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
@@ -2382,6 +2438,7 @@ exports.commandCloudSqlProxy = (0, defineCommand_1.defineCommand)({
2382
2438
  name: "project cloudsql proxy",
2383
2439
  description: "proxy to cloud sql db",
2384
2440
  group: "project",
2441
+ isAvailable: (0, availability_1.hasCloudSql)(),
2385
2442
  inputs: {
2386
2443
  envComponent: {
2387
2444
  type: "string",
@@ -2481,110 +2538,6 @@ exports.commandConfigSecrets = (0, defineCommand_1.defineCommand)({
2481
2538
 
2482
2539
  /***/ }),
2483
2540
 
2484
- /***/ 94224:
2485
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2486
-
2487
- "use strict";
2488
-
2489
-
2490
- Object.defineProperty(exports, "__esModule", ({
2491
- value: true
2492
- }));
2493
- exports.commandDeletePods = void 0;
2494
- const defineCommand_1 = __nccwpck_require__(39489);
2495
- const k8sApi_1 = __nccwpck_require__(90390);
2496
- const kubernetes_1 = __nccwpck_require__(45198);
2497
- const projects_1 = __nccwpck_require__(57414);
2498
- const ensureCluster_1 = __nccwpck_require__(2490);
2499
- const autocompletions_1 = __nccwpck_require__(52468);
2500
- exports.commandDeletePods = (0, defineCommand_1.defineCommand)({
2501
- name: "project delete-pods",
2502
- description: "delete / restart pods",
2503
- group: "project",
2504
- inputs: {
2505
- envComponent: {
2506
- type: "string",
2507
- message: "environment:component",
2508
- positional: true,
2509
- choices: async () => (0, autocompletions_1.envAndComponents)()
2510
- },
2511
- selectedPodNames: {
2512
- type: "string[]",
2513
- message: "Which pods to delete / restart ? 🤔 ",
2514
- choices: async ctx => (0, kubernetes_1.getProjectPodNames)(await ctx.get("envComponent"))
2515
- }
2516
- },
2517
- execute: async ctx => {
2518
- const envComponent = await ctx.get("envComponent");
2519
- await (0, ensureCluster_1.ensureCluster)(ctx, envComponent);
2520
- const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
2521
- const selectedPodNames = await ctx.get("selectedPodNames");
2522
- ctx.log("the following pods will be DELETED 🙀 (and therefore restarted 😸)");
2523
- ctx.log("");
2524
- selectedPodNames.forEach(n => ctx.log(n));
2525
- ctx.log("");
2526
- const shouldContinue = await ctx.confirm("Continue ? 🤔 ");
2527
- ctx.log("");
2528
- const k8sApi = (0, k8sApi_1.getk8sApi)();
2529
- if (shouldContinue) {
2530
- for (const podName of selectedPodNames) {
2531
- await k8sApi.deleteNamespacedPod(podName, namespace, "true");
2532
- ctx.log(`deleted pod '${podName}'`);
2533
- }
2534
- }
2535
- }
2536
- });
2537
-
2538
- /***/ }),
2539
-
2540
- /***/ 3383:
2541
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2542
-
2543
- "use strict";
2544
-
2545
-
2546
- Object.defineProperty(exports, "__esModule", ({
2547
- value: true
2548
- }));
2549
- exports.commandDeleteProject = void 0;
2550
- const child_process_promise_1 = __nccwpck_require__(51748);
2551
- const defineCommand_1 = __nccwpck_require__(39489);
2552
- const projects_1 = __nccwpck_require__(57414);
2553
- const autocompletions_1 = __nccwpck_require__(52468);
2554
- exports.commandDeleteProject = (0, defineCommand_1.defineCommand)({
2555
- name: "project delete",
2556
- description: "deletes a environment of a project (it deletes the namespace)",
2557
- group: "project",
2558
- inputs: {
2559
- envComponent: {
2560
- type: "string",
2561
- message: "environment:component",
2562
- positional: true,
2563
- choices: async () => (0, autocompletions_1.envAndComponents)()
2564
- }
2565
- },
2566
- execute: async ctx => {
2567
- const envComponent = await ctx.get("envComponent");
2568
- const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
2569
- const shouldContinue = await ctx.confirm("This will delete the namespace. All data will be lost. Continue? 🤔 ");
2570
- if (!shouldContinue) {
2571
- return;
2572
- }
2573
- const fullCommand = `kubectl delete namespace ${namespace}`;
2574
- const {
2575
- stdout
2576
- } = await (0, child_process_promise_1.exec)(fullCommand, {
2577
- env: {
2578
- ...process.env,
2579
- DEBUG: ""
2580
- }
2581
- });
2582
- ctx.log(stdout);
2583
- }
2584
- });
2585
-
2586
- /***/ }),
2587
-
2588
2541
  /***/ 47838:
2589
2542
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2590
2543
 
@@ -2650,54 +2603,6 @@ exports.commandGetMyTotalWorktime = (0, defineCommand_1.defineCommand)({
2650
2603
 
2651
2604
  /***/ }),
2652
2605
 
2653
- /***/ 97353:
2654
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2655
-
2656
- "use strict";
2657
-
2658
-
2659
- Object.defineProperty(exports, "__esModule", ({
2660
- value: true
2661
- }));
2662
- exports.commandGetShell = void 0;
2663
- const defineCommand_1 = __nccwpck_require__(39489);
2664
- const kubernetes_1 = __nccwpck_require__(45198);
2665
- const projects_1 = __nccwpck_require__(57414);
2666
- const shell_1 = __nccwpck_require__(45381);
2667
- const ensureCluster_1 = __nccwpck_require__(2490);
2668
- const autocompletions_1 = __nccwpck_require__(52468);
2669
- exports.commandGetShell = (0, defineCommand_1.defineCommand)({
2670
- name: "project get-shell",
2671
- description: "get a shell to a pod in the environment",
2672
- group: "project",
2673
- inputs: {
2674
- envComponent: {
2675
- type: "string",
2676
- message: "environment:component",
2677
- positional: true,
2678
- choices: async () => (0, autocompletions_1.envAndComponents)()
2679
- },
2680
- podName: {
2681
- type: "string",
2682
- message: "Which pod? 🤔",
2683
- choices: async ctx => {
2684
- const envComponent = await ctx.get("envComponent");
2685
- const pods = await (0, kubernetes_1.getProjectPods)(envComponent);
2686
- return pods.filter(p => p.status.phase == "Running").map(r => r.metadata.name);
2687
- }
2688
- }
2689
- },
2690
- execute: async ctx => {
2691
- const envComponent = await ctx.get("envComponent");
2692
- await (0, ensureCluster_1.ensureCluster)(ctx, envComponent);
2693
- const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
2694
- const podName = await ctx.get("podName");
2695
- return (0, shell_1.getShell)(namespace, podName);
2696
- }
2697
- });
2698
-
2699
- /***/ }),
2700
-
2701
2606
  /***/ 57076:
2702
2607
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
2703
2608
 
@@ -2814,77 +2719,6 @@ exports.commandCiJobLog = (0, defineCommand_1.defineCommand)({
2814
2719
 
2815
2720
  /***/ }),
2816
2721
 
2817
- /***/ 6111:
2818
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2819
-
2820
- "use strict";
2821
-
2822
-
2823
- Object.defineProperty(exports, "__esModule", ({
2824
- value: true
2825
- }));
2826
- exports.commandListPods = void 0;
2827
- const yaml_1 = __nccwpck_require__(6637);
2828
- const lodash_1 = __nccwpck_require__(49250);
2829
- const defineCommand_1 = __nccwpck_require__(39489);
2830
- const kubernetes_1 = __nccwpck_require__(45198);
2831
- const ensureCluster_1 = __nccwpck_require__(2490);
2832
- const autocompletions_1 = __nccwpck_require__(52468);
2833
- exports.commandListPods = (0, defineCommand_1.defineCommand)({
2834
- name: "project list-pods",
2835
- description: "list pods of local project",
2836
- group: "project",
2837
- inputs: {
2838
- envComponent: {
2839
- type: "string",
2840
- message: "environment:component",
2841
- positional: true,
2842
- choices: async () => (0, autocompletions_1.envAndComponents)()
2843
- }
2844
- },
2845
- execute: async ctx => {
2846
- const envComponent = await ctx.get("envComponent");
2847
- await (0, ensureCluster_1.ensureCluster)(ctx, envComponent);
2848
- const pods = await (0, kubernetes_1.getProjectPods)(envComponent);
2849
- ctx.log((0, yaml_1.stringify)(pods.map(p => (0, lodash_1.pick)(p, ["metadata.name", "status.startTime"]))));
2850
- }
2851
- });
2852
-
2853
- /***/ }),
2854
-
2855
- /***/ 23636:
2856
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2857
-
2858
- "use strict";
2859
-
2860
-
2861
- Object.defineProperty(exports, "__esModule", ({
2862
- value: true
2863
- }));
2864
- exports.commandNamespace = void 0;
2865
- const defineCommand_1 = __nccwpck_require__(39489);
2866
- const projects_1 = __nccwpck_require__(57414);
2867
- const autocompletions_1 = __nccwpck_require__(52468);
2868
- exports.commandNamespace = (0, defineCommand_1.defineCommand)({
2869
- name: "project namespace",
2870
- description: "show namespace of local project",
2871
- group: "project",
2872
- inputs: {
2873
- envComponent: {
2874
- type: "string",
2875
- message: "environment:component",
2876
- positional: true,
2877
- choices: async () => (0, autocompletions_1.envAndComponents)()
2878
- }
2879
- },
2880
- execute: async ctx => {
2881
- const envComponent = await ctx.get("envComponent");
2882
- ctx.log(await (0, projects_1.getProjectNamespace)(envComponent));
2883
- }
2884
- });
2885
-
2886
- /***/ }),
2887
-
2888
2722
  /***/ 86780:
2889
2723
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
2890
2724
 
@@ -2966,14 +2800,18 @@ Object.defineProperty(exports, "__esModule", ({
2966
2800
  value: true
2967
2801
  }));
2968
2802
  exports.commandOpenLogs = void 0;
2803
+ const pipeline_1 = __nccwpck_require__(60241);
2969
2804
  const defineCommand_1 = __nccwpck_require__(39489);
2970
2805
  const getProjectConfig_1 = __nccwpck_require__(50001);
2971
2806
  const openKubernetesDashboards_1 = __nccwpck_require__(1049);
2807
+ const openDashboard_1 = __nccwpck_require__(79888);
2972
2808
  const autocompletions_1 = __nccwpck_require__(52468);
2809
+ const availability_1 = __nccwpck_require__(1377);
2973
2810
  exports.commandOpenLogs = (0, defineCommand_1.defineCommand)({
2974
- name: "project open logs",
2975
- description: "open google cloud logs (stackdriver logs)",
2811
+ name: "project logs open",
2812
+ description: "open logs for a component (Google Cloud Logging)",
2976
2813
  group: "project",
2814
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes", "google-cloudrun"),
2977
2815
  inputs: {
2978
2816
  envComponent: {
2979
2817
  type: "string",
@@ -2983,61 +2821,24 @@ exports.commandOpenLogs = (0, defineCommand_1.defineCommand)({
2983
2821
  }
2984
2822
  },
2985
2823
  execute: async ctx => {
2824
+ var _a;
2986
2825
  const envComponent = await ctx.get("envComponent");
2987
2826
  const {
2988
2827
  env,
2989
2828
  componentName
2990
2829
  } = (0, getProjectConfig_1.parseChoice)(envComponent);
2991
2830
  const context = await (0, getProjectConfig_1.getPipelineContextByChoice)(env, componentName);
2992
- await (0, openKubernetesDashboards_1.openGoogleCloudLogs)(ctx, context);
2993
- }
2994
- });
2995
-
2996
- /***/ }),
2997
-
2998
- /***/ 9168:
2999
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3000
-
3001
- "use strict";
3002
-
3003
-
3004
- Object.defineProperty(exports, "__esModule", ({
3005
- value: true
3006
- }));
3007
- exports.commandPauseProject = void 0;
3008
- const child_process_promise_1 = __nccwpck_require__(51748);
3009
- const defineCommand_1 = __nccwpck_require__(39489);
3010
- const projects_1 = __nccwpck_require__(57414);
3011
- const autocompletions_1 = __nccwpck_require__(52468);
3012
- exports.commandPauseProject = (0, defineCommand_1.defineCommand)({
3013
- name: "project pause",
3014
- description: "halts all running pods (scales to 0)",
3015
- group: "project",
3016
- inputs: {
3017
- envComponent: {
3018
- type: "string",
3019
- message: "environment:component",
3020
- positional: true,
3021
- choices: async () => (0, autocompletions_1.envAndComponents)()
3022
- }
3023
- },
3024
- execute: async ctx => {
3025
- const envComponent = await ctx.get("envComponent");
3026
- const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
3027
- const shouldContinue = await ctx.confirm("This will STOP all running pods. You will need to manually scale back up or re-deploy. Continue? 🤔 ");
3028
- if (!shouldContinue) {
3029
- return;
2831
+ const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
2832
+ if ((0, pipeline_1.isOfDeployType)(deployConfig, "kubernetes")) {
2833
+ await (0, openKubernetesDashboards_1.openGoogleCloudLogs)(ctx, context);
2834
+ } else if ((0, pipeline_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
2835
+ const serviceName = context.environment.fullName.toLowerCase();
2836
+ await (0, openDashboard_1.openGoogleCloudDashboard)(ctx, `run/detail/${deployConfig.region}/${serviceName}/observability/logs`, {
2837
+ project: deployConfig.projectId
2838
+ });
2839
+ } else {
2840
+ ctx.log(`Unsupported deploy type for open-logs: ${deployConfig === null || deployConfig === void 0 ? void 0 : deployConfig.type}`);
3030
2841
  }
3031
- const fullCommand = `kubectl scale statefulset,deployment --all --replicas=0 --namespace=${namespace}`;
3032
- const {
3033
- stdout
3034
- } = await (0, child_process_promise_1.exec)(fullCommand, {
3035
- env: {
3036
- ...process.env,
3037
- DEBUG: ""
3038
- }
3039
- });
3040
- ctx.log(stdout);
3041
2842
  }
3042
2843
  });
3043
2844
 
@@ -3070,10 +2871,12 @@ const pipeline_1 = __nccwpck_require__(60241);
3070
2871
  const portForwards_1 = __nccwpck_require__(77090);
3071
2872
  const open_1 = __importDefault(__nccwpck_require__(35186));
3072
2873
  const autocompletions_1 = __nccwpck_require__(52468);
2874
+ const availability_1 = __nccwpck_require__(1377);
3073
2875
  exports.commandPortForward = (0, defineCommand_1.defineCommand)({
3074
2876
  name: "project port-forward",
3075
2877
  description: "start port-forwarding",
3076
2878
  group: "project",
2879
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes", "google-cloudrun"),
3077
2880
  inputs: {
3078
2881
  envComponent: {
3079
2882
  type: "string",
@@ -3157,11 +2960,12 @@ Object.defineProperty(exports, "__esModule", ({
3157
2960
  exports.commandProjectRestoreDb = void 0;
3158
2961
  const defineCommand_1 = __nccwpck_require__(39489);
3159
2962
  const getProjectConfig_1 = __nccwpck_require__(50001);
2963
+ const availability_1 = __nccwpck_require__(1377);
3160
2964
  const startProxy_1 = __nccwpck_require__(95540);
3161
2965
  const parseConnectionString_1 = __nccwpck_require__(77992);
3162
2966
  const copyDb_1 = __nccwpck_require__(57151);
3163
2967
  const pipeline_1 = __nccwpck_require__(60241);
3164
- const hasCloudSql = context => {
2968
+ const componentHasCloudSql = context => {
3165
2969
  var _a, _b, _c;
3166
2970
  const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
3167
2971
  if ((0, pipeline_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
@@ -3176,6 +2980,7 @@ exports.commandProjectRestoreDb = (0, defineCommand_1.defineCommand)({
3176
2980
  name: "project cloudsql restore-db",
3177
2981
  description: "restores a project db from one source to another target",
3178
2982
  group: "project",
2983
+ isAvailable: (0, availability_1.hasCloudSql)(),
3179
2984
  inputs: {
3180
2985
  source: {
3181
2986
  type: "string",
@@ -3190,7 +2995,7 @@ exports.commandProjectRestoreDb = (0, defineCommand_1.defineCommand)({
3190
2995
  if (aLocal !== bLocal) return aLocal ? 1 : -1;
3191
2996
  return a.localeCompare(b);
3192
2997
  };
3193
- return allContexts.filter(hasCloudSql).map(c => `${c.env}:${c.name}`).sort(sortByEnv);
2998
+ return allContexts.filter(componentHasCloudSql).map(c => `${c.env}:${c.name}`).sort(sortByEnv);
3194
2999
  }
3195
3000
  },
3196
3001
  target: {
@@ -3206,7 +3011,7 @@ exports.commandProjectRestoreDb = (0, defineCommand_1.defineCommand)({
3206
3011
  if (aLocal !== bLocal) return aLocal ? 1 : -1;
3207
3012
  return a.localeCompare(b);
3208
3013
  };
3209
- return allContexts.filter(hasCloudSql).map(c => {
3014
+ return allContexts.filter(componentHasCloudSql).map(c => {
3210
3015
  const value = `${c.env}:${c.name}`;
3211
3016
  const isProd = c.environment.envType === "prod";
3212
3017
  return {
@@ -3431,7 +3236,290 @@ exports.commandSetup = (0, defineCommand_1.defineCommand)({
3431
3236
 
3432
3237
  /***/ }),
3433
3238
 
3434
- /***/ 35480:
3239
+ /***/ 25487:
3240
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3241
+
3242
+ "use strict";
3243
+
3244
+
3245
+ Object.defineProperty(exports, "__esModule", ({
3246
+ value: true
3247
+ }));
3248
+ exports.commandDeletePods = void 0;
3249
+ const defineCommand_1 = __nccwpck_require__(39489);
3250
+ const k8sApi_1 = __nccwpck_require__(90390);
3251
+ const kubernetes_1 = __nccwpck_require__(45198);
3252
+ const projects_1 = __nccwpck_require__(57414);
3253
+ const ensureCluster_1 = __nccwpck_require__(2490);
3254
+ const autocompletions_1 = __nccwpck_require__(52468);
3255
+ const availability_1 = __nccwpck_require__(1377);
3256
+ exports.commandDeletePods = (0, defineCommand_1.defineCommand)({
3257
+ name: "project k8s delete-pods",
3258
+ description: "delete / restart pods",
3259
+ group: "project",
3260
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3261
+ inputs: {
3262
+ envComponent: {
3263
+ type: "string",
3264
+ message: "environment:component",
3265
+ positional: true,
3266
+ choices: async () => (0, autocompletions_1.envAndComponents)()
3267
+ },
3268
+ selectedPodNames: {
3269
+ type: "string[]",
3270
+ message: "Which pods to delete / restart ? 🤔 ",
3271
+ choices: async ctx => (0, kubernetes_1.getProjectPodNames)(await ctx.get("envComponent"))
3272
+ }
3273
+ },
3274
+ execute: async ctx => {
3275
+ const envComponent = await ctx.get("envComponent");
3276
+ await (0, ensureCluster_1.ensureCluster)(ctx, envComponent);
3277
+ const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
3278
+ const selectedPodNames = await ctx.get("selectedPodNames");
3279
+ ctx.log("the following pods will be DELETED 🙀 (and therefore restarted 😸)");
3280
+ ctx.log("");
3281
+ selectedPodNames.forEach(n => ctx.log(n));
3282
+ ctx.log("");
3283
+ const shouldContinue = await ctx.confirm("Continue ? 🤔 ");
3284
+ ctx.log("");
3285
+ const k8sApi = (0, k8sApi_1.getk8sApi)();
3286
+ if (shouldContinue) {
3287
+ for (const podName of selectedPodNames) {
3288
+ await k8sApi.deleteNamespacedPod(podName, namespace, "true");
3289
+ ctx.log(`deleted pod '${podName}'`);
3290
+ }
3291
+ }
3292
+ }
3293
+ });
3294
+
3295
+ /***/ }),
3296
+
3297
+ /***/ 62270:
3298
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3299
+
3300
+ "use strict";
3301
+
3302
+
3303
+ Object.defineProperty(exports, "__esModule", ({
3304
+ value: true
3305
+ }));
3306
+ exports.commandDeleteProject = void 0;
3307
+ const child_process_promise_1 = __nccwpck_require__(51748);
3308
+ const defineCommand_1 = __nccwpck_require__(39489);
3309
+ const projects_1 = __nccwpck_require__(57414);
3310
+ const autocompletions_1 = __nccwpck_require__(52468);
3311
+ const availability_1 = __nccwpck_require__(1377);
3312
+ exports.commandDeleteProject = (0, defineCommand_1.defineCommand)({
3313
+ name: "project k8s delete",
3314
+ description: "deletes a environment of a project (it deletes the namespace)",
3315
+ group: "project",
3316
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3317
+ inputs: {
3318
+ envComponent: {
3319
+ type: "string",
3320
+ message: "environment:component",
3321
+ positional: true,
3322
+ choices: async () => (0, autocompletions_1.envAndComponents)()
3323
+ }
3324
+ },
3325
+ execute: async ctx => {
3326
+ const envComponent = await ctx.get("envComponent");
3327
+ const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
3328
+ const shouldContinue = await ctx.confirm("This will delete the namespace. All data will be lost. Continue? 🤔 ");
3329
+ if (!shouldContinue) {
3330
+ return;
3331
+ }
3332
+ const fullCommand = `kubectl delete namespace ${namespace}`;
3333
+ const {
3334
+ stdout
3335
+ } = await (0, child_process_promise_1.exec)(fullCommand, {
3336
+ env: {
3337
+ ...process.env,
3338
+ DEBUG: ""
3339
+ }
3340
+ });
3341
+ ctx.log(stdout);
3342
+ }
3343
+ });
3344
+
3345
+ /***/ }),
3346
+
3347
+ /***/ 29469:
3348
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3349
+
3350
+ "use strict";
3351
+
3352
+
3353
+ Object.defineProperty(exports, "__esModule", ({
3354
+ value: true
3355
+ }));
3356
+ exports.commandGetShell = void 0;
3357
+ const defineCommand_1 = __nccwpck_require__(39489);
3358
+ const kubernetes_1 = __nccwpck_require__(45198);
3359
+ const projects_1 = __nccwpck_require__(57414);
3360
+ const shell_1 = __nccwpck_require__(45381);
3361
+ const ensureCluster_1 = __nccwpck_require__(2490);
3362
+ const autocompletions_1 = __nccwpck_require__(52468);
3363
+ const availability_1 = __nccwpck_require__(1377);
3364
+ exports.commandGetShell = (0, defineCommand_1.defineCommand)({
3365
+ name: "project k8s get-shell",
3366
+ description: "get a shell to a pod in the environment",
3367
+ group: "project",
3368
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3369
+ inputs: {
3370
+ envComponent: {
3371
+ type: "string",
3372
+ message: "environment:component",
3373
+ positional: true,
3374
+ choices: async () => (0, autocompletions_1.envAndComponents)()
3375
+ },
3376
+ podName: {
3377
+ type: "string",
3378
+ message: "Which pod? 🤔",
3379
+ choices: async ctx => {
3380
+ const envComponent = await ctx.get("envComponent");
3381
+ const pods = await (0, kubernetes_1.getProjectPods)(envComponent);
3382
+ return pods.filter(p => p.status.phase == "Running").map(r => r.metadata.name);
3383
+ }
3384
+ }
3385
+ },
3386
+ execute: async ctx => {
3387
+ const envComponent = await ctx.get("envComponent");
3388
+ await (0, ensureCluster_1.ensureCluster)(ctx, envComponent);
3389
+ const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
3390
+ const podName = await ctx.get("podName");
3391
+ return (0, shell_1.getShell)(namespace, podName);
3392
+ }
3393
+ });
3394
+
3395
+ /***/ }),
3396
+
3397
+ /***/ 89432:
3398
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3399
+
3400
+ "use strict";
3401
+
3402
+
3403
+ Object.defineProperty(exports, "__esModule", ({
3404
+ value: true
3405
+ }));
3406
+ exports.commandListPods = void 0;
3407
+ const yaml_1 = __nccwpck_require__(6637);
3408
+ const lodash_1 = __nccwpck_require__(49250);
3409
+ const defineCommand_1 = __nccwpck_require__(39489);
3410
+ const kubernetes_1 = __nccwpck_require__(45198);
3411
+ const ensureCluster_1 = __nccwpck_require__(2490);
3412
+ const autocompletions_1 = __nccwpck_require__(52468);
3413
+ const availability_1 = __nccwpck_require__(1377);
3414
+ exports.commandListPods = (0, defineCommand_1.defineCommand)({
3415
+ name: "project k8s list-pods",
3416
+ description: "list pods of local project",
3417
+ group: "project",
3418
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3419
+ inputs: {
3420
+ envComponent: {
3421
+ type: "string",
3422
+ message: "environment:component",
3423
+ positional: true,
3424
+ choices: async () => (0, autocompletions_1.envAndComponents)()
3425
+ }
3426
+ },
3427
+ execute: async ctx => {
3428
+ const envComponent = await ctx.get("envComponent");
3429
+ await (0, ensureCluster_1.ensureCluster)(ctx, envComponent);
3430
+ const pods = await (0, kubernetes_1.getProjectPods)(envComponent);
3431
+ ctx.log((0, yaml_1.stringify)(pods.map(p => (0, lodash_1.pick)(p, ["metadata.name", "status.startTime"]))));
3432
+ }
3433
+ });
3434
+
3435
+ /***/ }),
3436
+
3437
+ /***/ 72585:
3438
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3439
+
3440
+ "use strict";
3441
+
3442
+
3443
+ Object.defineProperty(exports, "__esModule", ({
3444
+ value: true
3445
+ }));
3446
+ exports.commandNamespace = void 0;
3447
+ const defineCommand_1 = __nccwpck_require__(39489);
3448
+ const projects_1 = __nccwpck_require__(57414);
3449
+ const autocompletions_1 = __nccwpck_require__(52468);
3450
+ const availability_1 = __nccwpck_require__(1377);
3451
+ exports.commandNamespace = (0, defineCommand_1.defineCommand)({
3452
+ name: "project k8s namespace",
3453
+ description: "show namespace of local project",
3454
+ group: "project",
3455
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3456
+ inputs: {
3457
+ envComponent: {
3458
+ type: "string",
3459
+ message: "environment:component",
3460
+ positional: true,
3461
+ choices: async () => (0, autocompletions_1.envAndComponents)()
3462
+ }
3463
+ },
3464
+ execute: async ctx => {
3465
+ const envComponent = await ctx.get("envComponent");
3466
+ ctx.log(await (0, projects_1.getProjectNamespace)(envComponent));
3467
+ }
3468
+ });
3469
+
3470
+ /***/ }),
3471
+
3472
+ /***/ 75095:
3473
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3474
+
3475
+ "use strict";
3476
+
3477
+
3478
+ Object.defineProperty(exports, "__esModule", ({
3479
+ value: true
3480
+ }));
3481
+ exports.commandPauseProject = void 0;
3482
+ const child_process_promise_1 = __nccwpck_require__(51748);
3483
+ const defineCommand_1 = __nccwpck_require__(39489);
3484
+ const projects_1 = __nccwpck_require__(57414);
3485
+ const autocompletions_1 = __nccwpck_require__(52468);
3486
+ const availability_1 = __nccwpck_require__(1377);
3487
+ exports.commandPauseProject = (0, defineCommand_1.defineCommand)({
3488
+ name: "project k8s pause",
3489
+ description: "halts all running pods (scales to 0)",
3490
+ group: "project",
3491
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3492
+ inputs: {
3493
+ envComponent: {
3494
+ type: "string",
3495
+ message: "environment:component",
3496
+ positional: true,
3497
+ choices: async () => (0, autocompletions_1.envAndComponents)()
3498
+ }
3499
+ },
3500
+ execute: async ctx => {
3501
+ const envComponent = await ctx.get("envComponent");
3502
+ const namespace = await (0, projects_1.getProjectNamespace)(envComponent);
3503
+ const shouldContinue = await ctx.confirm("This will STOP all running pods. You will need to manually scale back up or re-deploy. Continue? 🤔 ");
3504
+ if (!shouldContinue) {
3505
+ return;
3506
+ }
3507
+ const fullCommand = `kubectl scale statefulset,deployment --all --replicas=0 --namespace=${namespace}`;
3508
+ const {
3509
+ stdout
3510
+ } = await (0, child_process_promise_1.exec)(fullCommand, {
3511
+ env: {
3512
+ ...process.env,
3513
+ DEBUG: ""
3514
+ }
3515
+ });
3516
+ ctx.log(stdout);
3517
+ }
3518
+ });
3519
+
3520
+ /***/ }),
3521
+
3522
+ /***/ 35815:
3435
3523
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3436
3524
 
3437
3525
  "use strict";
@@ -3448,6 +3536,7 @@ const log_1 = __nccwpck_require__(67253);
3448
3536
  const projects_1 = __nccwpck_require__(57414);
3449
3537
  const ensureCluster_1 = __nccwpck_require__(2490);
3450
3538
  const autocompletions_1 = __nccwpck_require__(52468);
3539
+ const availability_1 = __nccwpck_require__(1377);
3451
3540
  const getCronjobChoices = async namespace => {
3452
3541
  const {
3453
3542
  body: {
@@ -3480,7 +3569,7 @@ const runCronjob = async (io, namespace, jobName) => {
3480
3569
  }
3481
3570
  };
3482
3571
  exports.commandTriggerCronjobGeneral = (0, defineCommand_1.defineCommand)({
3483
- name: "kube trigger-cronjob",
3572
+ name: "k8s trigger-cronjob",
3484
3573
  description: "trigger cronjob",
3485
3574
  group: "general",
3486
3575
  inputs: {
@@ -3502,9 +3591,10 @@ exports.commandTriggerCronjobGeneral = (0, defineCommand_1.defineCommand)({
3502
3591
  }
3503
3592
  });
3504
3593
  exports.commandTriggerCronjobProject = (0, defineCommand_1.defineCommand)({
3505
- name: "project trigger-cronjob",
3594
+ name: "project k8s trigger-cronjob",
3506
3595
  description: "trigger cronjob",
3507
3596
  group: "project",
3597
+ isAvailable: (0, availability_1.hasDeployType)("kubernetes"),
3508
3598
  inputs: {
3509
3599
  envComponent: {
3510
3600
  type: "string",
@@ -3992,7 +4082,6 @@ exports.getJobOnlyEnvVarsResolved = exports.getEnvVarsResolved = exports.getGitl
3992
4082
  const pipeline_1 = __nccwpck_require__(60241);
3993
4083
  const gitlab_1 = __nccwpck_require__(4508);
3994
4084
  const projects_1 = __nccwpck_require__(57414);
3995
- const fs_1 = __nccwpck_require__(79896);
3996
4085
  var parseChoice_1 = __nccwpck_require__(64272);
3997
4086
  Object.defineProperty(exports, "parseChoice", ({
3998
4087
  enumerable: true,
@@ -4001,31 +4090,20 @@ Object.defineProperty(exports, "parseChoice", ({
4001
4090
  }
4002
4091
  }));
4003
4092
  let currentConfig = null;
4004
- // reload the config on change
4005
- const reloadConfigAndObserve = async () => {
4093
+ const loadConfig = async () => {
4006
4094
  const gitRoot = await (0, projects_1.getGitRoot)();
4007
4095
  if (!gitRoot) {
4008
4096
  return;
4009
4097
  }
4010
4098
  const result = await (0, pipeline_1.readConfig)(gitRoot);
4011
4099
  if (!result) {
4012
- // can't do anything, there is no config
4013
4100
  return;
4014
4101
  }
4015
- const {
4016
- config,
4017
- path
4018
- } = result;
4019
- const watcher = (0, fs_1.watch)(path, () => {
4020
- watcher.close();
4021
- reloadConfigAndObserve();
4022
- });
4023
- currentConfig = config;
4102
+ currentConfig = result.config;
4024
4103
  };
4025
4104
  const getProjectConfig = async () => {
4026
4105
  if (!currentConfig) {
4027
- // initially
4028
- await reloadConfigAndObserve();
4106
+ await loadConfig();
4029
4107
  }
4030
4108
  return currentConfig;
4031
4109
  };
@@ -4195,7 +4273,6 @@ exports.defineCommand = defineCommand;
4195
4273
  "use strict";
4196
4274
 
4197
4275
 
4198
- // ─── Input Definitions ───────────────────────────────────────────────
4199
4276
  Object.defineProperty(exports, "__esModule", ({
4200
4277
  value: true
4201
4278
  }));
@@ -6122,10 +6199,10 @@ const writeDotEnv_1 = __nccwpck_require__(65271);
6122
6199
  const uniqueAndAlphabeticalSort = arr => {
6123
6200
  return (0, lodash_1.uniq)(arr).sort((a, b) => a.localeCompare(b));
6124
6201
  };
6125
- const createBuildJobArtifacts = context => {
6202
+ const createBuildJobArtifacts = async context => {
6126
6203
  var _a, _b;
6127
- const paths = context.type === "workspace" ? context.components.flatMap(c => getArtifactsPathForComponent(c)) : getArtifactsPathForComponent(context, ["__build_info.json"]);
6128
- const exclude = context.type === "workspace" ? context.components.flatMap(c => getAllArtifactExcludePathsForComponent(c)) : getAllArtifactExcludePathsForComponent(context);
6204
+ const paths = context.type === "workspace" ? (await Promise.all(context.components.map(c => getArtifactsPathForComponent(c)))).flat() : await getArtifactsPathForComponent(context, ["__build_info.json"]);
6205
+ const exclude = context.type === "workspace" ? (await Promise.all(context.components.map(c => getAllArtifactExcludePathsForComponent(c)))).flat() : await getAllArtifactExcludePathsForComponent(context);
6129
6206
  return {
6130
6207
  paths: uniqueAndAlphabeticalSort(paths),
6131
6208
  ...(exclude.length > 0 ? {
@@ -6141,21 +6218,21 @@ const createBuildJobArtifacts = context => {
6141
6218
  };
6142
6219
  };
6143
6220
  exports.createBuildJobArtifacts = createBuildJobArtifacts;
6144
- const _getArtifactPathsForComponent = (c, configKey, additionalPaths) => {
6221
+ const _getArtifactPathsForComponent = async (c, configKey, additionalPaths) => {
6145
6222
  var _a, _b;
6146
- return (_b = [...(c.build.type !== "disabled" ? (_a = c.build.config[configKey]) !== null && _a !== void 0 ? _a : [] : []), ...(additionalPaths !== null && additionalPaths !== void 0 ? additionalPaths : [])]) === null || _b === void 0 ? void 0 : _b.flatMap(artifact => c.build
6147
6223
  // in theory, we only need "direct",
6148
6224
  // but in some cases project may have packages in the workspace that create build artifacts, which aren't components
6149
6225
  // this highly depends on the build tool. To be safe, we get all
6150
- .getComponentDirs("all").flatMap(cDir => (0, path_1.join)(cDir, artifact)));
6226
+ const componentDirs = await c.build.getComponentDirs("all");
6227
+ return (_b = [...(c.build.type !== "disabled" ? (_a = c.build.config[configKey]) !== null && _a !== void 0 ? _a : [] : []), ...(additionalPaths !== null && additionalPaths !== void 0 ? additionalPaths : [])]) === null || _b === void 0 ? void 0 : _b.flatMap(artifact => componentDirs.flatMap(cDir => (0, path_1.join)(cDir, artifact)));
6151
6228
  };
6152
6229
  const getArtifactsPathForComponent = (c, additionalPaths) => {
6153
6230
  return _getArtifactPathsForComponent(c, "artifactsPaths", additionalPaths);
6154
6231
  };
6155
- const getAllArtifactExcludePathsForComponent = c => {
6232
+ const getAllArtifactExcludePathsForComponent = async c => {
6156
6233
  return [...getDotEnvPathsForComponent(c),
6157
6234
  // always exclude .env files
6158
- ...getArtifactExcludePathsForComponent(c)];
6235
+ ...(await getArtifactExcludePathsForComponent(c))];
6159
6236
  };
6160
6237
  const getArtifactExcludePathsForComponent = (c, additionalPaths) => {
6161
6238
  return _getArtifactPathsForComponent(c, "artifactsExcludePaths", additionalPaths);
@@ -6207,7 +6284,7 @@ const yarn_1 = __nccwpck_require__(78897);
6207
6284
  const constants_1 = __nccwpck_require__(2727);
6208
6285
  const writeBuildInfo_1 = __nccwpck_require__(22877);
6209
6286
  const writeDotEnv_1 = __nccwpck_require__(65271);
6210
- const createAppBuildJob = (context, {
6287
+ const createAppBuildJob = async (context, {
6211
6288
  script,
6212
6289
  variables,
6213
6290
  runnerVariables,
@@ -6237,7 +6314,7 @@ const createAppBuildJob = (context, {
6237
6314
  script: [...(context.type === "component" ? (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context) ? (0, writeDotEnv_1.writeDotEnv)(context) : [] : context.type === "workspace" ? context.components.filter(c => (0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(c)).flatMap(c => (0, writeDotEnv_1.writeDotEnv)(c)) : []), ...(context.type === "component" ? (0, writeBuildInfo_1.writeBuildInfo)(context) : []), ...(0, yarn_1.ensureNodeVersion)(context),
6238
6315
  // in pure node repos, we might want to have the nvmrc file in top-level
6239
6316
  `cd ${context.build.dir}`, ...(0, utils_1.ensureArray)(script)],
6240
- artifacts: (0, createBuildJobArtifact_1.createBuildJobArtifacts)(context)
6317
+ artifacts: await (0, createBuildJobArtifact_1.createBuildJobArtifacts)(context)
6241
6318
  }, def);
6242
6319
  };
6243
6320
  exports.createAppBuildJob = createAppBuildJob;
@@ -6317,9 +6394,9 @@ const context_1 = __nccwpck_require__(73660);
6317
6394
  const docker_1 = __nccwpck_require__(12764);
6318
6395
  const constants_1 = __nccwpck_require__(2727);
6319
6396
  const createAppBuildJob_1 = __nccwpck_require__(21950);
6320
- const createComponentBuildJobs = (context, definitions) => {
6397
+ const createComponentBuildJobs = async (context, definitions) => {
6321
6398
  var _a;
6322
- return [...(definitions.appBuild && (0, context_1.componentContextIsStandaloneBuild)(context) ? [(0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)] : []), ...((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobBase)(context, {
6399
+ return [...(definitions.appBuild && (0, context_1.componentContextIsStandaloneBuild)(context) ? [await (0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)] : []), ...((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobBase)(context, {
6323
6400
  ...definitions.dockerBuild,
6324
6401
  needs: [...((_a = definitions.dockerBuild.needs) !== null && _a !== void 0 ? _a : []), ...(definitions.appBuild && (0, context_1.componentContextIsStandaloneBuild)(context) ? [constants_1.APP_BUILD_JOB_NAME] : (0, context_1.componentContextHasWorkspaceBuild)(context) ? [{
6325
6402
  job: constants_1.APP_BUILD_JOB_NAME,
@@ -6329,8 +6406,8 @@ const createComponentBuildJobs = (context, definitions) => {
6329
6406
  })] : [])];
6330
6407
  };
6331
6408
  exports.createComponentBuildJobs = createComponentBuildJobs;
6332
- const createWorkspaceBuildJobs = (context, definitions) => {
6333
- return definitions.appBuild ? [(0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)] : [];
6409
+ const createWorkspaceBuildJobs = async (context, definitions) => {
6410
+ return definitions.appBuild ? [await (0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)] : [];
6334
6411
  };
6335
6412
  exports.createWorkspaceBuildJobs = createWorkspaceBuildJobs;
6336
6413
 
@@ -6529,7 +6606,7 @@ const docker_1 = __nccwpck_require__(12764);
6529
6606
  const types_1 = __nccwpck_require__(89851);
6530
6607
  const base_1 = __nccwpck_require__(80502);
6531
6608
  const createBuildJobDefinition_1 = __nccwpck_require__(26254);
6532
- const createCustomBuildJobs = context => {
6609
+ const createCustomBuildJobs = async context => {
6533
6610
  const buildConfig = context.build.config;
6534
6611
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
6535
6612
  throw new Error("deploy config is not custom");
@@ -6558,8 +6635,8 @@ Object.defineProperty(exports, "__esModule", ({
6558
6635
  exports.createCustomJobs = void 0;
6559
6636
  const buildJob_1 = __nccwpck_require__(90985);
6560
6637
  const testJob_1 = __nccwpck_require__(87039);
6561
- const createCustomJobs = context => {
6562
- return [...(0, testJob_1.createCustomTestJobs)(context), ...(0, buildJob_1.createCustomBuildJobs)(context)];
6638
+ const createCustomJobs = async context => {
6639
+ return [...(0, testJob_1.createCustomTestJobs)(context), ...(await (0, buildJob_1.createCustomBuildJobs)(context))];
6563
6640
  };
6564
6641
  exports.createCustomJobs = createCustomJobs;
6565
6642
 
@@ -7303,7 +7380,7 @@ const __1 = __nccwpck_require__(60241);
7303
7380
  const base_1 = __nccwpck_require__(80502);
7304
7381
  const docker_1 = __nccwpck_require__(12764);
7305
7382
  const types_1 = __nccwpck_require__(89851);
7306
- const createRailsBuildJobs = context => {
7383
+ const createRailsBuildJobs = async context => {
7307
7384
  var _a, _b, _c;
7308
7385
  const buildConfig = context.build.config;
7309
7386
  if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
@@ -7354,8 +7431,8 @@ Object.defineProperty(exports, "__esModule", ({
7354
7431
  exports.createRailsJobs = void 0;
7355
7432
  const build_1 = __nccwpck_require__(93188);
7356
7433
  const testJob_1 = __nccwpck_require__(87983);
7357
- const createRailsJobs = context => {
7358
- return [...(0, testJob_1.createRailsTestJobs)(context), ...(0, build_1.createRailsBuildJobs)(context)];
7434
+ const createRailsJobs = async context => {
7435
+ return [...(0, testJob_1.createRailsTestJobs)(context), ...(await (0, build_1.createRailsBuildJobs)(context))];
7359
7436
  };
7360
7437
  exports.createRailsJobs = createRailsJobs;
7361
7438
 
@@ -7630,7 +7707,7 @@ Object.defineProperty(exports, "__esModule", ({
7630
7707
  value: true
7631
7708
  }));
7632
7709
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
7633
- exports.PIPELINE_IMAGE_TAG = "main-e126076c" || 0;
7710
+ exports.PIPELINE_IMAGE_TAG = "main-4888e4df" || 0;
7634
7711
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
7635
7712
 
7636
7713
  /***/ }),
@@ -7706,18 +7783,18 @@ const createComponentContext = async ctx => {
7706
7783
  deploy: {}
7707
7784
  };
7708
7785
  const componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
7709
- const [environment, packageManagerInfo] = await Promise.all([(0, getEnvironment_1.getEnvironment)(ctx), packageManagerInfoPromise]);
7786
+ const environment = await (0, getEnvironment_1.getEnvironment)(ctx);
7710
7787
  const {
7711
7788
  deploy,
7712
7789
  build,
7713
7790
  customJobs,
7714
7791
  dir
7715
7792
  } = componentConfig;
7716
- const getComponentDirs = mode => {
7793
+ const getComponentDirs = async mode => {
7717
7794
  var _a;
7718
7795
  return [dir,
7719
7796
  // also copy workspace dependencies in monorepo if packages are shared and they create build artifacts
7720
- ...(mode === "all" ? (_a = packageManagerInfo.currentWorkspaceDependencies) !== null && _a !== void 0 ? _a : [] : [])];
7797
+ ...(mode === "all" ? (_a = (await packageManagerInfoPromise).currentWorkspaceDependencies) !== null && _a !== void 0 ? _a : [] : [])];
7721
7798
  };
7722
7799
  const _getBuildContext = () => {
7723
7800
  var _a;
@@ -7820,7 +7897,7 @@ async function createWorkspaceContext({
7820
7897
  build: {
7821
7898
  type: "workspace",
7822
7899
  dir: (_b = workspaceConfig.dir) !== null && _b !== void 0 ? _b : ".",
7823
- getComponentDirs: mode => (0, lodash_1.uniq)(components.flatMap(c => c.build.getComponentDirs(mode))),
7900
+ getComponentDirs: async mode => (0, lodash_1.uniq)((await Promise.all(components.map(c => c.build.getComponentDirs(mode)))).flat()),
7824
7901
  buildType: workspaceConfig.type,
7825
7902
  config: workspaceConfig
7826
7903
  }
@@ -97799,7 +97876,7 @@ tslib_1.__exportStar(__nccwpck_require__(33729), exports);
97799
97876
  tslib_1.__exportStar(__nccwpck_require__(57737), exports);
97800
97877
  tslib_1.__exportStar(__nccwpck_require__(84589), exports);
97801
97878
  tslib_1.__exportStar(__nccwpck_require__(84202), exports);
97802
- tslib_1.__exportStar(__nccwpck_require__(84386), exports);
97879
+ tslib_1.__exportStar(__nccwpck_require__(62005), exports);
97803
97880
  tslib_1.__exportStar(__nccwpck_require__(54895), exports);
97804
97881
  tslib_1.__exportStar(__nccwpck_require__(31038), exports);
97805
97882
  tslib_1.__exportStar(__nccwpck_require__(72975), exports);
@@ -98324,7 +98401,7 @@ const v1PodStatus_1 = __nccwpck_require__(33729);
98324
98401
  const v1PodTemplate_1 = __nccwpck_require__(57737);
98325
98402
  const v1PodTemplateList_1 = __nccwpck_require__(84589);
98326
98403
  const v1PodTemplateSpec_1 = __nccwpck_require__(84202);
98327
- const v1PolicyRule_1 = __nccwpck_require__(84386);
98404
+ const v1PolicyRule_1 = __nccwpck_require__(62005);
98328
98405
  const v1PortStatus_1 = __nccwpck_require__(54895);
98329
98406
  const v1PortworxVolumeSource_1 = __nccwpck_require__(31038);
98330
98407
  const v1Preconditions_1 = __nccwpck_require__(72975);
@@ -113486,7 +113563,7 @@ V1PodTemplateSpec.attributeTypeMap = [
113486
113563
 
113487
113564
  /***/ }),
113488
113565
 
113489
- /***/ 84386:
113566
+ /***/ 62005:
113490
113567
  /***/ ((__unused_webpack_module, exports) => {
113491
113568
 
113492
113569
  "use strict";
@@ -140081,7 +140158,7 @@ module.exports.canonicalizeResource = canonicalizeResource
140081
140158
 
140082
140159
  /***/ }),
140083
140160
 
140084
- /***/ 23526:
140161
+ /***/ 1145:
140085
140162
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
140086
140163
 
140087
140164
  var aws4 = exports,
@@ -178754,7 +178831,7 @@ module.exports = Object.assign(
178754
178831
  __nccwpck_require__(58937),
178755
178832
  __nccwpck_require__(35553),
178756
178833
  __nccwpck_require__(1063),
178757
- __nccwpck_require__(1145),
178834
+ __nccwpck_require__(23526),
178758
178835
  __nccwpck_require__(90782),
178759
178836
  __nccwpck_require__(84338),
178760
178837
  __nccwpck_require__(62535),
@@ -179066,7 +179143,7 @@ module.exports = {
179066
179143
 
179067
179144
  /***/ }),
179068
179145
 
179069
- /***/ 1145:
179146
+ /***/ 23526:
179070
179147
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
179071
179148
 
179072
179149
  "use strict";
@@ -189788,7 +189865,7 @@ module.exports = {
189788
189865
 
189789
189866
  'eucjp': {
189790
189867
  type: '_dbcs',
189791
- table: function() { return __nccwpck_require__(62005) },
189868
+ table: function() { return __nccwpck_require__(84386) },
189792
189869
  encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
189793
189870
  },
189794
189871
 
@@ -242566,7 +242643,7 @@ var util = __nccwpck_require__(39023)
242566
242643
  var stream = __nccwpck_require__(2203)
242567
242644
  var zlib = __nccwpck_require__(43106)
242568
242645
  var aws2 = __nccwpck_require__(16199)
242569
- var aws4 = __nccwpck_require__(23526)
242646
+ var aws4 = __nccwpck_require__(1145)
242570
242647
  var httpSignature = __nccwpck_require__(36513)
242571
242648
  var mime = __nccwpck_require__(29322)
242572
242649
  var caseless = __nccwpck_require__(8279)
@@ -301643,7 +301720,7 @@ module.exports = /*#__PURE__*/JSON.parse('[["0","\\u0000",127],["a140"," ,
301643
301720
 
301644
301721
  /***/ }),
301645
301722
 
301646
- /***/ 62005:
301723
+ /***/ 84386:
301647
301724
  /***/ ((module) => {
301648
301725
 
301649
301726
  "use strict";
@@ -301823,4 +301900,5 @@ module.exports = /*#__PURE__*/JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45
301823
301900
  /******/ module.exports = __webpack_exports__;
301824
301901
  /******/
301825
301902
  /******/ })()
301826
- ;
301903
+ ;
301904
+ //# sourceMappingURL=index.js.map