@vaharoni/devops 1.2.13 → 1.2.14

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 (323) hide show
  1. package/dist/chunk-N7EX3HJH.js +139 -0
  2. package/dist/chunk-RZ46YYZZ.js +420 -0
  3. package/dist/chunk-WKP7EQNU.js +421 -0
  4. package/dist/devops.d.ts +0 -2
  5. package/dist/devops.js +3235 -91
  6. package/dist/index.d.ts +972 -4
  7. package/dist/index.js +67 -3
  8. package/dist/plugins.d.ts +95 -4
  9. package/dist/plugins.js +20 -6
  10. package/dist/src/target-templates/README.md +1 -0
  11. package/dist/src/target-templates/cluster-resource-options/README.md +2 -0
  12. package/dist/src/target-templates/cluster-resource-options/dns-test/dns-test.yaml +60 -0
  13. package/dist/src/target-templates/cluster-resource-options/milvus/production/milvus-values.yaml +2 -0
  14. package/dist/src/target-templates/cluster-resource-options/milvus/staging/milvus-values.yaml +2 -0
  15. package/dist/src/target-templates/cluster-resource-options/monitoring-ingress/monitoring-ingress.yaml +62 -0
  16. package/dist/src/target-templates/cluster-resource-options/postgres/daily-operator-restart.yaml +54 -0
  17. package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/PodDisruptionBudget.yaml +27 -0
  18. package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/SGCluster.yaml +47 -0
  19. package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/StackGres-alerts.yaml +191 -0
  20. package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/06-SGDistributedLogs.yaml +11 -0
  21. package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/07-SGObjectStorage.yaml +18 -0
  22. package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/08-SGScript.yaml +12 -0
  23. package/dist/src/target-templates/cluster-resource-options/postgres/stackgres-ui-ingress.yaml +35 -0
  24. package/dist/src/target-templates/cluster-resource-options/postgres/staging/cluster/SGCluster.yaml +42 -0
  25. package/dist/src/target-templates/cluster-resource-options/postgres/staging/configurations/07-SGObjectStorage.yaml +18 -0
  26. package/dist/src/target-templates/cluster-resource-options/postgres/staging/configurations/08-SGScript.yaml +12 -0
  27. package/dist/src/target-templates/cluster-resource-options/prefect/production/prefect-values.yaml +14 -0
  28. package/dist/src/target-templates/cluster-resource-options/prefect/staging/prefect-values.yaml +14 -0
  29. package/dist/src/target-templates/cluster-resource-options/redis/production/redis-values.yaml +20 -0
  30. package/dist/src/target-templates/cluster-resource-options/redis/staging/redis-values.yaml +8 -0
  31. package/dist/src/target-templates/infra-variants/README.md +2 -0
  32. package/dist/src/target-templates/infra-variants/digitalocean/.devops/config/constants.yaml +18 -0
  33. package/dist/src/target-templates/infra-variants/digitalocean/.github/workflows/k8s-build.yaml +91 -0
  34. package/dist/src/target-templates/infra-variants/gcloud/.devops/config/constants.yaml +15 -0
  35. package/dist/src/target-templates/infra-variants/gcloud/.devops/manifests/ingress.yaml.hb +22 -0
  36. package/dist/src/target-templates/infra-variants/gcloud/.github/workflows/k8s-build.yaml +95 -0
  37. package/dist/src/target-templates/infra-variants/hetzner/.devops/config/constants.yaml +18 -0
  38. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/abandoned/harbor-values.yaml +30 -0
  39. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/abandoned/hcloud-config.yaml +134 -0
  40. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/cert-manager.yaml +25 -0
  41. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-cert.yaml +13 -0
  42. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-values.yaml +76 -0
  43. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/hcloud-config.yaml +113 -0
  44. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/ingress-nginx-annotations.yaml +49 -0
  45. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/ingress-nginx-configmap.yaml +8 -0
  46. package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/retain-storage-class.yaml +8 -0
  47. package/dist/src/target-templates/infra-variants/hetzner/.github/workflows/k8s-build.yaml +93 -0
  48. package/dist/src/target-templates/lang-variants-common/README.md +4 -0
  49. package/dist/src/target-templates/lang-variants-common/python/.cursor/rules/monorepo-python.mdc +56 -0
  50. package/dist/src/target-templates/lang-variants-common/python/.devops/config/images.yaml +89 -0
  51. package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services/python-exec.sh +8 -0
  52. package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services/python-run.sh +8 -0
  53. package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services.Dockerfile +29 -0
  54. package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/_index.yaml +21 -0
  55. package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/prefect.yaml.hb +63 -0
  56. package/dist/src/target-templates/lang-variants-common/python/applications/example-data-pipeline/pyproject.toml +14 -0
  57. package/dist/src/target-templates/lang-variants-common/python/applications/example-data-pipeline/src/example_data_pipeline/main.py +38 -0
  58. package/dist/src/target-templates/lang-variants-common/python/applications/example-python/pyproject.toml +20 -0
  59. package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/__init__.py +0 -0
  60. package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/main.py +13 -0
  61. package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/scripts.py +17 -0
  62. package/dist/src/target-templates/lang-variants-common/python/applications/example-python/tests/__init__.py +0 -0
  63. package/dist/src/target-templates/lang-variants-common/python/devopspy +3 -0
  64. package/dist/src/target-templates/lang-variants-common/python/libs/example-python-lib/pyproject.toml +11 -0
  65. package/dist/src/target-templates/lang-variants-common/python/libs/example-python-lib/src/example_python_lib/__init__.py +2 -0
  66. package/dist/src/target-templates/lang-variants-common/python/pyproject.toml +16 -0
  67. package/dist/src/target-templates/lang-variants-common/typescript/.cursor/rules/monorepo-typescript.mdc +51 -0
  68. package/dist/src/target-templates/lang-variants-common/typescript/.devops/config/images.yaml +69 -0
  69. package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/cloudrun.Dockerfile +31 -0
  70. package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/common/docker-common.sh +23 -0
  71. package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services/node-exec.sh +8 -0
  72. package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services/node-run.sh +8 -0
  73. package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services.Dockerfile +31 -0
  74. package/dist/src/target-templates/lang-variants-common/typescript/.devops/env.example.yaml +23 -0
  75. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/_index.yaml +19 -0
  76. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/cron-jobs.yaml.hb +56 -0
  77. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/db-migrate-job.yaml.hb +43 -0
  78. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-debug.yaml.hb +42 -0
  79. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-process.yaml.hb +48 -0
  80. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-web.yaml.hb +54 -0
  81. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/ingress.yaml.hb +21 -0
  82. package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/service.yaml.hb +15 -0
  83. package/dist/src/target-templates/lang-variants-common/typescript/.envrc +5 -0
  84. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/build-image@v1/action.yaml +81 -0
  85. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-digital-ocean@v1/action.yaml +29 -0
  86. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-gke@v1/action.yaml +43 -0
  87. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-hetzner@v1/action.yaml +31 -0
  88. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/db-migrate@v1/action.yaml +23 -0
  89. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/deploy-image-cloudrun@v1/action.yaml +71 -0
  90. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/deploy-image-k8s@v1/action.yaml +37 -0
  91. package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/setup-prereq@v1/action.yaml +24 -0
  92. package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/index.ts +30 -0
  93. package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/package.json +26 -0
  94. package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/tsconfig.json +3 -0
  95. package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/README.md +68 -0
  96. package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/index.ts +1 -0
  97. package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/package.json +30 -0
  98. package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/tsconfig.json +3 -0
  99. package/dist/src/target-templates/lang-variants-common/typescript/config/.env.development +1 -0
  100. package/dist/src/target-templates/lang-variants-common/typescript/config/.env.global +4 -0
  101. package/dist/src/target-templates/lang-variants-common/typescript/config/.env.test +1 -0
  102. package/dist/src/target-templates/lang-variants-common/typescript/devops +3 -0
  103. package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/index.ts +3 -0
  104. package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/package.json +12 -0
  105. package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/tsconfig.json +3 -0
  106. package/dist/src/target-templates/lang-variants-common/typescript/tmp/.gitkeep +0 -0
  107. package/dist/src/target-templates/lang-variants-common/typescript/tsconfig.json +27 -0
  108. package/dist/src/target-templates/lang-variants-prisma/README.md +3 -0
  109. package/dist/src/target-templates/lang-variants-prisma/python/.cursor/rules/prisma-python.mdc +55 -0
  110. package/dist/src/target-templates/lang-variants-prisma/python/.cursor/rules/testing-python.mdc +89 -0
  111. package/dist/src/target-templates/lang-variants-prisma/python/db/db/__init__.py +0 -0
  112. package/dist/src/target-templates/lang-variants-prisma/python/db/db/db_client_test.py +46 -0
  113. package/dist/src/target-templates/lang-variants-prisma/python/db/pyproject.toml +14 -0
  114. package/dist/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/prisma-typescript.mdc +54 -0
  115. package/dist/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/testing-typescript.mdc +103 -0
  116. package/dist/src/target-templates/lang-variants-prisma/typescript/db/db-client-test.ts +142 -0
  117. package/dist/src/target-templates/lang-variants-prisma/typescript/db/db-client.ts +19 -0
  118. package/dist/src/target-templates/lang-variants-prisma/typescript/db/env.yaml +4 -0
  119. package/dist/src/target-templates/lang-variants-prisma/typescript/db/package.json +17 -0
  120. package/dist/src/target-templates/lang-variants-prisma/typescript/db/prisma/schema.prisma +24 -0
  121. package/dist/src/target-templates/lang-variants-prisma/typescript/db/prisma-setup-vitest.ts +27 -0
  122. package/dist/src/target-templates/lang-variants-prisma/typescript/db/tsconfig.json +3 -0
  123. package/dist/src/target-templates/lang-variants-prisma/typescript/dml/package.json +7 -0
  124. package/dist/src/target-templates/lang-variants-prisma/typescript/dml/tsconfig.json +3 -0
  125. package/package.json +3 -2
  126. package/src/cli/core/exec.ts +2 -4
  127. package/src/cli/core/run.ts +2 -4
  128. package/src/cli/extensions/prisma.ts +2 -4
  129. package/src/libs/init-generator.ts +2 -4
  130. package/src/pkg-root.ts +14 -0
  131. package/src/plugins.ts +2 -4
  132. package/dist/app-support/crypto/aes.d.ts +0 -15
  133. package/dist/app-support/crypto/aes.d.ts.map +0 -1
  134. package/dist/app-support/crypto/aes.js +0 -56
  135. package/dist/app-support/crypto/aes.spec.d.ts +0 -2
  136. package/dist/app-support/crypto/aes.spec.d.ts.map +0 -1
  137. package/dist/app-support/crypto/aes.spec.js +0 -58
  138. package/dist/app-support/crypto/index.d.ts +0 -16
  139. package/dist/app-support/crypto/index.d.ts.map +0 -1
  140. package/dist/app-support/crypto/index.js +0 -31
  141. package/dist/app-support/crypto/internal-token.d.ts +0 -20
  142. package/dist/app-support/crypto/internal-token.d.ts.map +0 -1
  143. package/dist/app-support/crypto/internal-token.js +0 -42
  144. package/dist/app-support/crypto/internal-token.spec.d.ts +0 -2
  145. package/dist/app-support/crypto/internal-token.spec.d.ts.map +0 -1
  146. package/dist/app-support/crypto/internal-token.spec.js +0 -45
  147. package/dist/app-support/crypto/secret.d.ts +0 -3
  148. package/dist/app-support/crypto/secret.d.ts.map +0 -1
  149. package/dist/app-support/crypto/secret.js +0 -12
  150. package/dist/app-support/crypto/secret.spec.d.ts +0 -2
  151. package/dist/app-support/crypto/secret.spec.d.ts.map +0 -1
  152. package/dist/app-support/crypto/secret.spec.js +0 -15
  153. package/dist/app-support/discovery/dev-discovery-loader.d.ts +0 -2
  154. package/dist/app-support/discovery/dev-discovery-loader.d.ts.map +0 -1
  155. package/dist/app-support/discovery/dev-discovery-loader.js +0 -30
  156. package/dist/app-support/discovery/service-endpoint.d.ts +0 -2
  157. package/dist/app-support/discovery/service-endpoint.d.ts.map +0 -1
  158. package/dist/app-support/discovery/service-endpoint.js +0 -10
  159. package/dist/cli/common.d.ts +0 -89
  160. package/dist/cli/common.d.ts.map +0 -1
  161. package/dist/cli/common.js +0 -246
  162. package/dist/cli/common.spec.d.ts +0 -2
  163. package/dist/cli/common.spec.d.ts.map +0 -1
  164. package/dist/cli/common.spec.js +0 -64
  165. package/dist/cli/core/affected.d.ts +0 -9
  166. package/dist/cli/core/affected.d.ts.map +0 -1
  167. package/dist/cli/core/affected.js +0 -101
  168. package/dist/cli/core/cloudrun.d.ts +0 -9
  169. package/dist/cli/core/cloudrun.d.ts.map +0 -1
  170. package/dist/cli/core/cloudrun.js +0 -119
  171. package/dist/cli/core/console.d.ts +0 -10
  172. package/dist/cli/core/console.d.ts.map +0 -1
  173. package/dist/cli/core/console.js +0 -50
  174. package/dist/cli/core/constant.d.ts +0 -9
  175. package/dist/cli/core/constant.d.ts.map +0 -1
  176. package/dist/cli/core/constant.js +0 -20
  177. package/dist/cli/core/env.d.ts +0 -9
  178. package/dist/cli/core/env.d.ts.map +0 -1
  179. package/dist/cli/core/env.js +0 -65
  180. package/dist/cli/core/exec.d.ts +0 -9
  181. package/dist/cli/core/exec.d.ts.map +0 -1
  182. package/dist/cli/core/exec.js +0 -48
  183. package/dist/cli/core/image.d.ts +0 -9
  184. package/dist/cli/core/image.d.ts.map +0 -1
  185. package/dist/cli/core/image.js +0 -153
  186. package/dist/cli/core/index.d.ts +0 -16
  187. package/dist/cli/core/index.d.ts.map +0 -1
  188. package/dist/cli/core/index.js +0 -15
  189. package/dist/cli/core/init.d.ts +0 -9
  190. package/dist/cli/core/init.d.ts.map +0 -1
  191. package/dist/cli/core/init.js +0 -219
  192. package/dist/cli/core/job.d.ts +0 -9
  193. package/dist/cli/core/job.d.ts.map +0 -1
  194. package/dist/cli/core/job.js +0 -65
  195. package/dist/cli/core/namespace.d.ts +0 -9
  196. package/dist/cli/core/namespace.d.ts.map +0 -1
  197. package/dist/cli/core/namespace.js +0 -67
  198. package/dist/cli/core/prep-build.d.ts +0 -10
  199. package/dist/cli/core/prep-build.d.ts.map +0 -1
  200. package/dist/cli/core/prep-build.js +0 -109
  201. package/dist/cli/core/registry.d.ts +0 -9
  202. package/dist/cli/core/registry.d.ts.map +0 -1
  203. package/dist/cli/core/registry.js +0 -66
  204. package/dist/cli/core/run-many.d.ts +0 -10
  205. package/dist/cli/core/run-many.d.ts.map +0 -1
  206. package/dist/cli/core/run-many.js +0 -48
  207. package/dist/cli/core/run.d.ts +0 -9
  208. package/dist/cli/core/run.d.ts.map +0 -1
  209. package/dist/cli/core/run.js +0 -35
  210. package/dist/cli/core/test.d.ts +0 -9
  211. package/dist/cli/core/test.d.ts.map +0 -1
  212. package/dist/cli/core/test.js +0 -26
  213. package/dist/cli/extensions/dml.d.ts +0 -9
  214. package/dist/cli/extensions/dml.d.ts.map +0 -1
  215. package/dist/cli/extensions/dml.js +0 -114
  216. package/dist/cli/extensions/index.d.ts +0 -9
  217. package/dist/cli/extensions/index.d.ts.map +0 -1
  218. package/dist/cli/extensions/index.js +0 -8
  219. package/dist/cli/extensions/internal-curl.d.ts +0 -10
  220. package/dist/cli/extensions/internal-curl.d.ts.map +0 -1
  221. package/dist/cli/extensions/internal-curl.js +0 -41
  222. package/dist/cli/extensions/jwt.d.ts +0 -9
  223. package/dist/cli/extensions/jwt.d.ts.map +0 -1
  224. package/dist/cli/extensions/jwt.js +0 -25
  225. package/dist/cli/extensions/prisma.d.ts +0 -9
  226. package/dist/cli/extensions/prisma.d.ts.map +0 -1
  227. package/dist/cli/extensions/prisma.js +0 -23
  228. package/dist/cli/extensions/redis-bitnami.d.ts +0 -11
  229. package/dist/cli/extensions/redis-bitnami.d.ts.map +0 -1
  230. package/dist/cli/extensions/redis-bitnami.js +0 -74
  231. package/dist/cli/extensions/redis-ha.d.ts +0 -11
  232. package/dist/cli/extensions/redis-ha.d.ts.map +0 -1
  233. package/dist/cli/extensions/redis-ha.js +0 -51
  234. package/dist/cli/extensions/stackgres.d.ts +0 -10
  235. package/dist/cli/extensions/stackgres.d.ts.map +0 -1
  236. package/dist/cli/extensions/stackgres.js +0 -117
  237. package/dist/cli/extensions/template.d.ts +0 -9
  238. package/dist/cli/extensions/template.d.ts.map +0 -1
  239. package/dist/cli/extensions/template.js +0 -121
  240. package/dist/devops.d.ts.map +0 -1
  241. package/dist/index.d.ts.map +0 -1
  242. package/dist/libs/affected-entities.d.ts +0 -15
  243. package/dist/libs/affected-entities.d.ts.map +0 -1
  244. package/dist/libs/affected-entities.js +0 -52
  245. package/dist/libs/cloudrun-helpers.d.ts +0 -16
  246. package/dist/libs/cloudrun-helpers.d.ts.map +0 -1
  247. package/dist/libs/cloudrun-helpers.js +0 -81
  248. package/dist/libs/config.d.ts +0 -7
  249. package/dist/libs/config.d.ts.map +0 -1
  250. package/dist/libs/config.js +0 -102
  251. package/dist/libs/digital-ocean/container-reg.d.ts +0 -6
  252. package/dist/libs/digital-ocean/container-reg.d.ts.map +0 -1
  253. package/dist/libs/digital-ocean/container-reg.js +0 -74
  254. package/dist/libs/discovery/dependencies.d.ts +0 -19
  255. package/dist/libs/discovery/dependencies.d.ts.map +0 -1
  256. package/dist/libs/discovery/dependencies.js +0 -62
  257. package/dist/libs/discovery/dependencies.spec.d.ts +0 -2
  258. package/dist/libs/discovery/dependencies.spec.d.ts.map +0 -1
  259. package/dist/libs/discovery/dependencies.spec.js +0 -21
  260. package/dist/libs/discovery/images.d.ts +0 -5
  261. package/dist/libs/discovery/images.d.ts.map +0 -1
  262. package/dist/libs/discovery/images.js +0 -45
  263. package/dist/libs/discovery/index.d.ts +0 -6
  264. package/dist/libs/discovery/index.d.ts.map +0 -1
  265. package/dist/libs/discovery/index.js +0 -67
  266. package/dist/libs/discovery/process-common.d.ts +0 -25
  267. package/dist/libs/discovery/process-common.d.ts.map +0 -1
  268. package/dist/libs/discovery/process-common.js +0 -40
  269. package/dist/libs/discovery/process-package-json.d.ts +0 -3
  270. package/dist/libs/discovery/process-package-json.d.ts.map +0 -1
  271. package/dist/libs/discovery/process-package-json.js +0 -40
  272. package/dist/libs/discovery/process-pyproject-toml.d.ts +0 -3
  273. package/dist/libs/discovery/process-pyproject-toml.d.ts.map +0 -1
  274. package/dist/libs/discovery/process-pyproject-toml.js +0 -49
  275. package/dist/libs/git-helpers.d.ts +0 -8
  276. package/dist/libs/git-helpers.d.ts.map +0 -1
  277. package/dist/libs/git-helpers.js +0 -20
  278. package/dist/libs/hetzner/reg-secret.d.ts +0 -3
  279. package/dist/libs/hetzner/reg-secret.d.ts.map +0 -1
  280. package/dist/libs/hetzner/reg-secret.js +0 -39
  281. package/dist/libs/init-generator.d.ts +0 -41
  282. package/dist/libs/init-generator.d.ts.map +0 -1
  283. package/dist/libs/init-generator.js +0 -123
  284. package/dist/libs/k8s-constants.d.ts +0 -13
  285. package/dist/libs/k8s-constants.d.ts.map +0 -1
  286. package/dist/libs/k8s-constants.js +0 -91
  287. package/dist/libs/k8s-db.d.ts +0 -18
  288. package/dist/libs/k8s-db.d.ts.map +0 -1
  289. package/dist/libs/k8s-db.js +0 -73
  290. package/dist/libs/k8s-generate.d.ts +0 -17
  291. package/dist/libs/k8s-generate.d.ts.map +0 -1
  292. package/dist/libs/k8s-generate.js +0 -193
  293. package/dist/libs/k8s-helpers.d.ts +0 -11
  294. package/dist/libs/k8s-helpers.d.ts.map +0 -1
  295. package/dist/libs/k8s-helpers.js +0 -42
  296. package/dist/libs/k8s-image-config.d.ts +0 -8
  297. package/dist/libs/k8s-image-config.d.ts.map +0 -1
  298. package/dist/libs/k8s-image-config.js +0 -113
  299. package/dist/libs/k8s-job-waiter.d.ts +0 -8
  300. package/dist/libs/k8s-job-waiter.d.ts.map +0 -1
  301. package/dist/libs/k8s-job-waiter.js +0 -84
  302. package/dist/libs/k8s-namespace.d.ts +0 -7
  303. package/dist/libs/k8s-namespace.d.ts.map +0 -1
  304. package/dist/libs/k8s-namespace.js +0 -27
  305. package/dist/libs/k8s-redis-bitnami.d.ts +0 -6
  306. package/dist/libs/k8s-redis-bitnami.d.ts.map +0 -1
  307. package/dist/libs/k8s-redis-bitnami.js +0 -31
  308. package/dist/libs/k8s-redis-ha.d.ts +0 -3
  309. package/dist/libs/k8s-redis-ha.d.ts.map +0 -1
  310. package/dist/libs/k8s-redis-ha.js +0 -15
  311. package/dist/libs/k8s-secrets-manager.d.ts +0 -6
  312. package/dist/libs/k8s-secrets-manager.d.ts.map +0 -1
  313. package/dist/libs/k8s-secrets-manager.js +0 -64
  314. package/dist/libs/validate-env.d.ts +0 -56
  315. package/dist/libs/validate-env.d.ts.map +0 -1
  316. package/dist/libs/validate-env.js +0 -214
  317. package/dist/libs/validate-env.spec.d.ts +0 -2
  318. package/dist/libs/validate-env.spec.d.ts.map +0 -1
  319. package/dist/libs/validate-env.spec.js +0 -168
  320. package/dist/plugins.d.ts.map +0 -1
  321. package/dist/types/index.d.ts +0 -939
  322. package/dist/types/index.d.ts.map +0 -1
  323. package/dist/types/index.js +0 -82
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/cli/core/env.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAGjB,MAAM,WAAW,CAAC;AAwBnB,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QA+CpC;AAED,eAAO,MAAM,GAAG;;;;CAAiC,CAAC"}
@@ -1,65 +0,0 @@
1
- import { deleteMonorepoSecret, getMonorepoSecretStr, setMonorepoSecret, } from "../../libs/k8s-secrets-manager";
2
- import { CombinedEnvValidator } from "../../libs/validate-env";
3
- import { globEnvYamlFiles } from "../../libs/discovery";
4
- import { CLICommandParser, dotEnvFilesForEnv, printUsageAndExit, } from "../common";
5
- const oneLiner = "Commands to manipulate env variables";
6
- const keyExamples = `
7
- $ devops env get --env staging
8
- $ devops env get KEY1 KEY2 --env staging
9
- $ devops env set KEY1=123 KEY2=345 --env staging
10
- $ devops env delete KEY1 KEY2 --env staging
11
- $ devops env validate
12
- `;
13
- const usage = `
14
- ${oneLiner}
15
-
16
- COMMANDS
17
- get Fetches secrets for the chosen environment and printes them to console
18
- set Sets specific secrets for the chosen environment
19
- delete Deletes specific secrets for the chosen environment
20
- validate Validate locally, verifying the existence and type of environment variables against all env.yaml files
21
-
22
- EXAMPLES
23
- ${keyExamples}
24
- `;
25
- function run(cmdObj) {
26
- if (cmdObj.help || cmdObj.args.length === 0)
27
- printUsageAndExit(usage);
28
- const [command, ...rest] = cmdObj.args;
29
- switch (command) {
30
- case "validate": {
31
- const envYamlFiles = globEnvYamlFiles();
32
- // We have to have a _validate so that we go through a CommandExecutor which injects env variables into the process
33
- cmdObj
34
- .executorFromEnv(`devops env _validate ${envYamlFiles.join(" ")}`, { quiet: false })
35
- .exec();
36
- break;
37
- }
38
- case "_validate": {
39
- const options = cmdObj.parseOptions({ booleans: ["--skip-dotenv"] });
40
- const [_subcmd, ...envYamlFiles] = options.args;
41
- const envFiles = options.options["--skip-dotenv"]
42
- ? []
43
- : dotEnvFilesForEnv(cmdObj.env);
44
- const validator = new CombinedEnvValidator(envYamlFiles, envFiles);
45
- validator.validate();
46
- break;
47
- }
48
- case "get": {
49
- console.log(getMonorepoSecretStr(cmdObj.env, rest));
50
- break;
51
- }
52
- case "set": {
53
- setMonorepoSecret(cmdObj.env, rest);
54
- break;
55
- }
56
- case "delete": {
57
- deleteMonorepoSecret(cmdObj.env, rest);
58
- break;
59
- }
60
- default: {
61
- printUsageAndExit(usage);
62
- }
63
- }
64
- }
65
- export const env = { oneLiner, keyExamples, run };
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const exec: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=exec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/cli/core/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsC,MAAM,WAAW,CAAC;AA4BjF,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAwBpC;AAED,eAAO,MAAM,IAAI;;;;CAAiC,CAAC"}
@@ -1,48 +0,0 @@
1
- import { CLICommandParser, CommandExecutor, printUsageAndExit } from "../common";
2
- import url from "url";
3
- import path from "path";
4
- import { getWorkspace } from "../../libs/discovery";
5
- const __file__ = url.fileURLToPath(import.meta.url);
6
- const __cli__ = path.join(path.dirname(__file__), "../..", "cli");
7
- const execShPath = path.join(__cli__, "exec.sh");
8
- const oneLiner = "Executes a command after injecting env variables, either globally or in a workspace";
9
- const keyExamples = `
10
- $ devops exec tmp/test.sh
11
- $ devops exec bun test.ts --in myworkspace --env staging
12
- `.trim();
13
- const usage = `
14
- ${oneLiner}
15
-
16
- USAGE
17
- devops exec <command>
18
- devops exec --in <workspace> <command>
19
- devops exec --in <workspace> <command> --interactive
20
-
21
- EXAMPLES
22
- ${keyExamples}
23
- `;
24
- function run(cmdObj) {
25
- if (cmdObj.help || cmdObj.args.length === 0)
26
- printUsageAndExit(usage);
27
- const parsed = cmdObj.parseOptions({
28
- params: ["--in"],
29
- booleans: ["--interactive"],
30
- });
31
- const workspace = parsed.options["--in"];
32
- let executor;
33
- if (workspace) {
34
- const rootPath = getWorkspace(workspace).rootPath;
35
- executor = cmdObj.executorFromEnv(`${execShPath} ${rootPath} ${parsed.argsStr}`, { checkEnvYaml: true });
36
- }
37
- else {
38
- executor = cmdObj.executorFromEnv(parsed.argsStr, { checkEnvYaml: true });
39
- }
40
- const interactive = Boolean(parsed.options["--interactive"]);
41
- if (interactive) {
42
- executor.spawn();
43
- }
44
- else {
45
- executor.exec();
46
- }
47
- }
48
- export const exec = { oneLiner, keyExamples, run };
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../../../src/cli/common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const image: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/cli/core/image.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,yBAAyB,CAAC;AA6K5F,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAgCpC;AAED,eAAO,MAAM,KAAK;;;;CAAiC,CAAC"}
@@ -1,153 +0,0 @@
1
- import { deleteImageVersion, getImageVersion, getWorkspaceScale, resetWorkspaceScale, setImageVersion, setWorkspaceScale } from "../../libs/k8s-image-config";
2
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../../../src/cli/common";
3
- import { generateImageDeployments } from "../../libs/k8s-generate";
4
- import { applyHandler } from "../../libs/k8s-helpers";
5
- import { getImageType } from "../../libs/config";
6
- const oneLiner = "Applies image-related manifests, retrieves or set the version deployed, and scales deployments of applications";
7
- const keyExamples = `
8
- $ devops image get type main-node
9
- $ devops image deployment gen main-node sha --env staging
10
- $ devops image deployment create main-node sha --env staging
11
- $ devops image deployment delete main-node --env staging
12
- $ devops image version get main-node --env staging
13
- $ devops image version set main-node sha --env staging
14
- $ devops image version unset main-node --env staging
15
- $ devops image scale get main-node --env staging
16
- $ devops image scale get main-node www --env staging
17
- $ devops image scale set main-node www 3 --env staging
18
- $ devops image scale unset main-node --env staging
19
- $ devops image scale unset main-node www --env staging
20
- `.trim();
21
- const usage = `
22
- ${oneLiner}
23
-
24
- GET IMAGE TYPE
25
- devops image get type <image-name>
26
-
27
- Returns "k8s" or "cloudrun" depending on the image type.
28
-
29
- GENERATING DEPLOYMENT MANIFESTS
30
- devops image deployment gen|create|delete <image-name> <sha>
31
-
32
- gen - generates the manifest file with all applications that are deployed with the image
33
- create - generates the manifest file and then runs kubectl apply
34
- delete - generates the manifest file and then runs kubectl delete
35
-
36
- MANAGINE APPLICATION SCALE
37
- devops image scale get|unset <image-name> [<workspace-name>]
38
- devops image scale set <image-name> <workspace-name> <replica-count>
39
-
40
- set - sets the scale count in the image's config map so that it persists across deployments.
41
- get - retrieves the current scale count. If workspace is not provided, all workspaces are returned.
42
- unset - resets the scale count by removing the key from the image's config map. If workspace is not provided, all workspaces are reset.
43
-
44
- Both 'set' and 'unset' return the previous scale count prior to the operation.
45
-
46
- MANAGING IMAGE VERSIONS
47
- devops image version get|unset <image>
48
- devops image version set <image> <sha>
49
-
50
- Meant to be called during deployment in order to maintain a record of the most recent deployed version.
51
-
52
- EXAMPLES
53
- ${keyExamples}
54
- `;
55
- const handlers = {
56
- get: {
57
- type: (opts) => {
58
- console.log(getImageType(opts.required("image")));
59
- },
60
- },
61
- deployment: {
62
- gen: (opts) => {
63
- console.log(generateImageDeployments(opts.required("env"), opts.required("image"), opts.required("sha")));
64
- },
65
- create: (opts) => {
66
- applyHandler('apply-deployment-', 'apply', generateImageDeployments(opts.required("env"), opts.required("image"), opts.required("sha")));
67
- },
68
- delete: (opts) => {
69
- applyHandler('delete-deployment-', 'delete', generateImageDeployments(opts.required("env"), opts.required("image"), "dummy-sha"));
70
- },
71
- },
72
- scale: {
73
- set: (opts) => {
74
- const workspace = opts.required("workspace");
75
- const image = opts.required("image");
76
- const replicas = Number(opts.required("replicas"));
77
- const res = setWorkspaceScale(opts.required("env"), image, workspace, replicas);
78
- if (res) {
79
- console.warn(`Scale for ${workspace} in ${image} set to ${replicas}. Previous value:`);
80
- console.log(res);
81
- }
82
- },
83
- get: (opts) => {
84
- const workspace = opts.optional("workspace");
85
- // Satiate the type checker
86
- if (!workspace) {
87
- console.log(getWorkspaceScale(opts.required("env"), opts.required("image")));
88
- }
89
- else {
90
- console.log(getWorkspaceScale(opts.required("env"), opts.required("image"), workspace));
91
- }
92
- },
93
- unset: (opts) => {
94
- const image = opts.required("image");
95
- const workspace = opts.optional("workspace");
96
- const prev = resetWorkspaceScale(opts.required("env"), image, workspace);
97
- if (workspace) {
98
- console.warn(`Scale for ${workspace} in ${image} unset. Previous scale:`);
99
- console.log(prev);
100
- }
101
- else {
102
- console.warn(`Scale for all workspaces in ${image} unset. Previous scale:`);
103
- console.log(prev);
104
- }
105
- },
106
- },
107
- version: {
108
- get: (opts) => {
109
- const version = getImageVersion(opts.required("env"), opts.required("image"));
110
- console.log(version ?? "");
111
- },
112
- set: (opts) => {
113
- setImageVersion(opts.required("env"), opts.required("image"), opts.required("sha"));
114
- },
115
- unset: (opts) => {
116
- deleteImageVersion(opts.required("env"), opts.required("image"));
117
- },
118
- },
119
- };
120
- function run(cmdObj) {
121
- if (cmdObj.help || cmdObj.args.length < 1)
122
- printUsageAndExit(usage);
123
- const [command, subcommand, image, param1, param2] = cmdObj.args;
124
- const commandHandler = handlers[command];
125
- if (!commandHandler) {
126
- console.error(`Unknown command: ${command}`);
127
- printUsageAndExit(usage);
128
- }
129
- const handler = commandHandler[subcommand];
130
- if (!handler) {
131
- console.error(`Unknown subcommand: ${subcommand}`);
132
- printUsageAndExit(usage);
133
- }
134
- function getExtraParams() {
135
- if (command === 'get') {
136
- return {};
137
- }
138
- else if (command === 'scale') {
139
- return subcommand === 'set' ? { workspace: param1, replicas: param2 } : { workspace: param1 };
140
- }
141
- else {
142
- return { sha: param1 };
143
- }
144
- }
145
- const params = new StrongParams(usage, {
146
- env: cmdObj.env,
147
- subcommand,
148
- image,
149
- ...getExtraParams()
150
- });
151
- handler(params);
152
- }
153
- export const image = { oneLiner, keyExamples, run };
@@ -1,16 +0,0 @@
1
- export * from "./run";
2
- export * from "./run-many";
3
- export * from "./exec";
4
- export * from "./affected";
5
- export * from "./cloudrun";
6
- export * from "./console";
7
- export * from "./constant";
8
- export * from "./env";
9
- export * from "./image";
10
- export * from "./init";
11
- export * from "./job";
12
- export * from "./namespace";
13
- export * from "./prep-build";
14
- export * from "./registry";
15
- export * from "./test";
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
@@ -1,15 +0,0 @@
1
- export * from "./run";
2
- export * from "./run-many";
3
- export * from "./exec";
4
- export * from "./affected";
5
- export * from "./cloudrun";
6
- export * from "./console";
7
- export * from "./constant";
8
- export * from "./env";
9
- export * from "./image";
10
- export * from "./init";
11
- export * from "./job";
12
- export * from "./namespace";
13
- export * from "./prep-build";
14
- export * from "./registry";
15
- export * from "./test";
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): Promise<void>;
3
- export declare const init: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/core/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,WAAW,CAAC;AAmBhE,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAG1C;AAED,eAAO,MAAM,IAAI;;;;CAAiC,CAAC"}
@@ -1,219 +0,0 @@
1
- import inquirer from "inquirer";
2
- import { InitGenerator } from "../../libs/init-generator";
3
- import { CLICommandParser, printUsageAndExit } from "../common";
4
- import chalk from "chalk";
5
- import fs from 'fs-extra';
6
- const oneLiner = "Initializes the devops utility by copying template files to the current folder";
7
- const keyExamples = `$ devops init`;
8
- const usage = `
9
- ${oneLiner}
10
-
11
- NOTE
12
- No files are overwritten.
13
-
14
- EXAMPLES
15
- ${keyExamples}
16
- `;
17
- async function run(cmdObj) {
18
- if (cmdObj.help)
19
- printUsageAndExit(usage);
20
- createFiles();
21
- }
22
- export const init = { oneLiner, keyExamples, run };
23
- async function createFiles() {
24
- const tc = new InitGenerator();
25
- const userChoices = await getUserChoices(tc.projectName);
26
- // Language variants
27
- tc.addCopiedFolder("lang-variants-common/typescript", ".");
28
- if (userChoices.usePython) {
29
- tc.addCopiedFolder("lang-variants-common/python", ".");
30
- tc.enableSubtitution("pyproject.toml");
31
- }
32
- tc.enableSubtitution(".devops/config/images.yaml");
33
- tc.setMessageGenerator(".envrc", envrcMessage);
34
- // gitignore
35
- const gitIgnore = gitIgnoreContent(userChoices.infraVariant, userChoices.usePython);
36
- tc.addGeneratedFile(".gitignore", gitIgnore);
37
- tc.setMessageGenerator(".gitignore", gitignoreMessageGen(gitIgnore));
38
- // Infra variants
39
- tc.addCopiedFolder(`infra-variants/${userChoices.infraVariant}`, ".");
40
- tc.enableSubtitution(".devops/config/constants.yaml");
41
- if (userChoices.infraVariant === "hetzner") {
42
- tc.enableSubtitution(".devops/infra/hetzner/harbor-cert.yaml");
43
- tc.enableSubtitution(".devops/infra/hetzner/harbor-values.yaml");
44
- tc.enableSubtitution(".devops/infra/hetzner/hcloud-config.yaml");
45
- }
46
- // Prisma
47
- if (userChoices.usePrisma) {
48
- tc.addCopiedFolder("lang-variants-prisma/typescript", ".");
49
- if (userChoices.usePython) {
50
- tc.addCopiedFolder("lang-variants-prisma/python", ".");
51
- }
52
- }
53
- // Cluster resources
54
- const clusterResources = new Set(userChoices.clusterResources);
55
- if (clusterResources.has("dns-test")) {
56
- tc.addCopiedFolder("cluster-resource-options/dns-test", ".devops/infra/dns-test");
57
- }
58
- if (clusterResources.has("monitoring-ingress")) {
59
- tc.addCopiedFolder("cluster-resource-options/monitoring-ingress", ".devops/infra/monitoring-ingress");
60
- }
61
- if (clusterResources.has("postgres")) {
62
- tc.addCopiedFolder("cluster-resource-options/postgres", ".devops/infra/postgres");
63
- // prettier-ignore
64
- tc.enableSubtitution(".devops/infra/postgres/staging/configurations/07-SGObjectStorage.yaml");
65
- // prettier-ignore
66
- tc.enableSubtitution(".devops/infra/postgres/staging/configurations/08-SGScript.yaml");
67
- // prettier-ignore
68
- tc.enableSubtitution(".devops/infra/postgres/production/configurations/07-SGObjectStorage.yaml");
69
- // prettier-ignore
70
- tc.enableSubtitution(".devops/infra/postgres/production/configurations/08-SGScript.yaml");
71
- }
72
- if (clusterResources.has("redis")) {
73
- tc.addCopiedFolder("cluster-resource-options/redis", ".devops/infra/redis");
74
- }
75
- if (clusterResources.has("milvus")) {
76
- tc.addCopiedFolder("cluster-resource-options/milvus", ".devops/infra/milvus");
77
- }
78
- if (clusterResources.has("prefect") && userChoices.usePython) {
79
- tc.addCopiedFolder("cluster-resource-options/prefect", ".devops/infra/prefect");
80
- }
81
- tc.run({
82
- substitution: {
83
- 'PROJECT_NAME': userChoices.projectName,
84
- 'STAGING_DOMAIN': userChoices.stagingDomain,
85
- 'PRODUCTION_DOMAIN': userChoices.productionDomain,
86
- 'GCLOUD_PROJECT_ID': userChoices.gcloudProjectId,
87
- 'REGISTRY_IMAGE_PATH_PREFIX': userChoices.registryImagePathPrefix,
88
- 'REGISTRY_BASE_URL': userChoices.registryBaseUrl,
89
- },
90
- messages: [
91
- packageJsonMessage(userChoices.usePrisma)
92
- ]
93
- });
94
- }
95
- function packageJsonMessage(usePrisma) {
96
- const prismaMessage = usePrisma
97
- ? `,
98
- "db/**",
99
- "dml/**"`
100
- : "";
101
- return `add the following entry to the main ${chalk.blue("package.json")}:
102
- ${chalk.yellow(`"workspaces": [
103
- "libs/**",
104
- "applications/**"${prismaMessage}
105
- ],`)}`;
106
- }
107
- function gitIgnoreContent(infraVariant, usePython) {
108
- const common = `**/.env*
109
- config/kubeconfig
110
- tmp/**
111
- !tmp/**/.gitkeep`;
112
- const gcloud = infraVariant === 'gcloud'
113
- ? 'config/gke_gcloud_auth_plugin_cache'
114
- : null;
115
- const python = usePython
116
- ? `venv/
117
- **/__pycache__`
118
- : null;
119
- return [common, gcloud, python].filter(Boolean).join('\n');
120
- }
121
- function gitignoreMessageGen(content) {
122
- return (exists) => {
123
- if (!exists)
124
- return;
125
- return `add the following to your ${chalk.blue(".gitignore")}:
126
- ${chalk.yellow(content)}`;
127
- };
128
- }
129
- function envrcMessage(targetExists, fileInfo) {
130
- if (fileInfo.type !== 'copied')
131
- throw new Error(`envrcMessage() expects a copied file, got ${fileInfo.type}`);
132
- if (targetExists) {
133
- const content = fs.readFileSync(fileInfo.sourceAbs, 'utf-8');
134
- return `add the following to your ${chalk.blue(".envrc")} and run ${chalk.yellow("direnv allow")}:
135
- ${chalk.yellow(content)}`;
136
- }
137
- else {
138
- return `Enable ${chalk.blue(".envrc")} by installing ${chalk.blue('direnv')} and running ${chalk.yellow("direnv allow")}`;
139
- }
140
- }
141
- function getUserChoices(projectName) {
142
- const defaultProjectName = projectName || "changeme";
143
- return inquirer.prompt([
144
- {
145
- type: "input",
146
- name: "projectName",
147
- message: `Enter the project name (default: '${defaultProjectName}')`,
148
- default: defaultProjectName,
149
- },
150
- {
151
- type: "input",
152
- name: "stagingDomain",
153
- message: "Enter the staging domain (default: 'staging.com')",
154
- default: "staging.com",
155
- },
156
- {
157
- type: "input",
158
- name: "productionDomain",
159
- message: "Enter the production domain (default: 'production.com')",
160
- default: "production.com",
161
- },
162
- {
163
- type: "list",
164
- name: "infraVariant",
165
- message: "Where does your cluster run?",
166
- choices: [
167
- { name: "Google Cloud", value: "gcloud" },
168
- { name: "Digital Ocean", value: "digitalocean" },
169
- { name: "Hetzner", value: "hetzner" },
170
- ],
171
- },
172
- {
173
- type: "input",
174
- name: "gcloudProjectId",
175
- message: "Enter the GCP project ID (default: 'changeme')",
176
- default: "changeme",
177
- when: (answers) => answers.infraVariant === "gcloud",
178
- },
179
- {
180
- type: "input",
181
- name: "registryImagePathPrefix",
182
- message: (answers) => `Enter your Digital Ocean container registry name (default: '${answers.projectName}')`,
183
- default: (answers) => answers.projectName,
184
- when: (answers) => answers.infraVariant === "digitalocean",
185
- },
186
- {
187
- type: "input",
188
- name: "registryBaseUrl",
189
- message: (answers) => `Enter your registry base URL (default: 'registry.${answers.stagingDomain}')`,
190
- default: (answers) => `registry.${answers.stagingDomain}`,
191
- when: (answers) => answers.infraVariant === "hetzner",
192
- },
193
- {
194
- type: "confirm",
195
- name: "usePython",
196
- message: "Add support for Python?",
197
- default: true,
198
- },
199
- {
200
- type: "confirm",
201
- name: "usePrisma",
202
- message: "Add support for Prisma?",
203
- default: true,
204
- },
205
- {
206
- type: "checkbox",
207
- name: "clusterResources",
208
- message: "Optional manifests and helm charts to add",
209
- choices: (answers) => [
210
- { name: "Manifest to test DNS setup", value: "dns-test" },
211
- { name: "Manifest to setup ingress for graphana and prometheus", value: "monitoring-ingress" },
212
- { name: "Stackgres CRDs and manifests for Postgres", value: "postgres" },
213
- { name: "Redis Helm chart values", value: "redis" },
214
- { name: "Milvus helm chart values", value: "milvus" },
215
- ...(answers.usePython ? [{ name: "Prefect Helm chart values", value: "prefect" }] : [])
216
- ]
217
- }
218
- ]);
219
- }
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const job: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=job.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/cli/core/job.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AA6C9E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QA4BpC;AAED,eAAO,MAAM,GAAG;;;;CAAiC,CAAC"}
@@ -1,65 +0,0 @@
1
- import {} from "../../libs/k8s-image-config";
2
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
3
- import { generateDbMigrateJob } from "../../libs/k8s-generate";
4
- import { applyHandler } from "../../libs/k8s-helpers";
5
- import { k8sJobWaiter, printJobStatuses } from "../../libs/k8s-job-waiter";
6
- import { dbMigrateJobName } from "../../libs/k8s-constants";
7
- const oneLiner = "Creates a k8s job and waits for it to run";
8
- const keyExamples = `
9
- $ devops job db-migrate gen main-node <sha> --env staging
10
- $ devops job db-migrate create main-node <sha> --env staging --timeout 120
11
- `.trim();
12
- const usage = `
13
- ${oneLiner}
14
-
15
- GENERAL USAGE
16
- devops job db-migrate gen <image> <sha>
17
- devops job db-migrate create <image> <sha> --timeout <timeout>
18
-
19
- EXAMPLES
20
- ${keyExamples}
21
- `;
22
- const handlers = {
23
- gen: (opts) => {
24
- console.log(generateDbMigrateJob(opts.required("env"), opts.required("image"), opts.required("sha")));
25
- },
26
- create: async (opts) => {
27
- const env = opts.required("env");
28
- const image = opts.required("image");
29
- const sha = opts.required("sha");
30
- const timeout = opts.optional("timeout") ?? '240';
31
- const manifest = generateDbMigrateJob(env, image, sha);
32
- const jobName = dbMigrateJobName(sha);
33
- applyHandler(`apply-${jobName}`, 'apply', manifest);
34
- const statuses = await k8sJobWaiter(env, Number(timeout ?? '240'), [jobName]);
35
- if (statuses && Object.keys(statuses).length > 0) {
36
- printJobStatuses(statuses);
37
- }
38
- },
39
- };
40
- function run(cmdObj) {
41
- if (cmdObj.help || cmdObj.args.length < 1)
42
- printUsageAndExit(usage);
43
- const parsedArgs = cmdObj.parseOptions({
44
- params: ["--timeout"]
45
- });
46
- const [jobName, command, image, sha] = parsedArgs.args;
47
- if (jobName !== 'db-migrate') {
48
- console.error(`Unknown job: ${jobName}. Only db-migrate is supported at this time.`);
49
- process.exit(1);
50
- }
51
- const handler = handlers[command];
52
- if (!handler) {
53
- console.error(`Unknown command: ${command}`);
54
- printUsageAndExit(usage);
55
- }
56
- const timeout = parsedArgs.options["--timeout"];
57
- const params = new StrongParams(usage, {
58
- env: cmdObj.env,
59
- image,
60
- sha,
61
- timeout
62
- });
63
- handler(params);
64
- }
65
- export const job = { oneLiner, keyExamples, run };
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../../../src/cli/common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const namespace: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=namespace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/cli/core/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,yBAAyB,CAAC;AA0D5F,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAapC;AAED,eAAO,MAAM,SAAS;;;;CAAiC,CAAC"}