@vaharoni/devops 1.0.47

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 (342) hide show
  1. package/README.md +51 -0
  2. package/dist/app-support/crypto/index.d.ts +15 -0
  3. package/dist/app-support/crypto/index.d.ts.map +1 -0
  4. package/dist/app-support/crypto/index.js +30 -0
  5. package/dist/app-support/crypto/internal-token.d.ts +20 -0
  6. package/dist/app-support/crypto/internal-token.d.ts.map +1 -0
  7. package/dist/app-support/crypto/internal-token.js +42 -0
  8. package/dist/app-support/crypto/internal-token.spec.d.ts +2 -0
  9. package/dist/app-support/crypto/internal-token.spec.d.ts.map +1 -0
  10. package/dist/app-support/crypto/internal-token.spec.js +45 -0
  11. package/dist/app-support/crypto/secret.d.ts +3 -0
  12. package/dist/app-support/crypto/secret.d.ts.map +1 -0
  13. package/dist/app-support/crypto/secret.js +12 -0
  14. package/dist/app-support/crypto/secret.spec.d.ts +2 -0
  15. package/dist/app-support/crypto/secret.spec.d.ts.map +1 -0
  16. package/dist/app-support/crypto/secret.spec.js +15 -0
  17. package/dist/app-support/discovery/dev-discovery-loader.d.ts +2 -0
  18. package/dist/app-support/discovery/dev-discovery-loader.d.ts.map +1 -0
  19. package/dist/app-support/discovery/dev-discovery-loader.js +30 -0
  20. package/dist/app-support/discovery/service-endpoint.d.ts +2 -0
  21. package/dist/app-support/discovery/service-endpoint.d.ts.map +1 -0
  22. package/dist/app-support/discovery/service-endpoint.js +10 -0
  23. package/dist/cli/affected.d.ts +11 -0
  24. package/dist/cli/affected.d.ts.map +1 -0
  25. package/dist/cli/affected.js +103 -0
  26. package/dist/cli/common.d.ts +89 -0
  27. package/dist/cli/common.d.ts.map +1 -0
  28. package/dist/cli/common.js +236 -0
  29. package/dist/cli/common.spec.d.ts +2 -0
  30. package/dist/cli/common.spec.d.ts.map +1 -0
  31. package/dist/cli/common.spec.js +64 -0
  32. package/dist/cli/console.d.ts +11 -0
  33. package/dist/cli/console.d.ts.map +1 -0
  34. package/dist/cli/console.js +35 -0
  35. package/dist/cli/constant.d.ts +11 -0
  36. package/dist/cli/constant.d.ts.map +1 -0
  37. package/dist/cli/constant.js +22 -0
  38. package/dist/cli/db.d.ts +11 -0
  39. package/dist/cli/db.d.ts.map +1 -0
  40. package/dist/cli/db.js +119 -0
  41. package/dist/cli/dml.d.ts +11 -0
  42. package/dist/cli/dml.d.ts.map +1 -0
  43. package/dist/cli/dml.js +116 -0
  44. package/dist/cli/env.d.ts +11 -0
  45. package/dist/cli/env.d.ts.map +1 -0
  46. package/dist/cli/env.js +67 -0
  47. package/dist/cli/exec.d.ts +11 -0
  48. package/dist/cli/exec.d.ts.map +1 -0
  49. package/dist/cli/exec.js +50 -0
  50. package/dist/cli/image.d.ts +11 -0
  51. package/dist/cli/image.d.ts.map +1 -0
  52. package/dist/cli/image.js +140 -0
  53. package/dist/cli/init.d.ts +11 -0
  54. package/dist/cli/init.d.ts.map +1 -0
  55. package/dist/cli/init.js +66 -0
  56. package/dist/cli/internal-curl.d.ts +11 -0
  57. package/dist/cli/internal-curl.d.ts.map +1 -0
  58. package/dist/cli/internal-curl.js +43 -0
  59. package/dist/cli/job.d.ts +11 -0
  60. package/dist/cli/job.d.ts.map +1 -0
  61. package/dist/cli/job.js +67 -0
  62. package/dist/cli/jwt.d.ts +11 -0
  63. package/dist/cli/jwt.d.ts.map +1 -0
  64. package/dist/cli/jwt.js +27 -0
  65. package/dist/cli/namespace.d.ts +11 -0
  66. package/dist/cli/namespace.d.ts.map +1 -0
  67. package/dist/cli/namespace.js +70 -0
  68. package/dist/cli/prep-build.d.ts +11 -0
  69. package/dist/cli/prep-build.d.ts.map +1 -0
  70. package/dist/cli/prep-build.js +82 -0
  71. package/dist/cli/prisma.d.ts +11 -0
  72. package/dist/cli/prisma.d.ts.map +1 -0
  73. package/dist/cli/prisma.js +25 -0
  74. package/dist/cli/redis.d.ts +11 -0
  75. package/dist/cli/redis.d.ts.map +1 -0
  76. package/dist/cli/redis.js +76 -0
  77. package/dist/cli/registry.d.ts +11 -0
  78. package/dist/cli/registry.d.ts.map +1 -0
  79. package/dist/cli/registry.js +58 -0
  80. package/dist/cli/run-many.d.ts +11 -0
  81. package/dist/cli/run-many.d.ts.map +1 -0
  82. package/dist/cli/run-many.js +50 -0
  83. package/dist/cli/run.d.ts +11 -0
  84. package/dist/cli/run.d.ts.map +1 -0
  85. package/dist/cli/run.js +37 -0
  86. package/dist/cli/template.d.ts +11 -0
  87. package/dist/cli/template.d.ts.map +1 -0
  88. package/dist/cli/template.js +123 -0
  89. package/dist/cli/test.d.ts +11 -0
  90. package/dist/cli/test.d.ts.map +1 -0
  91. package/dist/cli/test.js +28 -0
  92. package/dist/devops.d.ts +3 -0
  93. package/dist/devops.d.ts.map +1 -0
  94. package/dist/devops.js +103 -0
  95. package/dist/index.d.ts +4 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +3 -0
  98. package/dist/libs/affected-entities.d.ts +15 -0
  99. package/dist/libs/affected-entities.d.ts.map +1 -0
  100. package/dist/libs/affected-entities.js +52 -0
  101. package/dist/libs/config.d.ts +6 -0
  102. package/dist/libs/config.d.ts.map +1 -0
  103. package/dist/libs/config.js +98 -0
  104. package/dist/libs/dependencies.d.ts +19 -0
  105. package/dist/libs/dependencies.d.ts.map +1 -0
  106. package/dist/libs/dependencies.js +62 -0
  107. package/dist/libs/dependencies.spec.d.ts +2 -0
  108. package/dist/libs/dependencies.spec.d.ts.map +1 -0
  109. package/dist/libs/dependencies.spec.js +21 -0
  110. package/dist/libs/digital-ocean/container-reg.d.ts +6 -0
  111. package/dist/libs/digital-ocean/container-reg.d.ts.map +1 -0
  112. package/dist/libs/digital-ocean/container-reg.js +69 -0
  113. package/dist/libs/discovery/dependencies.d.ts +19 -0
  114. package/dist/libs/discovery/dependencies.d.ts.map +1 -0
  115. package/dist/libs/discovery/dependencies.js +62 -0
  116. package/dist/libs/discovery/dependencies.spec.d.ts +2 -0
  117. package/dist/libs/discovery/dependencies.spec.d.ts.map +1 -0
  118. package/dist/libs/discovery/dependencies.spec.js +21 -0
  119. package/dist/libs/discovery/images.d.ts +5 -0
  120. package/dist/libs/discovery/images.d.ts.map +1 -0
  121. package/dist/libs/discovery/images.js +45 -0
  122. package/dist/libs/discovery/index.d.ts +5 -0
  123. package/dist/libs/discovery/index.d.ts.map +1 -0
  124. package/dist/libs/discovery/index.js +55 -0
  125. package/dist/libs/discovery/package-json-processor.d.ts +3 -0
  126. package/dist/libs/discovery/package-json-processor.d.ts.map +1 -0
  127. package/dist/libs/discovery/package-json-processor.js +34 -0
  128. package/dist/libs/discovery/process-common.d.ts +25 -0
  129. package/dist/libs/discovery/process-common.d.ts.map +1 -0
  130. package/dist/libs/discovery/process-common.js +40 -0
  131. package/dist/libs/discovery/process-package-json.d.ts +3 -0
  132. package/dist/libs/discovery/process-package-json.d.ts.map +1 -0
  133. package/dist/libs/discovery/process-package-json.js +34 -0
  134. package/dist/libs/discovery/process-pyproject-toml.d.ts +3 -0
  135. package/dist/libs/discovery/process-pyproject-toml.d.ts.map +1 -0
  136. package/dist/libs/discovery/process-pyproject-toml.js +36 -0
  137. package/dist/libs/discovery/pyproject-toml-processor.d.ts +3 -0
  138. package/dist/libs/discovery/pyproject-toml-processor.d.ts.map +1 -0
  139. package/dist/libs/discovery/pyproject-toml-processor.js +39 -0
  140. package/dist/libs/git-helpers.d.ts +8 -0
  141. package/dist/libs/git-helpers.d.ts.map +1 -0
  142. package/dist/libs/git-helpers.js +20 -0
  143. package/dist/libs/hetzner/reg-secret.d.ts +3 -0
  144. package/dist/libs/hetzner/reg-secret.d.ts.map +1 -0
  145. package/dist/libs/hetzner/reg-secret.js +39 -0
  146. package/dist/libs/k8s-constants.d.ts +12 -0
  147. package/dist/libs/k8s-constants.d.ts.map +1 -0
  148. package/dist/libs/k8s-constants.js +66 -0
  149. package/dist/libs/k8s-db.d.ts +18 -0
  150. package/dist/libs/k8s-db.d.ts.map +1 -0
  151. package/dist/libs/k8s-db.js +73 -0
  152. package/dist/libs/k8s-generate.d.ts +17 -0
  153. package/dist/libs/k8s-generate.d.ts.map +1 -0
  154. package/dist/libs/k8s-generate.js +179 -0
  155. package/dist/libs/k8s-helpers.d.ts +11 -0
  156. package/dist/libs/k8s-helpers.d.ts.map +1 -0
  157. package/dist/libs/k8s-helpers.js +42 -0
  158. package/dist/libs/k8s-image-config.d.ts +8 -0
  159. package/dist/libs/k8s-image-config.d.ts.map +1 -0
  160. package/dist/libs/k8s-image-config.js +113 -0
  161. package/dist/libs/k8s-job-waiter.d.ts +8 -0
  162. package/dist/libs/k8s-job-waiter.d.ts.map +1 -0
  163. package/dist/libs/k8s-job-waiter.js +84 -0
  164. package/dist/libs/k8s-namespace.d.ts +7 -0
  165. package/dist/libs/k8s-namespace.d.ts.map +1 -0
  166. package/dist/libs/k8s-namespace.js +27 -0
  167. package/dist/libs/k8s-redis.d.ts +6 -0
  168. package/dist/libs/k8s-redis.d.ts.map +1 -0
  169. package/dist/libs/k8s-redis.js +31 -0
  170. package/dist/libs/k8s-secrets-manager.d.ts +5 -0
  171. package/dist/libs/k8s-secrets-manager.d.ts.map +1 -0
  172. package/dist/libs/k8s-secrets-manager.js +61 -0
  173. package/dist/libs/validate-env.d.ts +56 -0
  174. package/dist/libs/validate-env.d.ts.map +1 -0
  175. package/dist/libs/validate-env.js +214 -0
  176. package/dist/libs/validate-env.spec.d.ts +2 -0
  177. package/dist/libs/validate-env.spec.d.ts.map +1 -0
  178. package/dist/libs/validate-env.spec.js +168 -0
  179. package/dist/libs/workspace-discovery.d.ts +2 -0
  180. package/dist/libs/workspace-discovery.d.ts.map +1 -0
  181. package/dist/libs/workspace-discovery.js +75 -0
  182. package/dist/test.d.ts +2 -0
  183. package/dist/test.d.ts.map +1 -0
  184. package/dist/test.js +1 -0
  185. package/dist/types/index.d.ts +925 -0
  186. package/dist/types/index.d.ts.map +1 -0
  187. package/dist/types/index.js +79 -0
  188. package/package.json +55 -0
  189. package/src/app-support/crypto/index.ts +31 -0
  190. package/src/app-support/crypto/internal-token.spec.ts +53 -0
  191. package/src/app-support/crypto/internal-token.ts +82 -0
  192. package/src/app-support/crypto/secret.spec.ts +18 -0
  193. package/src/app-support/crypto/secret.ts +13 -0
  194. package/src/app-support/discovery/dev-discovery-loader.ts +35 -0
  195. package/src/app-support/discovery/service-endpoint.ts +12 -0
  196. package/src/cli/affected.ts +116 -0
  197. package/src/cli/common.spec.ts +78 -0
  198. package/src/cli/common.ts +323 -0
  199. package/src/cli/console.ts +46 -0
  200. package/src/cli/constant.ts +25 -0
  201. package/src/cli/db.ts +133 -0
  202. package/src/cli/dml.ts +126 -0
  203. package/src/cli/env.ts +87 -0
  204. package/src/cli/exec.sh +21 -0
  205. package/src/cli/exec.ts +57 -0
  206. package/src/cli/image.ts +197 -0
  207. package/src/cli/init.ts +75 -0
  208. package/src/cli/internal-curl.ts +48 -0
  209. package/src/cli/job.ts +80 -0
  210. package/src/cli/jwt.ts +32 -0
  211. package/src/cli/namespace.ts +78 -0
  212. package/src/cli/prep-build.ts +96 -0
  213. package/src/cli/prisma.ts +33 -0
  214. package/src/cli/redis.ts +83 -0
  215. package/src/cli/registry.ts +76 -0
  216. package/src/cli/run-many.ts +61 -0
  217. package/src/cli/run.ts +46 -0
  218. package/src/cli/template.ts +169 -0
  219. package/src/cli/test.ts +30 -0
  220. package/src/devops.ts +119 -0
  221. package/src/index.ts +3 -0
  222. package/src/libs/affected-entities.ts +71 -0
  223. package/src/libs/config.ts +117 -0
  224. package/src/libs/digital-ocean/container-reg.ts +81 -0
  225. package/src/libs/discovery/dependencies.spec.ts +25 -0
  226. package/src/libs/discovery/dependencies.ts +73 -0
  227. package/src/libs/discovery/images.ts +57 -0
  228. package/src/libs/discovery/index.ts +60 -0
  229. package/src/libs/discovery/process-common.ts +55 -0
  230. package/src/libs/discovery/process-package-json.ts +47 -0
  231. package/src/libs/discovery/process-pyproject-toml.ts +43 -0
  232. package/src/libs/git-helpers.ts +32 -0
  233. package/src/libs/hetzner/reg-secret.ts +54 -0
  234. package/src/libs/k8s-constants.ts +83 -0
  235. package/src/libs/k8s-db.ts +83 -0
  236. package/src/libs/k8s-generate.ts +211 -0
  237. package/src/libs/k8s-helpers.ts +59 -0
  238. package/src/libs/k8s-image-config.ts +165 -0
  239. package/src/libs/k8s-job-waiter.ts +124 -0
  240. package/src/libs/k8s-namespace.ts +41 -0
  241. package/src/libs/k8s-redis.ts +31 -0
  242. package/src/libs/k8s-secrets-manager.ts +79 -0
  243. package/src/libs/validate-env.spec.ts +223 -0
  244. package/src/libs/validate-env.ts +266 -0
  245. package/src/target-templates/.devops/config/constants.yaml +17 -0
  246. package/src/target-templates/.devops/config/images.yaml +88 -0
  247. package/src/target-templates/.devops/docker-images/common/docker-common.sh +23 -0
  248. package/src/target-templates/.devops/docker-images/node-services/node-exec.sh +8 -0
  249. package/src/target-templates/.devops/docker-images/node-services/node-run.sh +8 -0
  250. package/src/target-templates/.devops/docker-images/node-services.Dockerfile +34 -0
  251. package/src/target-templates/.devops/docker-images/python-services/python-exec.sh +8 -0
  252. package/src/target-templates/.devops/docker-images/python-services/python-run.sh +8 -0
  253. package/src/target-templates/.devops/docker-images/python-services.Dockerfile +29 -0
  254. package/src/target-templates/.devops/env.example.yaml +23 -0
  255. package/src/target-templates/.devops/infra/hetzner/abandoned/harbor-values.yaml +30 -0
  256. package/src/target-templates/.devops/infra/hetzner/abandoned/hcloud-config.yaml +134 -0
  257. package/src/target-templates/.devops/infra/hetzner/cert-manager.yaml +25 -0
  258. package/src/target-templates/.devops/infra/hetzner/harbor-cert.yaml +13 -0
  259. package/src/target-templates/.devops/infra/hetzner/harbor-values.yaml +76 -0
  260. package/src/target-templates/.devops/infra/hetzner/hcloud-config.yaml +113 -0
  261. package/src/target-templates/.devops/infra/hetzner/ingress-nginx-annotations.yaml +49 -0
  262. package/src/target-templates/.devops/infra/hetzner/ingress-nginx-configmap.yaml +8 -0
  263. package/src/target-templates/.devops/infra/hetzner/retain-storage-class.yaml +8 -0
  264. package/src/target-templates/.devops/infra/monitoring-ingress.yaml +62 -0
  265. package/src/target-templates/.devops/infra/stackgres-ui-ingress.yaml +35 -0
  266. package/src/target-templates/.devops/infra/test.yaml +60 -0
  267. package/src/target-templates/.devops/manifests/_index.yaml +21 -0
  268. package/src/target-templates/.devops/manifests/cron-jobs.yaml.hb +55 -0
  269. package/src/target-templates/.devops/manifests/db-migrate-job.yaml.hb +42 -0
  270. package/src/target-templates/.devops/manifests/deployment-debug.yaml.hb +44 -0
  271. package/src/target-templates/.devops/manifests/deployment-process.yaml.hb +47 -0
  272. package/src/target-templates/.devops/manifests/deployment-web.yaml.hb +53 -0
  273. package/src/target-templates/.devops/manifests/ingress.yaml.hb +21 -0
  274. package/src/target-templates/.devops/manifests/prefect.yaml.hb +62 -0
  275. package/src/target-templates/.devops/manifests/service.yaml.hb +15 -0
  276. package/src/target-templates/.devops/milvus/production/milvus-values.yaml +2 -0
  277. package/src/target-templates/.devops/milvus/staging/milvus-values.yaml +2 -0
  278. package/src/target-templates/.devops/postgres/DailyOperatorRestart.yaml +54 -0
  279. package/src/target-templates/.devops/postgres/production/cluster/PodDisruptionBudget.yaml +27 -0
  280. package/src/target-templates/.devops/postgres/production/cluster/SGCluster.yaml +47 -0
  281. package/src/target-templates/.devops/postgres/production/cluster/StackGres-alerts.yaml +191 -0
  282. package/src/target-templates/.devops/postgres/production/configurations/06-SGDistributedLogs.yaml +11 -0
  283. package/src/target-templates/.devops/postgres/production/configurations/07-SGObjectStorage.yaml +18 -0
  284. package/src/target-templates/.devops/postgres/production/configurations/08-SGScript.yaml +12 -0
  285. package/src/target-templates/.devops/postgres/staging/cluster/SGCluster.yaml +42 -0
  286. package/src/target-templates/.devops/postgres/staging/configurations/07-SGObjectStorage.yaml +18 -0
  287. package/src/target-templates/.devops/postgres/staging/configurations/08-SGScript.yaml +12 -0
  288. package/src/target-templates/.devops/prefect/production/prefect-values.yaml +14 -0
  289. package/src/target-templates/.devops/prefect/staging/prefect-values.yaml +14 -0
  290. package/src/target-templates/.devops/redis/production/redis-values.yaml +20 -0
  291. package/src/target-templates/.devops/redis/staging/redis-values.yaml +8 -0
  292. package/src/target-templates/.envrc +5 -0
  293. package/src/target-templates/.github/actions/build-image@v1/action.yaml +86 -0
  294. package/src/target-templates/.github/actions/connect-to-digital-ocean@v1/action.yaml +29 -0
  295. package/src/target-templates/.github/actions/connect-to-hetzner@v1/action.yaml +31 -0
  296. package/src/target-templates/.github/actions/connect-to-infra@v1/action.yaml +46 -0
  297. package/src/target-templates/.github/actions/db-migrate@v1/action.yaml +23 -0
  298. package/src/target-templates/.github/actions/deploy-image@v1/action.yaml +33 -0
  299. package/src/target-templates/.github/actions/setup-prereq@v1/action.yaml +29 -0
  300. package/src/target-templates/.github/workflows/k8s-build.yaml +84 -0
  301. package/src/target-templates/applications/example-data-pipeline/pyproject.toml +14 -0
  302. package/src/target-templates/applications/example-data-pipeline/src/example_data_pipeline/main.py +38 -0
  303. package/src/target-templates/applications/example-node/index.ts +30 -0
  304. package/src/target-templates/applications/example-node/package.json +26 -0
  305. package/src/target-templates/applications/example-node/tsconfig.json +3 -0
  306. package/src/target-templates/applications/example-python/pyproject.toml +20 -0
  307. package/src/target-templates/applications/example-python/src/example_python/__init__.py +0 -0
  308. package/src/target-templates/applications/example-python/src/example_python/main.py +13 -0
  309. package/src/target-templates/applications/example-python/src/example_python/scripts.py +17 -0
  310. package/src/target-templates/applications/example-python/tests/__init__.py +0 -0
  311. package/src/target-templates/applications/jobs/README.md +68 -0
  312. package/src/target-templates/applications/jobs/index.ts +1 -0
  313. package/src/target-templates/applications/jobs/package.json +30 -0
  314. package/src/target-templates/applications/jobs/tsconfig.json +3 -0
  315. package/src/target-templates/config/.env.development +1 -0
  316. package/src/target-templates/config/.env.global +4 -0
  317. package/src/target-templates/config/.env.test +1 -0
  318. package/src/target-templates/db/db/__init__.py +0 -0
  319. package/src/target-templates/db/db/db_client_test.py +46 -0
  320. package/src/target-templates/db/db-client-test.ts +140 -0
  321. package/src/target-templates/db/db-client.ts +19 -0
  322. package/src/target-templates/db/env.yaml +4 -0
  323. package/src/target-templates/db/package.json +17 -0
  324. package/src/target-templates/db/prisma/schema.prisma +24 -0
  325. package/src/target-templates/db/prisma-setup-vitest.ts +27 -0
  326. package/src/target-templates/db/pyproject.toml +14 -0
  327. package/src/target-templates/db/tsconfig.json +3 -0
  328. package/src/target-templates/devops +3 -0
  329. package/src/target-templates/devopspy +3 -0
  330. package/src/target-templates/dml/package.json +7 -0
  331. package/src/target-templates/dml/tsconfig.json +3 -0
  332. package/src/target-templates/libs/example-node-lib/bun.lock +27 -0
  333. package/src/target-templates/libs/example-node-lib/index.ts +3 -0
  334. package/src/target-templates/libs/example-node-lib/package.json +12 -0
  335. package/src/target-templates/libs/example-node-lib/tsconfig.json +3 -0
  336. package/src/target-templates/libs/example-python-lib/pyproject.toml +11 -0
  337. package/src/target-templates/libs/example-python-lib/src/example_python_lib/__init__.py +2 -0
  338. package/src/target-templates/pyproject.toml +19 -0
  339. package/src/target-templates/tmp/.gitkeep +0 -0
  340. package/src/target-templates/tsconfig.json +27 -0
  341. package/src/test.ts +0 -0
  342. package/src/types/index.ts +173 -0
@@ -0,0 +1,82 @@
1
+ import fs from "fs-extra";
2
+ import os from "os";
3
+ import path from "path";
4
+ import { CLICommandParser, printUsageAndExit } from "./common";
5
+ import { getImageData, getTemplateData } from "../libs/config";
6
+ import { getMonorepoSecret } from "../libs/k8s-secrets-manager";
7
+ import { getImageDescendentData } from "../libs/discovery/images";
8
+ const oneLiner = "Copies all dependencies of an image to a temporary folder in preparation for a Docker build";
9
+ const keyExamples = `
10
+ $ devops prep-build main-node
11
+ `.trim();
12
+ const usage = `
13
+ ${oneLiner}
14
+
15
+ USAGE
16
+ devops prep-build <image>
17
+
18
+ EXAMPLES
19
+ ${keyExamples}
20
+ `;
21
+ async function run(cmdObj) {
22
+ if (cmdObj.help || cmdObj.args.length === 0)
23
+ printUsageAndExit(usage);
24
+ const [image] = cmdObj.args;
25
+ const imageData = getImageData(image);
26
+ const imageTemplate = imageData["image-template"];
27
+ const dockerFile = `${imageTemplate}.Dockerfile`;
28
+ const dockerFilePath = path.join(".devops/docker-images", dockerFile);
29
+ const dockerImagePayloadPath = path.join(".devops/docker-images", imageTemplate);
30
+ const dockerCommonPayloadPath = path.join(".devops/docker-images", "common");
31
+ const imageTemplateData = getTemplateData(imageTemplate);
32
+ const copyCommon = imageTemplateData["copy-common"] ?? false;
33
+ const imageExtraContent = imageTemplateData["extra-content"] ?? [];
34
+ if (!fs.existsSync(dockerFilePath)) {
35
+ console.error(`The dockerfile ${dockerFilePath} does not exist`);
36
+ process.exit(1);
37
+ }
38
+ imageExtraContent.forEach((file) => {
39
+ if (!fs.existsSync(file)) {
40
+ console.error(`The file ${file} is specified in the extra-content section of ${image} but does not exist`);
41
+ process.exit(1);
42
+ }
43
+ });
44
+ const destFolder = `${os.tmpdir()}/image-${image}-${Date.now()}`;
45
+ // Avoid clutter stdout, as the caller will want to capture the final output to cd into it
46
+ console.warn(`Creating build in ${destFolder}`);
47
+ fs.mkdirSync(destFolder);
48
+ // Copy Dockerfile
49
+ console.warn(`COPYING Dockerfile`);
50
+ fs.copySync(dockerFilePath, path.join(destFolder, "Dockerfile"));
51
+ if (copyCommon) {
52
+ console.warn(`COPYING Docker common`);
53
+ fs.copySync(dockerCommonPayloadPath, destFolder);
54
+ }
55
+ console.warn(`COPYING Docker image payload`);
56
+ fs.copySync(dockerImagePayloadPath, destFolder);
57
+ console.warn(`COPYING .devops/config`);
58
+ fs.mkdirSync(path.join(destFolder, ".devops"));
59
+ fs.copySync(".devops/config", path.join(destFolder, ".devops/config"));
60
+ // Create config directory. It should be deleted by the docker image so that it can be mounted as a volume when the pod is run
61
+ console.warn(`CREATING config for the build process`);
62
+ fs.mkdirSync(path.join(destFolder, "config"));
63
+ const envFileData = getMonorepoSecret(cmdObj.env);
64
+ fs.writeFileSync(path.join(destFolder, `config/.env.global`), envFileData);
65
+ // Copy all dependencies
66
+ getImageDescendentData(image).forEach((project) => {
67
+ console.warn(`COPYING ${project.rootPath}`);
68
+ if (project.rootPath === ".devops")
69
+ return;
70
+ fs.copySync(project.rootPath, path.join(destFolder, project.rootPath));
71
+ });
72
+ // Copy image-extra content
73
+ console.warn(`COPYING files from image-extra-content`);
74
+ imageExtraContent.forEach((file) => {
75
+ fs.copySync(file, path.join(destFolder, file));
76
+ console.warn(` ${file}`);
77
+ });
78
+ console.log(destFolder);
79
+ }
80
+ export default {
81
+ "prep-build": { oneLiner, keyExamples, run },
82
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): Promise<void>;
3
+ declare const _default: {
4
+ prisma: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=prisma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../src/cli/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,UAAU,CAAC;AAuB/D,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAK1C;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,25 @@
1
+ import { CLICommandParser, printUsageAndExit } from "./common";
2
+ import url from "url";
3
+ import path from "path";
4
+ const __file__ = url.fileURLToPath(import.meta.url);
5
+ const __src__ = path.join(path.dirname(__file__), "../..", "src");
6
+ const execShPath = path.join(__src__, "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 prisma ${cmdObj.args.join(" ")}`, { checkEnvYaml: false }).spawn();
22
+ }
23
+ export default {
24
+ prisma: { oneLiner, keyExamples, run },
25
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): void;
3
+ declare const _default: {
4
+ redis: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/cli/redis.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AA2D7E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAiBpC;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,76 @@
1
+ import chalk from "chalk";
2
+ import { establishRedisTunnel, getRedisList, getRedisPassword } from "../libs/k8s-redis";
3
+ import { CLICommandParser, printUsageAndExit, StrongParams } from "./common";
4
+ const oneLiner = "Utilities to help accessing production and staging redis";
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 default {
75
+ redis: { oneLiner, keyExamples, run },
76
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): void;
3
+ declare const _default: {
4
+ registry: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/cli/registry.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,UAAU,CAAC;AAoD7E,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAYpC;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,58 @@
1
+ import { getConst, getImageData } from "../libs/config";
2
+ import { prune } from "../libs/digital-ocean/container-reg";
3
+ import { containerRegistryPath, containerRegistryRepoName, containerRegistryRepoPath, } from "../libs/k8s-constants";
4
+ import { CLICommandParser, StrongParams, printUsageAndExit } from "./common";
5
+ const oneLiner = "Manage container repositories";
6
+ const keyExamples = `
7
+ $ devops registry server-url
8
+ $ devops registry reg-url
9
+ $ devops registry repo-url my-image sha
10
+ $ devops registry prune my-image
11
+ `.trim();
12
+ const usage = `
13
+ ${oneLiner}
14
+
15
+ USAGE
16
+ Get base URLs
17
+ devops registry server-url
18
+ devops registry reg-url
19
+
20
+ Gets the URL of an image in the container registry:
21
+ devops registry repo-url <image> <sha> --env <env>
22
+
23
+ Prunes the repository of old images to enforce the "image-versions-to-keep" constant in config/constants.yaml:
24
+ devops registry prune <image> --env <env>
25
+
26
+ This is only relevant when the "infra" constant is set to "digitalocean".
27
+
28
+ EXAMPLES
29
+ ${keyExamples}
30
+ `;
31
+ const handlers = {
32
+ "server-url": () => console.log(getConst("registry-base-url")),
33
+ "reg-url": () => console.log(containerRegistryPath()),
34
+ "repo-url": (opts) => {
35
+ console.log(containerRegistryRepoPath(opts.required("image"), opts.required("env"), opts.required("sha")));
36
+ },
37
+ prune: (opts) => {
38
+ const regName = containerRegistryPath();
39
+ const repoName = containerRegistryRepoName(opts.required("image"), opts.required("env"));
40
+ prune(regName, repoName);
41
+ },
42
+ };
43
+ function run(cmdObj) {
44
+ if (cmdObj.help || cmdObj.args.length < 1)
45
+ printUsageAndExit(usage);
46
+ const [command, image, sha] = cmdObj.args;
47
+ // @ts-expect-error left as an exercise for the reader
48
+ const handler = handlers[command];
49
+ if (!handler) {
50
+ console.error(`Unknown command: ${command}`);
51
+ printUsageAndExit(usage);
52
+ }
53
+ const params = new StrongParams(usage, { image, env: cmdObj.env, sha });
54
+ handler(params);
55
+ }
56
+ export default {
57
+ registry: { oneLiner, keyExamples, run },
58
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): Promise<void>;
3
+ declare const _default: {
4
+ "run-many": {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=run-many.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-many.d.ts","sourceRoot":"","sources":["../../src/cli/run-many.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,UAAU,CAAC;AAyB/D,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBA8B1C;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,50 @@
1
+ import { workspaceDirectoryForLanguage } from "../libs/discovery";
2
+ import { CLICommandParser, printUsageAndExit } from "./common";
3
+ import concurrently, {} from "concurrently";
4
+ const oneLiner = "Runs a script concurrently in all projects that define it in their package.json";
5
+ const keyExamples = `
6
+ $ devops run-many build
7
+ `.trim();
8
+ const usage = `
9
+ ${oneLiner}
10
+
11
+ USAGE
12
+ devops run-many <script-name> [--kill-others-on-fail]
13
+
14
+ NOTE
15
+ Only works for node projects. Use 'devopspy' for python projects.
16
+
17
+ EXAMPLES
18
+ ${keyExamples}
19
+ `;
20
+ async function run(cmdObj) {
21
+ if (cmdObj.help || cmdObj.args.length === 0)
22
+ printUsageAndExit(usage);
23
+ const parsed = cmdObj.parseOptions({ booleans: ["--kill-others-on-fail"] });
24
+ const [script] = parsed.args;
25
+ const remaining = parsed.args.slice(1).join(" ");
26
+ const commands = [];
27
+ Object.values(workspaceDirectoryForLanguage('node')).forEach(async (packageData) => {
28
+ if (packageData.scripts?.[script]) {
29
+ commands.push({
30
+ name: packageData.name,
31
+ command: `devops --env ${cmdObj.env} run ${packageData.name}:${script} ${remaining}`,
32
+ });
33
+ }
34
+ });
35
+ if (!commands.length) {
36
+ console.error(`No workspaces define the script: ${script}`);
37
+ process.exit(0);
38
+ }
39
+ // prettier-ignore
40
+ const options = parsed.options["--kill-others-on-fail"] ? { killOthers: "failure" } : {};
41
+ concurrently(commands, options)
42
+ .result.then(() => { })
43
+ .catch((error) => {
44
+ console.error("One of the commands failed");
45
+ process.exit(1);
46
+ });
47
+ }
48
+ export default {
49
+ "run-many": { oneLiner, keyExamples, run },
50
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): Promise<void>;
3
+ declare const _default: {
4
+ run: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,UAAU,CAAC;AA2B/D,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAc1C;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,37 @@
1
+ import { CLICommandParser, printUsageAndExit } from "./common";
2
+ import url from "url";
3
+ import path from "path";
4
+ import { getWorkspace } from "../libs/discovery";
5
+ const __file__ = url.fileURLToPath(import.meta.url);
6
+ const __src__ = path.join(path.dirname(__file__), "../..", "src");
7
+ const execShPath = path.join(__src__, "cli/exec.sh");
8
+ const oneLiner = "Runs a script defined in package.json after injecting env variables";
9
+ const keyExamples = `$ devops run project:test`;
10
+ const usage = `
11
+ ${oneLiner}
12
+
13
+ GENERAL USAGE
14
+ devops run <project-name>:<script-name> [--] [options for script]
15
+
16
+ NOTES
17
+ - Only works for node projects. Use 'devopspy' for python projects.
18
+ - Does not allow interactive mode. If you need interactivity, use devops exec instead.
19
+
20
+ EXAMPLES
21
+ ${keyExamples}
22
+ `;
23
+ async function run(cmdObj) {
24
+ if (cmdObj.help || cmdObj.args.length === 0)
25
+ printUsageAndExit(usage);
26
+ const [workspace, script] = cmdObj.args[0].split(":");
27
+ if (!workspace || !script)
28
+ printUsageAndExit(usage);
29
+ const rootPath = getWorkspace(workspace).rootPath;
30
+ const remaining = cmdObj.args.slice(1).join(" ");
31
+ cmdObj
32
+ .executorFromEnv(`${execShPath} ${rootPath} bun run ${script} ${remaining}`, { checkEnvYaml: true })
33
+ .spawn();
34
+ }
35
+ export default {
36
+ run: { oneLiner, keyExamples, run },
37
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "../../src/cli/common";
2
+ declare function run(cmdObj: CLICommandParser): void;
3
+ declare const _default: {
4
+ template: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/cli/template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,sBAAsB,CAAC;AA4IzF,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAsBpC;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,123 @@
1
+ import {} from "../libs/k8s-image-config";
2
+ import { CLICommandParser, printUsageAndExit, StrongParams } from "../../src/cli/common";
3
+ import { generateDbMigrateJob, generateDebugDeployment, 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(generateDebugDeployment(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 default {
122
+ template: { oneLiner, keyExamples, run },
123
+ };
@@ -0,0 +1,11 @@
1
+ import { CLICommandParser } from "./common";
2
+ declare function run(cmdObj: CLICommandParser): void;
3
+ declare const _default: {
4
+ test: {
5
+ oneLiner: string;
6
+ keyExamples: string;
7
+ run: typeof run;
8
+ };
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/cli/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsC,MAAM,UAAU,CAAC;AAehF,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAUpC;;;;;;;;AAED,wBAEE"}
@@ -0,0 +1,28 @@
1
+ import { CLICommandParser, CommandExecutor, printUsageAndExit } from "./common";
2
+ const oneLiner = "Runs tests in all projects or one specific project";
3
+ const keyExamples = `
4
+ $ devops test
5
+ $ devops test project
6
+ `;
7
+ const usage = `
8
+ ${oneLiner}
9
+
10
+ USAGE
11
+ ${keyExamples}
12
+ `;
13
+ function run(cmdObj) {
14
+ const options = cmdObj.parseOptions({ params: ["--in"] });
15
+ if (cmdObj.help || options.args.length > 1)
16
+ printUsageAndExit(usage);
17
+ const workspace = options.args[0];
18
+ const env = cmdObj.envForced ? cmdObj.env : "test";
19
+ if (workspace) {
20
+ new CommandExecutor(`devops run ${workspace}:test --env ${env}`).spawn();
21
+ }
22
+ else {
23
+ new CommandExecutor(`devops run-many test --env ${env}`).spawn();
24
+ }
25
+ }
26
+ export default {
27
+ test: { oneLiner, keyExamples, run },
28
+ };
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=devops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../src/devops.ts"],"names":[],"mappings":""}