@vaharoni/devops 1.2.12 → 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 (330) 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/src/target-templates/lang-variants-common/python/.cursor/rules/monorepo-python.mdc +56 -0
  133. package/src/target-templates/lang-variants-common/typescript/.cursor/rules/monorepo-typescript.mdc +51 -0
  134. package/src/target-templates/lang-variants-prisma/python/.cursor/rules/prisma-python.mdc +55 -0
  135. package/src/target-templates/lang-variants-prisma/python/.cursor/rules/testing-python.mdc +89 -0
  136. package/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/prisma-typescript.mdc +54 -0
  137. package/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/testing-typescript.mdc +103 -0
  138. package/src/target-templates/lang-variants-prisma/typescript/db/db-client-test.ts +5 -3
  139. package/dist/app-support/crypto/aes.d.ts +0 -15
  140. package/dist/app-support/crypto/aes.d.ts.map +0 -1
  141. package/dist/app-support/crypto/aes.js +0 -56
  142. package/dist/app-support/crypto/aes.spec.d.ts +0 -2
  143. package/dist/app-support/crypto/aes.spec.d.ts.map +0 -1
  144. package/dist/app-support/crypto/aes.spec.js +0 -58
  145. package/dist/app-support/crypto/index.d.ts +0 -16
  146. package/dist/app-support/crypto/index.d.ts.map +0 -1
  147. package/dist/app-support/crypto/index.js +0 -31
  148. package/dist/app-support/crypto/internal-token.d.ts +0 -20
  149. package/dist/app-support/crypto/internal-token.d.ts.map +0 -1
  150. package/dist/app-support/crypto/internal-token.js +0 -42
  151. package/dist/app-support/crypto/internal-token.spec.d.ts +0 -2
  152. package/dist/app-support/crypto/internal-token.spec.d.ts.map +0 -1
  153. package/dist/app-support/crypto/internal-token.spec.js +0 -45
  154. package/dist/app-support/crypto/secret.d.ts +0 -3
  155. package/dist/app-support/crypto/secret.d.ts.map +0 -1
  156. package/dist/app-support/crypto/secret.js +0 -12
  157. package/dist/app-support/crypto/secret.spec.d.ts +0 -2
  158. package/dist/app-support/crypto/secret.spec.d.ts.map +0 -1
  159. package/dist/app-support/crypto/secret.spec.js +0 -15
  160. package/dist/app-support/discovery/dev-discovery-loader.d.ts +0 -2
  161. package/dist/app-support/discovery/dev-discovery-loader.d.ts.map +0 -1
  162. package/dist/app-support/discovery/dev-discovery-loader.js +0 -30
  163. package/dist/app-support/discovery/service-endpoint.d.ts +0 -2
  164. package/dist/app-support/discovery/service-endpoint.d.ts.map +0 -1
  165. package/dist/app-support/discovery/service-endpoint.js +0 -10
  166. package/dist/cli/common.d.ts +0 -89
  167. package/dist/cli/common.d.ts.map +0 -1
  168. package/dist/cli/common.js +0 -246
  169. package/dist/cli/common.spec.d.ts +0 -2
  170. package/dist/cli/common.spec.d.ts.map +0 -1
  171. package/dist/cli/common.spec.js +0 -64
  172. package/dist/cli/core/affected.d.ts +0 -9
  173. package/dist/cli/core/affected.d.ts.map +0 -1
  174. package/dist/cli/core/affected.js +0 -101
  175. package/dist/cli/core/cloudrun.d.ts +0 -9
  176. package/dist/cli/core/cloudrun.d.ts.map +0 -1
  177. package/dist/cli/core/cloudrun.js +0 -119
  178. package/dist/cli/core/console.d.ts +0 -10
  179. package/dist/cli/core/console.d.ts.map +0 -1
  180. package/dist/cli/core/console.js +0 -50
  181. package/dist/cli/core/constant.d.ts +0 -9
  182. package/dist/cli/core/constant.d.ts.map +0 -1
  183. package/dist/cli/core/constant.js +0 -20
  184. package/dist/cli/core/env.d.ts +0 -9
  185. package/dist/cli/core/env.d.ts.map +0 -1
  186. package/dist/cli/core/env.js +0 -65
  187. package/dist/cli/core/exec.d.ts +0 -9
  188. package/dist/cli/core/exec.d.ts.map +0 -1
  189. package/dist/cli/core/exec.js +0 -48
  190. package/dist/cli/core/image.d.ts +0 -9
  191. package/dist/cli/core/image.d.ts.map +0 -1
  192. package/dist/cli/core/image.js +0 -153
  193. package/dist/cli/core/index.d.ts +0 -16
  194. package/dist/cli/core/index.d.ts.map +0 -1
  195. package/dist/cli/core/index.js +0 -15
  196. package/dist/cli/core/init.d.ts +0 -9
  197. package/dist/cli/core/init.d.ts.map +0 -1
  198. package/dist/cli/core/init.js +0 -219
  199. package/dist/cli/core/job.d.ts +0 -9
  200. package/dist/cli/core/job.d.ts.map +0 -1
  201. package/dist/cli/core/job.js +0 -65
  202. package/dist/cli/core/namespace.d.ts +0 -9
  203. package/dist/cli/core/namespace.d.ts.map +0 -1
  204. package/dist/cli/core/namespace.js +0 -67
  205. package/dist/cli/core/prep-build.d.ts +0 -10
  206. package/dist/cli/core/prep-build.d.ts.map +0 -1
  207. package/dist/cli/core/prep-build.js +0 -109
  208. package/dist/cli/core/registry.d.ts +0 -9
  209. package/dist/cli/core/registry.d.ts.map +0 -1
  210. package/dist/cli/core/registry.js +0 -66
  211. package/dist/cli/core/run-many.d.ts +0 -10
  212. package/dist/cli/core/run-many.d.ts.map +0 -1
  213. package/dist/cli/core/run-many.js +0 -48
  214. package/dist/cli/core/run.d.ts +0 -9
  215. package/dist/cli/core/run.d.ts.map +0 -1
  216. package/dist/cli/core/run.js +0 -35
  217. package/dist/cli/core/test.d.ts +0 -9
  218. package/dist/cli/core/test.d.ts.map +0 -1
  219. package/dist/cli/core/test.js +0 -26
  220. package/dist/cli/extensions/dml.d.ts +0 -9
  221. package/dist/cli/extensions/dml.d.ts.map +0 -1
  222. package/dist/cli/extensions/dml.js +0 -114
  223. package/dist/cli/extensions/index.d.ts +0 -9
  224. package/dist/cli/extensions/index.d.ts.map +0 -1
  225. package/dist/cli/extensions/index.js +0 -8
  226. package/dist/cli/extensions/internal-curl.d.ts +0 -10
  227. package/dist/cli/extensions/internal-curl.d.ts.map +0 -1
  228. package/dist/cli/extensions/internal-curl.js +0 -41
  229. package/dist/cli/extensions/jwt.d.ts +0 -9
  230. package/dist/cli/extensions/jwt.d.ts.map +0 -1
  231. package/dist/cli/extensions/jwt.js +0 -25
  232. package/dist/cli/extensions/prisma.d.ts +0 -9
  233. package/dist/cli/extensions/prisma.d.ts.map +0 -1
  234. package/dist/cli/extensions/prisma.js +0 -23
  235. package/dist/cli/extensions/redis-bitnami.d.ts +0 -11
  236. package/dist/cli/extensions/redis-bitnami.d.ts.map +0 -1
  237. package/dist/cli/extensions/redis-bitnami.js +0 -74
  238. package/dist/cli/extensions/redis-ha.d.ts +0 -11
  239. package/dist/cli/extensions/redis-ha.d.ts.map +0 -1
  240. package/dist/cli/extensions/redis-ha.js +0 -51
  241. package/dist/cli/extensions/stackgres.d.ts +0 -10
  242. package/dist/cli/extensions/stackgres.d.ts.map +0 -1
  243. package/dist/cli/extensions/stackgres.js +0 -117
  244. package/dist/cli/extensions/template.d.ts +0 -9
  245. package/dist/cli/extensions/template.d.ts.map +0 -1
  246. package/dist/cli/extensions/template.js +0 -121
  247. package/dist/devops.d.ts.map +0 -1
  248. package/dist/index.d.ts.map +0 -1
  249. package/dist/libs/affected-entities.d.ts +0 -15
  250. package/dist/libs/affected-entities.d.ts.map +0 -1
  251. package/dist/libs/affected-entities.js +0 -52
  252. package/dist/libs/cloudrun-helpers.d.ts +0 -16
  253. package/dist/libs/cloudrun-helpers.d.ts.map +0 -1
  254. package/dist/libs/cloudrun-helpers.js +0 -81
  255. package/dist/libs/config.d.ts +0 -7
  256. package/dist/libs/config.d.ts.map +0 -1
  257. package/dist/libs/config.js +0 -102
  258. package/dist/libs/digital-ocean/container-reg.d.ts +0 -6
  259. package/dist/libs/digital-ocean/container-reg.d.ts.map +0 -1
  260. package/dist/libs/digital-ocean/container-reg.js +0 -74
  261. package/dist/libs/discovery/dependencies.d.ts +0 -19
  262. package/dist/libs/discovery/dependencies.d.ts.map +0 -1
  263. package/dist/libs/discovery/dependencies.js +0 -62
  264. package/dist/libs/discovery/dependencies.spec.d.ts +0 -2
  265. package/dist/libs/discovery/dependencies.spec.d.ts.map +0 -1
  266. package/dist/libs/discovery/dependencies.spec.js +0 -21
  267. package/dist/libs/discovery/images.d.ts +0 -5
  268. package/dist/libs/discovery/images.d.ts.map +0 -1
  269. package/dist/libs/discovery/images.js +0 -45
  270. package/dist/libs/discovery/index.d.ts +0 -6
  271. package/dist/libs/discovery/index.d.ts.map +0 -1
  272. package/dist/libs/discovery/index.js +0 -67
  273. package/dist/libs/discovery/process-common.d.ts +0 -25
  274. package/dist/libs/discovery/process-common.d.ts.map +0 -1
  275. package/dist/libs/discovery/process-common.js +0 -40
  276. package/dist/libs/discovery/process-package-json.d.ts +0 -3
  277. package/dist/libs/discovery/process-package-json.d.ts.map +0 -1
  278. package/dist/libs/discovery/process-package-json.js +0 -40
  279. package/dist/libs/discovery/process-pyproject-toml.d.ts +0 -3
  280. package/dist/libs/discovery/process-pyproject-toml.d.ts.map +0 -1
  281. package/dist/libs/discovery/process-pyproject-toml.js +0 -49
  282. package/dist/libs/git-helpers.d.ts +0 -8
  283. package/dist/libs/git-helpers.d.ts.map +0 -1
  284. package/dist/libs/git-helpers.js +0 -20
  285. package/dist/libs/hetzner/reg-secret.d.ts +0 -3
  286. package/dist/libs/hetzner/reg-secret.d.ts.map +0 -1
  287. package/dist/libs/hetzner/reg-secret.js +0 -39
  288. package/dist/libs/init-generator.d.ts +0 -41
  289. package/dist/libs/init-generator.d.ts.map +0 -1
  290. package/dist/libs/init-generator.js +0 -123
  291. package/dist/libs/k8s-constants.d.ts +0 -13
  292. package/dist/libs/k8s-constants.d.ts.map +0 -1
  293. package/dist/libs/k8s-constants.js +0 -91
  294. package/dist/libs/k8s-db.d.ts +0 -18
  295. package/dist/libs/k8s-db.d.ts.map +0 -1
  296. package/dist/libs/k8s-db.js +0 -73
  297. package/dist/libs/k8s-generate.d.ts +0 -17
  298. package/dist/libs/k8s-generate.d.ts.map +0 -1
  299. package/dist/libs/k8s-generate.js +0 -193
  300. package/dist/libs/k8s-helpers.d.ts +0 -11
  301. package/dist/libs/k8s-helpers.d.ts.map +0 -1
  302. package/dist/libs/k8s-helpers.js +0 -42
  303. package/dist/libs/k8s-image-config.d.ts +0 -8
  304. package/dist/libs/k8s-image-config.d.ts.map +0 -1
  305. package/dist/libs/k8s-image-config.js +0 -113
  306. package/dist/libs/k8s-job-waiter.d.ts +0 -8
  307. package/dist/libs/k8s-job-waiter.d.ts.map +0 -1
  308. package/dist/libs/k8s-job-waiter.js +0 -84
  309. package/dist/libs/k8s-namespace.d.ts +0 -7
  310. package/dist/libs/k8s-namespace.d.ts.map +0 -1
  311. package/dist/libs/k8s-namespace.js +0 -27
  312. package/dist/libs/k8s-redis-bitnami.d.ts +0 -6
  313. package/dist/libs/k8s-redis-bitnami.d.ts.map +0 -1
  314. package/dist/libs/k8s-redis-bitnami.js +0 -31
  315. package/dist/libs/k8s-redis-ha.d.ts +0 -3
  316. package/dist/libs/k8s-redis-ha.d.ts.map +0 -1
  317. package/dist/libs/k8s-redis-ha.js +0 -15
  318. package/dist/libs/k8s-secrets-manager.d.ts +0 -6
  319. package/dist/libs/k8s-secrets-manager.d.ts.map +0 -1
  320. package/dist/libs/k8s-secrets-manager.js +0 -64
  321. package/dist/libs/validate-env.d.ts +0 -56
  322. package/dist/libs/validate-env.d.ts.map +0 -1
  323. package/dist/libs/validate-env.js +0 -214
  324. package/dist/libs/validate-env.spec.d.ts +0 -2
  325. package/dist/libs/validate-env.spec.d.ts.map +0 -1
  326. package/dist/libs/validate-env.spec.js +0 -168
  327. package/dist/plugins.d.ts.map +0 -1
  328. package/dist/types/index.d.ts +0 -939
  329. package/dist/types/index.d.ts.map +0 -1
  330. package/dist/types/index.js +0 -82
@@ -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"}
@@ -1,67 +0,0 @@
1
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../../../src/cli/common";
2
- import { copySecretHarborToNamespace, patchServiceAccountImagePullSecret, } from "../../../src/libs/hetzner/reg-secret";
3
- import { checkEnvSetup, createEmptyEnvSecret, createNamespace, deleteNamespace, patchBaseSecret } from "../../libs/k8s-namespace";
4
- const oneLiner = "Creates the basic prerequisites for a monorepo";
5
- const keyExamples = `
6
- $ devops namespace create --env staging
7
- $ devops namespace delete --env staging
8
- $ devops namespace check --env staging
9
- `.trim();
10
- const usage = `
11
- ${oneLiner}
12
-
13
- GENERAL USAGE
14
- devops namespcae create|delete|check --env <env>
15
-
16
- 'create' does the following:
17
- 1. Creates the namepace
18
- 2. Creates a secret to hold environment variables (used by devops env) and the base cryptographic secret
19
- 3. On Hetzner, copies the Harbor secret to the namespace and patches the default service account to use it
20
-
21
- 'delete' removes the namespace in kubernetes, which deletes all entities within it.
22
-
23
- 'check' returns exit code 0 if the namespace exists in kubernetes, 1 otherwise.
24
-
25
- EXAMPLES
26
- ${keyExamples}
27
- `;
28
- const handlers = {
29
- create(opts) {
30
- const env = opts.required("env");
31
- createNamespace(env);
32
- createEmptyEnvSecret(env);
33
- patchBaseSecret(env);
34
- copySecretHarborToNamespace(env);
35
- patchServiceAccountImagePullSecret(env);
36
- },
37
- delete(opts) {
38
- deleteNamespace(opts.required("env"));
39
- },
40
- check(opts) {
41
- const exists = checkEnvSetup(opts.required("env"));
42
- if (exists)
43
- return;
44
- console.error(`
45
- The environment does not exist in the cluster.
46
- In order to create resources for it in the cluster, it must be first set up. This is done to protect from unintentional resource creation.
47
- To set up the environment, run the following from your dev machine:
48
- $ devops namespace create --env <env>
49
- `);
50
- process.exit(1);
51
- },
52
- };
53
- function run(cmdObj) {
54
- if (cmdObj.help || cmdObj.args.length < 1)
55
- printUsageAndExit(usage);
56
- const [command] = cmdObj.args;
57
- const handler = handlers[command];
58
- if (!handler) {
59
- console.error(`Unknown command: ${command}`);
60
- printUsageAndExit(usage);
61
- }
62
- const params = new StrongParams(usage, {
63
- env: cmdObj.env,
64
- });
65
- handler(params);
66
- }
67
- export const namespace = { oneLiner, keyExamples, run };
@@ -1,10 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): Promise<void>;
3
- export declare const prepBuild: {
4
- command: string;
5
- oneLiner: string;
6
- keyExamples: string;
7
- run: typeof run;
8
- };
9
- export {};
10
- //# sourceMappingURL=prep-build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prep-build.d.ts","sourceRoot":"","sources":["../../../src/cli/core/prep-build.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,WAAW,CAAC;AA0BhE,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBA0F1C;AAED,eAAO,MAAM,SAAS;;;;;CAAwD,CAAC"}