@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,25 +0,0 @@
1
- import { InternalToken } from "../../app-support/crypto";
2
- import { CLICommandParser, printUsageAndExit } from "../common";
3
- const oneLiner = "Returns a JWT-like token to allow verifying internal communication within the namespace";
4
- const keyExamples = `$ devops jwt jobs`;
5
- const usage = `
6
- ${oneLiner}
7
-
8
- GENERAL USAGE
9
- devops jwt <subject>
10
-
11
- NOTE
12
- The token is valid for 60 seconds and bears the specified subject.
13
- --env should not be used with this command. It is expected to be run inside pods in the namespace.
14
- Relies on the MONOREPO_BASE_SECRET environment variable for signing the token.
15
-
16
- EXAMPLES
17
- ${keyExamples}
18
- `;
19
- async function run(cmdObj) {
20
- if (cmdObj.help || cmdObj.args.length === 0 || cmdObj.envForced)
21
- printUsageAndExit(usage);
22
- const subject = cmdObj.args[0];
23
- console.log(new InternalToken(subject).generate());
24
- }
25
- export const jwt = { oneLiner, keyExamples, run };
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): Promise<void>;
3
- export declare const prisma: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=prisma.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../src/cli/extensions/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAuB7C,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAK1C;AAED,eAAO,MAAM,MAAM;;;;CAAiC,CAAC"}
@@ -1,23 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- import url from "url";
3
- import path from "path";
4
- const __file__ = url.fileURLToPath(import.meta.url);
5
- const __cli__ = path.join(path.dirname(__file__), "../..", "cli");
6
- const execShPath = path.join(__cli__, "exec.sh");
7
- const oneLiner = "Runs prisma commands in the db project after injecting the environment variables";
8
- const keyExamples = `$ devops prisma migrate dev`;
9
- const usage = `
10
- ${oneLiner}
11
-
12
- GENERAL USAGE
13
- devops prisma <command>
14
-
15
- <command> can be any command you normally set prisma for.
16
-
17
- EXAMPLES
18
- ${keyExamples}
19
- `;
20
- async function run(cmdObj) {
21
- cmdObj.executorFromEnv(`${execShPath} db bunx prisma ${cmdObj.args.join(" ")}`, { checkEnvYaml: false }).spawn();
22
- }
23
- export const prisma = { oneLiner, keyExamples, run };
@@ -1,11 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const redisBitnami: {
4
- name: string;
5
- command: string;
6
- oneLiner: string;
7
- keyExamples: string;
8
- run: typeof run;
9
- };
10
- export {};
11
- //# sourceMappingURL=redis-bitnami.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-bitnami.d.ts","sourceRoot":"","sources":["../../../src/cli/extensions/redis-bitnami.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AA2D9E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAiBpC;AAED,eAAO,MAAM,YAAY;;;;;;CAA0E,CAAC"}
@@ -1,74 +0,0 @@
1
- import chalk from "chalk";
2
- import { establishRedisTunnel, getRedisList, getRedisPassword } from "../../libs/k8s-redis-bitnami";
3
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
4
- const oneLiner = "Utilities to help accessing production and staging redis installation from Bitnami";
5
- const keyExamples = `
6
- $ devops redis list
7
- $ devops redis password redis-staging
8
- $ devops redis tunnel redis-staging
9
- `.trim();
10
- const usage = `
11
- ${oneLiner}
12
-
13
- COMMANDS
14
- list Lists the available redis installations
15
- password <namespace> Shows the password for the Redis instance
16
- tunnel <namespace> [-p <port>] Sets up a tunnel to the remote Redis instance so you can access the DB from your local machine on port 9379 by default
17
-
18
- NOTES
19
- This command assumes the namespace and the helm release name are the same.
20
- The --env flag should not be used with these commands, as the Redis namespaces follow different conventions than the monorepo env.
21
-
22
- EXAMPLES
23
- ${keyExamples}
24
- `;
25
- const handlers = {
26
- list: () => {
27
- const res = getRedisList();
28
- console.log(res);
29
- },
30
- password: (opts) => {
31
- const namespace = opts.required("namespace");
32
- const res = getRedisPassword(namespace);
33
- if (!res) {
34
- console.error("Failed to get the secret");
35
- process.exit(1);
36
- }
37
- else {
38
- console.log();
39
- console.log(res.password);
40
- console.log();
41
- }
42
- },
43
- tunnel: (opts) => {
44
- const namespace = opts.required("namespace");
45
- const port = opts.optional("port") ?? '9379';
46
- const res = getRedisPassword(namespace);
47
- console.log(chalk.blue('\nAfter the tunnel is established, connect to Redis by running:\n\t') +
48
- chalk.green.bold(`redis-cli -p ${port} --askpass`));
49
- if (res) {
50
- console.log(chalk.blue('\tPassword: ') + chalk.green.bold(res.password));
51
- console.log();
52
- }
53
- establishRedisTunnel(namespace, port);
54
- },
55
- };
56
- function run(cmdObj) {
57
- if (cmdObj.help || cmdObj.args.length < 1)
58
- printUsageAndExit(usage);
59
- const parsed = cmdObj.parseOptions({ params: ["-p"] });
60
- const [command, namespace] = parsed.args;
61
- const port = parsed.options["-p"];
62
- // @ts-expect-error left as an exercise for the reader
63
- const handler = handlers[command];
64
- if (!handler) {
65
- console.error(`Unknown command: ${command}`);
66
- printUsageAndExit(usage);
67
- }
68
- const params = new StrongParams(usage, {
69
- namespace,
70
- port,
71
- });
72
- handler(params);
73
- }
74
- export const redisBitnami = { name: 'redis-bitnami', command: 'redis', oneLiner, keyExamples, run };
@@ -1,11 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const redisHa: {
4
- name: string;
5
- command: string;
6
- oneLiner: string;
7
- keyExamples: string;
8
- run: typeof run;
9
- };
10
- export {};
11
- //# sourceMappingURL=redis-ha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-ha.d.ts","sourceRoot":"","sources":["../../../src/cli/extensions/redis-ha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AAqC9E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAiBpC;AAED,eAAO,MAAM,OAAO;;;;;;CAAqE,CAAC"}
@@ -1,51 +0,0 @@
1
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
2
- import { establishRedisTunnel, getRedisList } from "../../libs/k8s-redis-ha";
3
- const oneLiner = "Utilities to help accessing production and staging redis installation from redis-ha";
4
- const keyExamples = `
5
- $ devops redis list
6
- $ devops redis tunnel redis-staging
7
- `.trim();
8
- const usage = `
9
- ${oneLiner}
10
-
11
- COMMANDS
12
- list Lists the available redis installations
13
- tunnel <namespace> [-p <port>] Sets up a tunnel to the remote Redis instance so you can access the DB from your local machine on port 9379 by default
14
-
15
- NOTES
16
- This command assumes the namespace and the helm release name are the same.
17
- The --env flag should not be used with these commands, as the Redis namespaces follow different conventions than the monorepo env.
18
-
19
- EXAMPLES
20
- ${keyExamples}
21
- `;
22
- const handlers = {
23
- list: () => {
24
- const res = getRedisList();
25
- console.log(res);
26
- },
27
- tunnel: (opts) => {
28
- const namespace = opts.required("namespace");
29
- const port = opts.optional("port") ?? '9379';
30
- establishRedisTunnel(namespace, port);
31
- },
32
- };
33
- function run(cmdObj) {
34
- if (cmdObj.help || cmdObj.args.length < 1)
35
- printUsageAndExit(usage);
36
- const parsed = cmdObj.parseOptions({ params: ["-p"] });
37
- const [command, namespace] = parsed.args;
38
- const port = parsed.options["-p"];
39
- // @ts-expect-error left as an exercise for the reader
40
- const handler = handlers[command];
41
- if (!handler) {
42
- console.error(`Unknown command: ${command}`);
43
- printUsageAndExit(usage);
44
- }
45
- const params = new StrongParams(usage, {
46
- namespace,
47
- port,
48
- });
49
- handler(params);
50
- }
51
- export const redisHa = { name: 'redis-ha', command: 'redis', oneLiner, keyExamples, run };
@@ -1,10 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const stackgres: {
4
- command: string;
5
- oneLiner: string;
6
- keyExamples: string;
7
- run: typeof run;
8
- };
9
- export {};
10
- //# sourceMappingURL=stackgres.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stackgres.d.ts","sourceRoot":"","sources":["../../../src/cli/extensions/stackgres.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AAsG9E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAiBpC;AAED,eAAO,MAAM,SAAS;;;;;CAAgD,CAAC"}
@@ -1,117 +0,0 @@
1
- import { connectToPatroni, connectToPsql, establishTunnel, getDbAdminPassword, getDbBackups, getDbList, getDbPasswords, } from "../../libs/k8s-db";
2
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
3
- const oneLiner = "Utilities to help day to day operations of production and staging databases";
4
- const keyExamples = `
5
- $ devops db list
6
- $ devops db backups
7
- $ devops db password ui
8
- $ devops db password db-staging
9
- $ devops db tunnel db-staging
10
- $ devops db patroni db-staging
11
- $ devops db psql db-staging
12
- `.trim();
13
- const usage = `
14
- ${oneLiner}
15
-
16
- NOTES
17
- The admin UI provided by Stackgres is great. It allows you to do most of the operations you need, such as
18
- restarting the cluster, upgrading postgres versions, and restoring from backups with point in time recovery (PITR).
19
-
20
- This utility complements the admin UI with a few helpful shortcuts.
21
-
22
- Note that the --env flag should not be used with these commands, as the DB namespaces follow different
23
- conventions than the monorepo env.
24
-
25
- This utility assumes that the cluster name and the namespace are always the same.
26
-
27
- COMMANDS
28
- list Lists the available clusters
29
- backups Lists all available backups
30
- password ui Shows the password to the admin UI
31
- password <namespace> Shows the superuser, replication, and authenticator password of the remote database
32
- patroni <namespace> Obtain a shell to the primary pod's patroni container, where you can run 'patronictl'
33
- psql <namespace> Runs 'psql' in the primary pod's postgres-utils container
34
- tunnel <namespace> [-p <port>] Sets up a tunnel to the remote database so you can access the DB from your local machine.
35
- By default, the port is taken from the namespace to make it easier to create connection profiles locally:
36
- db-staging: 7432, db-production: 8432, otherwise: 9432
37
-
38
- EXAMPLES
39
- ${keyExamples}
40
- `;
41
- const DEFAULT_PORTS = {
42
- "db-staging": "7432",
43
- "db-production": "8432",
44
- };
45
- const handlers = {
46
- list: () => {
47
- const res = getDbList();
48
- console.log(res);
49
- },
50
- backups: () => {
51
- const res = getDbBackups();
52
- console.log(res);
53
- },
54
- password: (opts) => {
55
- const namespace = opts.required("namespace");
56
- if (namespace === "ui") {
57
- const res = getDbAdminPassword();
58
- if (!res) {
59
- console.error("Failed to get the secret");
60
- process.exit(1);
61
- }
62
- else {
63
- console.log(`User: ${res.user}`);
64
- console.log(`Password: ${res.password}`);
65
- }
66
- return;
67
- }
68
- const res = getDbPasswords(namespace);
69
- if (!res) {
70
- console.error("Failed to get the secret");
71
- process.exit(1);
72
- }
73
- else {
74
- console.log("\nSuperuser");
75
- console.log(` ${res.superUser}`);
76
- console.log(` ${res.superPassword}`);
77
- console.log("\nAuthenticator");
78
- console.log(` ${res.authenticatorUser}`);
79
- console.log(` ${res.authenticatorPassword}`);
80
- console.log("\nReplication");
81
- console.log(` ${res.replicationUser}`);
82
- console.log(` ${res.replicationPassword}`);
83
- console.log();
84
- }
85
- },
86
- tunnel: (opts) => {
87
- // prettier-ignore
88
- const defaultPort = DEFAULT_PORTS[opts.required("namespace")] || "9432";
89
- const port = opts.optional("port") || defaultPort;
90
- establishTunnel(opts.required("namespace"), port);
91
- },
92
- patroni: (opts) => {
93
- connectToPatroni(opts.required("namespace"));
94
- },
95
- psql: (opts) => {
96
- connectToPsql(opts.required("namespace"));
97
- },
98
- };
99
- function run(cmdObj) {
100
- if (cmdObj.help || cmdObj.args.length < 1)
101
- printUsageAndExit(usage);
102
- const parsed = cmdObj.parseOptions({ params: ["-p"] });
103
- const [command, namespace] = parsed.args;
104
- const port = parsed.options["-p"];
105
- // @ts-expect-error left as an exercise for the reader
106
- const handler = handlers[command];
107
- if (!handler) {
108
- console.error(`Unknown command: ${command}`);
109
- printUsageAndExit(usage);
110
- }
111
- const params = new StrongParams(usage, {
112
- namespace,
113
- port,
114
- });
115
- handler(params);
116
- }
117
- export const stackgres = { command: 'db', oneLiner, keyExamples, run };
@@ -1,9 +0,0 @@
1
- import { CLICommandParser } from "../common";
2
- declare function run(cmdObj: CLICommandParser): void;
3
- export declare const template: {
4
- oneLiner: string;
5
- keyExamples: string;
6
- run: typeof run;
7
- };
8
- export {};
9
- //# sourceMappingURL=template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/cli/extensions/template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AA4I9E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAsBpC;AAED,eAAO,MAAM,QAAQ;;;;CAAiC,CAAC"}
@@ -1,121 +0,0 @@
1
- import {} from "../../libs/k8s-image-config";
2
- import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
3
- import { generateDbMigrateJob, generateDebugPod, generateWorkspaceDeployment, ImageContextGenerator } from "../../libs/k8s-generate";
4
- import chalk from "chalk";
5
- import { getWorkspace } from "../../libs/discovery";
6
- import { getWorkspaceImages } from "../../libs/discovery/images";
7
- import { getImageData, getImageNames } from "../../libs/config";
8
- const SUPPORTED_CONTEXT_TYPES = ['deployment', 'db-migrate', 'debug'];
9
- const oneLiner = "Utilities to help validate manifest templates rendering.";
10
- const keyExamples = `
11
- $ devops template context deployment www
12
- $ devops template context debug
13
- $ devops template context db-migrate
14
- $ devops template gen deployment www
15
- $ devops template gen debug main-node
16
- $ devops template gen db-migrate
17
- `.trim();
18
- const usage = `
19
- ${oneLiner}
20
-
21
- IMPORTANT
22
- This command generates examples only. It's intended to help design new templates by showing what context variables are available
23
- and how they get rendered using handlebar replacement. They should not be used to apply changes to the cluster.
24
-
25
- SHOW CONTEXT OBJECT
26
- devops template context deployment <workspace>
27
- devops template context db-migrate-job|debug
28
-
29
- Prints out a context object with dummy values for the specified template type.
30
- For deployment, the workspace name is required.
31
-
32
- GENERATE TEMPLATES
33
- devops template gen deployment <workspace>
34
- devops template gen debug <image>
35
- devops template gen db-migrate-job
36
-
37
- For deployment, generates an example manifest of a workspace, including override files present under the 'manifests' folder.
38
-
39
- EXAMPLES
40
- ${keyExamples}
41
- `;
42
- const handlers = {
43
- context: {
44
- 'deployment': (opts) => {
45
- const workspace = opts.required('workspaceOrImage');
46
- const workspaceData = getWorkspace(workspace);
47
- const packageDataWithDeployment = workspaceData.packageDataEntries.find((entry) => entry.deployment);
48
- if (!packageDataWithDeployment) {
49
- console.error(`No deployment found for workspace ${workspace}`);
50
- process.exit(1);
51
- }
52
- const randomImage = getWorkspaceImages(workspace)[0];
53
- console.warn(chalk.green("\nThis is a sample context object used to render a manifest template of type deployment:\n"));
54
- console.log(JSON.stringify(new ImageContextGenerator(opts.required('env'), randomImage, 'dummy-sha').getDeployment(packageDataWithDeployment), null, 2));
55
- },
56
- 'db-migrate': (opts) => {
57
- const randomImage = getWorkspaceImages('db').filter(image => getImageData(image)['can-db-migrate'])[0];
58
- if (!randomImage) {
59
- console.error("No image found with can-db-migrate=true in the db workspace.");
60
- process.exit(1);
61
- }
62
- console.warn(chalk.green("\nThis is a sample context object used to render a manifest template of type db-migrate:\n"));
63
- console.log(JSON.stringify(new ImageContextGenerator(opts.required('env'), randomImage, 'dummy-sha').getDbMigrate(), null, 2));
64
- },
65
- 'debug': (opts) => {
66
- const randomImage = getImageNames()[0];
67
- console.warn(chalk.green("\nThis is a sample context object used to render a manifest template of type debug:\n"));
68
- console.log(JSON.stringify(new ImageContextGenerator(opts.required('env'), randomImage, 'dummy-sha').getDebug(), null, 2));
69
- },
70
- },
71
- gen: {
72
- 'deployment': (opts) => {
73
- const workspace = opts.required('workspaceOrImage');
74
- const workspaceData = getWorkspace(workspace);
75
- const packageDataWithDeployment = workspaceData.packageDataEntries.find((entry) => entry.deployment);
76
- if (!packageDataWithDeployment) {
77
- console.error(`No deployment found for workspace ${workspace}`);
78
- process.exit(1);
79
- }
80
- const randomImage = getWorkspaceImages(workspace)[0];
81
- console.warn(chalk.green(`\nThis is a sample of generated manifests for the ${workspace} workspace:\n`));
82
- console.log(generateWorkspaceDeployment(packageDataWithDeployment, opts.required('env'), randomImage, 'dummy-sha'));
83
- },
84
- 'db-migrate': (opts) => {
85
- const randomImage = getWorkspaceImages('db').filter(image => getImageData(image)['can-db-migrate'])[0];
86
- if (!randomImage) {
87
- console.error("No image found with can-db-migrate=true in the db workspace.");
88
- process.exit(1);
89
- }
90
- console.warn(chalk.green("\nThis is a sample of generated manifests for the db-migrate job:\n"));
91
- console.log(generateDbMigrateJob(opts.required('env'), randomImage, 'dummy-sha'));
92
- },
93
- 'debug': (opts) => {
94
- const image = opts.required('workspaceOrImage');
95
- console.warn(chalk.green(`\nThis is a sample of generated manifests for the debug image ${image}:\n`));
96
- console.log(generateDebugPod(opts.required('env'), image, 'dummy-sha'));
97
- },
98
- },
99
- };
100
- function run(cmdObj) {
101
- if (cmdObj.help || cmdObj.args.length < 1)
102
- printUsageAndExit(usage);
103
- const [command, contextType, param] = cmdObj.args;
104
- const commandHandler = handlers[command];
105
- if (!commandHandler) {
106
- console.error(`Unknown command: ${command}`);
107
- printUsageAndExit(usage);
108
- }
109
- if (!SUPPORTED_CONTEXT_TYPES.includes(contextType)) {
110
- console.error(`Unknown context type: ${contextType}. Supported types: ${SUPPORTED_CONTEXT_TYPES.join(', ')}`);
111
- process.exit(1);
112
- }
113
- const handler = commandHandler[contextType];
114
- const params = new StrongParams(usage, {
115
- env: cmdObj.env === 'development' ? 'staging' : cmdObj.env,
116
- contextType,
117
- workspaceOrImage: param
118
- });
119
- handler(params);
120
- }
121
- export const template = { oneLiner, keyExamples, run };
@@ -1 +0,0 @@
1
- {"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../src/devops.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,0CAA0C,CAAC;AACzD,cAAc,sBAAsB,CAAC"}
@@ -1,15 +0,0 @@
1
- type AffectedOpts = {
2
- baseSha?: string;
3
- headSha?: string;
4
- fromLiveVersion?: boolean;
5
- monorepoEnv?: string;
6
- };
7
- export declare function isImageAffected(image: string, opts?: AffectedOpts): boolean;
8
- export declare function findImagesAffected(opts?: AffectedOpts): string[];
9
- export declare function isWorkspaceAffected(workspaceName: string, opts?: {
10
- baseSha?: string;
11
- headSha?: string;
12
- }): boolean;
13
- export declare function findImagesWithAffectedWorkspace(workspaceName: string, opts?: AffectedOpts): string[];
14
- export {};
15
- //# sourceMappingURL=affected-entities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"affected-entities.d.ts","sourceRoot":"","sources":["../../src/libs/affected-entities.ts"],"names":[],"mappings":"AAMA,KAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,YAAiB,WAoBrE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,YAAiB,YAIzD;AAED,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,WAIlD;AAED,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE,YAAiB,YAmBxB"}
@@ -1,52 +0,0 @@
1
- import { getImageNames } from "./config";
2
- import { getWorkspace } from "./discovery";
3
- import { getImageDescendentData, getWorkspaceImages } from "./discovery/images";
4
- import { commitExists, isAffected } from "./git-helpers";
5
- import { getImageVersion } from "./k8s-image-config";
6
- export function isImageAffected(image, opts = {}) {
7
- const headSha = opts.headSha ?? "HEAD";
8
- let baseSha;
9
- if (opts.fromLiveVersion) {
10
- if (!opts.monorepoEnv) {
11
- throw new Error("monorepoEnv is required when fromLiveVersion is true");
12
- }
13
- baseSha = getImageVersion(opts.monorepoEnv, image);
14
- if (!baseSha)
15
- return true;
16
- }
17
- baseSha ??= opts.baseSha ?? "HEAD^";
18
- const descendentData = getImageDescendentData(image);
19
- if (!commitExists(baseSha) || !commitExists(headSha))
20
- return true;
21
- for (const { rootPath } of descendentData) {
22
- if (isAffected(rootPath, { baseSha, headSha, skipCheck: true })) {
23
- return true;
24
- }
25
- }
26
- return false;
27
- }
28
- export function findImagesAffected(opts = {}) {
29
- return getImageNames().filter((imageName) => isImageAffected(imageName, opts));
30
- }
31
- export function isWorkspaceAffected(workspaceName, opts = {}) {
32
- const data = getWorkspace(workspaceName);
33
- return isAffected(data.rootPath, opts);
34
- }
35
- export function findImagesWithAffectedWorkspace(workspaceName, opts = {}) {
36
- const res = [];
37
- const headSha = opts.headSha ?? "HEAD";
38
- const defaultBaseSha = opts.baseSha ?? "HEAD^";
39
- const rootPath = getWorkspace(workspaceName).rootPath;
40
- if (opts.fromLiveVersion && !opts.monorepoEnv) {
41
- throw new Error("monorepoEnv is required when fromLiveVersion is true");
42
- }
43
- for (const imageName of getWorkspaceImages(workspaceName)) {
44
- const baseSha = opts.fromLiveVersion
45
- ? getImageVersion(opts.monorepoEnv, imageName)
46
- : defaultBaseSha;
47
- if (isAffected(rootPath, { baseSha, headSha })) {
48
- res.push(imageName);
49
- }
50
- }
51
- return res;
52
- }
@@ -1,16 +0,0 @@
1
- export declare function buildDev(image: string): Promise<void>;
2
- export declare function deploy({ image, env, sha, region, forwardEnv, allowUnauthenticated, cpu, memory, minInstances, maxInstances, timeout, extraArgs, }: {
3
- image: string;
4
- env: string;
5
- sha: string;
6
- region: string;
7
- forwardEnv?: string[];
8
- allowUnauthenticated?: boolean;
9
- cpu?: string;
10
- memory?: string;
11
- minInstances?: number;
12
- maxInstances?: number;
13
- timeout?: string;
14
- extraArgs?: string;
15
- }): Promise<void>;
16
- //# sourceMappingURL=cloudrun-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cloudrun-helpers.d.ts","sourceRoot":"","sources":["../../src/libs/cloudrun-helpers.ts"],"names":[],"mappings":"AA0CA,wBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,iBA2B3C;AAED,wBAAsB,MAAM,CAAC,EAC3B,KAAK,EACL,GAAG,EACH,GAAG,EACH,MAAM,EACN,UAAe,EACf,oBAA4B,EAC5B,GAAY,EACZ,MAAgB,EAChB,YAAgB,EAChB,YAAgB,EAChB,OAAe,EACf,SAAc,GACf,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,iBAsBA"}