@catladder/pipeline 1.144.1 → 1.146.0

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 (335) hide show
  1. package/dist/bash/BashExpression.d.ts +40 -0
  2. package/dist/bash/BashExpression.js +124 -0
  3. package/dist/bash/bashExpressionPerPipelineType.d.ts +6 -0
  4. package/dist/bash/bashExpressionPerPipelineType.js +11 -0
  5. package/dist/bash/bashYaml.d.ts +10 -0
  6. package/dist/bash/bashYaml.js +46 -0
  7. package/dist/bash/getInjectVarsScript.d.ts +2 -0
  8. package/dist/bash/getInjectVarsScript.js +45 -0
  9. package/dist/bash/replaceAsync.d.ts +2 -0
  10. package/dist/{pipeline/commitInfo/getCommitInfo.js → bash/replaceAsync.js} +49 -21
  11. package/dist/build/base/__tests__/createArtifactsConfig.test.js +3 -1
  12. package/dist/build/base/constants.js +3 -1
  13. package/dist/build/base/createAppBuildJob.d.ts +2 -1
  14. package/dist/build/base/createAppBuildJob.js +10 -6
  15. package/dist/build/base/createArtifactsConfig.d.ts +1 -1
  16. package/dist/build/base/createArtifactsConfig.js +3 -1
  17. package/dist/build/base/index.js +3 -1
  18. package/dist/build/base/writeBuildInfo.js +4 -3
  19. package/dist/build/base/writeDotEnv.js +12 -3
  20. package/dist/build/custom/__tests__/testJob.test.js +3 -1
  21. package/dist/build/custom/buildJob.js +4 -12
  22. package/dist/build/custom/index.js +3 -1
  23. package/dist/build/custom/testJob.d.ts +1 -1
  24. package/dist/build/custom/testJob.js +18 -14
  25. package/dist/build/docker.d.ts +5 -31
  26. package/dist/build/docker.js +16 -9
  27. package/dist/build/index.d.ts +1 -1
  28. package/dist/build/index.js +13 -7
  29. package/dist/build/node/buildJob.js +4 -12
  30. package/dist/build/node/cache.js +6 -3
  31. package/dist/build/node/constants.js +3 -1
  32. package/dist/build/node/index.js +3 -1
  33. package/dist/build/node/meteor.js +5 -2
  34. package/dist/build/node/testJob.js +18 -14
  35. package/dist/build/node/yarn.d.ts +3 -2
  36. package/dist/build/node/yarn.js +6 -3
  37. package/dist/build/rails/build.js +3 -1
  38. package/dist/build/rails/index.js +3 -1
  39. package/dist/build/rails/test.js +15 -11
  40. package/dist/build/sbom.js +3 -1
  41. package/dist/build/types.d.ts +24 -18
  42. package/dist/build/types.js +3 -1
  43. package/dist/bundles/catladder-gitlab/index.js +3 -3
  44. package/dist/catladder-gitlab.js +10 -54
  45. package/dist/config/__tests__/configruedEnvs.test.js +3 -1
  46. package/dist/config/configruedEnvs.js +3 -1
  47. package/dist/config/index.js +13 -7
  48. package/dist/config/readConfig.js +6 -5
  49. package/dist/constants.js +5 -3
  50. package/dist/context/__tests__/resolveReferences.test.js +40 -8
  51. package/dist/context/getBuildInfoVariables.d.ts +7 -0
  52. package/dist/context/getBuildInfoVariables.js +29 -0
  53. package/dist/context/getEnvConfig.js +3 -1
  54. package/dist/context/getEnvType.js +3 -1
  55. package/dist/context/getEnvironment.d.ts +3 -3
  56. package/dist/context/getEnvironment.js +10 -14
  57. package/dist/context/getEnvironmentContext.d.ts +7 -3
  58. package/dist/context/getEnvironmentContext.js +21 -11
  59. package/dist/context/getEnvironmentVariables.d.ts +26 -5
  60. package/dist/context/getEnvironmentVariables.js +40 -25
  61. package/dist/context/getLabels.js +4 -2
  62. package/dist/context/getReviewSlug.d.ts +4 -0
  63. package/dist/context/getReviewSlug.js +22 -0
  64. package/dist/context/index.d.ts +12 -3
  65. package/dist/context/index.js +21 -15
  66. package/dist/context/resolveReferences.d.ts +3 -1
  67. package/dist/context/resolveReferences.js +53 -21
  68. package/dist/context/transformJobOnlyVars.d.ts +5 -2
  69. package/dist/context/transformJobOnlyVars.js +4 -2
  70. package/dist/context/utils/envVars.d.ts +1 -1
  71. package/dist/context/utils/envVars.js +5 -2
  72. package/dist/defaults/index.js +3 -1
  73. package/dist/deploy/base/deploy.d.ts +1 -1
  74. package/dist/deploy/base/deploy.js +12 -11
  75. package/dist/deploy/base/index.js +3 -1
  76. package/dist/deploy/base/rollback.d.ts +1 -1
  77. package/dist/deploy/base/rollback.js +13 -9
  78. package/dist/deploy/base/stop.d.ts +1 -1
  79. package/dist/deploy/base/stop.js +16 -11
  80. package/dist/deploy/base/types.d.ts +1 -1
  81. package/dist/deploy/base/types.js +3 -1
  82. package/dist/deploy/base/variables.js +3 -1
  83. package/dist/deploy/cloudRun/artifactsRegistry.d.ts +2 -1
  84. package/dist/deploy/cloudRun/artifactsRegistry.js +6 -4
  85. package/dist/deploy/cloudRun/cleanup.js +3 -1
  86. package/dist/deploy/cloudRun/cloudRunRevisions.js +3 -1
  87. package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +8 -5
  88. package/dist/deploy/cloudRun/createJobs/cloudRunServices.d.ts +2 -2
  89. package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +6 -3
  90. package/dist/deploy/cloudRun/createJobs/common.d.ts +3 -3
  91. package/dist/deploy/cloudRun/createJobs/common.js +3 -1
  92. package/dist/deploy/cloudRun/createJobs/constants.d.ts +1 -0
  93. package/dist/deploy/cloudRun/createJobs/constants.js +7 -0
  94. package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +10 -4
  95. package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +3 -1
  96. package/dist/deploy/cloudRun/createJobs/index.js +25 -8
  97. package/dist/deploy/cloudRun/createJobs/volumes.js +3 -1
  98. package/dist/deploy/cloudRun/index.js +5 -3
  99. package/dist/deploy/cloudRun/utils/createArgsString.d.ts +2 -1
  100. package/dist/deploy/cloudRun/utils/createArgsString.js +3 -1
  101. package/dist/deploy/cloudRun/utils/database.js +13 -13
  102. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +3 -1
  103. package/dist/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
  104. package/dist/deploy/cloudRun/utils/getServiceName.js +3 -1
  105. package/dist/deploy/cloudRun/utils/jobName.d.ts +2 -1
  106. package/dist/deploy/cloudRun/utils/jobName.js +4 -2
  107. package/dist/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +3 -1
  108. package/dist/deploy/cloudSql/utils.d.ts +2 -1
  109. package/dist/deploy/cloudSql/utils.js +7 -2
  110. package/dist/deploy/custom/deployJob.js +3 -1
  111. package/dist/deploy/custom/index.js +3 -1
  112. package/dist/deploy/dockerTag/deployJob.js +3 -1
  113. package/dist/deploy/dockerTag/index.js +3 -1
  114. package/dist/deploy/index.d.ts +4 -3
  115. package/dist/deploy/index.js +13 -7
  116. package/dist/deploy/kubernetes/additionalSecretKeys.js +3 -1
  117. package/dist/deploy/kubernetes/cloudSql/index.d.ts +3 -2
  118. package/dist/deploy/kubernetes/cloudSql/index.js +6 -4
  119. package/dist/deploy/kubernetes/deployJob.js +22 -15
  120. package/dist/deploy/kubernetes/index.js +51 -14
  121. package/dist/deploy/kubernetes/kubeEnv.d.ts +3 -2
  122. package/dist/deploy/kubernetes/kubeEnv.js +7 -4
  123. package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
  124. package/dist/deploy/kubernetes/kubeValues.js +4 -5
  125. package/dist/deploy/kubernetes/mongodb.js +3 -1
  126. package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +2 -1
  127. package/dist/deploy/kubernetes/processSecretsAsFiles.js +3 -1
  128. package/dist/deploy/sbom.js +3 -1
  129. package/dist/deploy/types/base.d.ts +8 -2
  130. package/dist/deploy/types/base.js +3 -1
  131. package/dist/deploy/types/custom.d.ts +1 -1
  132. package/dist/deploy/types/custom.js +3 -1
  133. package/dist/deploy/types/dockerTag.d.ts +1 -1
  134. package/dist/deploy/types/dockerTag.js +3 -1
  135. package/dist/deploy/types/googleCloudRun.d.ts +19 -18
  136. package/dist/deploy/types/googleCloudRun.js +3 -1
  137. package/dist/deploy/types/index.d.ts +6 -6
  138. package/dist/deploy/types/index.js +13 -7
  139. package/dist/deploy/types/kubernetes.d.ts +22 -22
  140. package/dist/deploy/types/kubernetes.js +3 -1
  141. package/dist/deploy/utils.js +3 -1
  142. package/dist/index.d.ts +3 -2
  143. package/dist/index.js +16 -9
  144. package/dist/packageInfos.d.ts +2 -0
  145. package/dist/packageInfos.js +14 -0
  146. package/dist/pipeline/createAllJobs.d.ts +13 -5
  147. package/dist/pipeline/createAllJobs.js +21 -10
  148. package/dist/pipeline/createChildPipeline.d.ts +1 -1
  149. package/dist/pipeline/createChildPipeline.js +24 -7
  150. package/dist/pipeline/createJobsForComponent.d.ts +3 -3
  151. package/dist/pipeline/createJobsForComponent.js +19 -18
  152. package/dist/pipeline/createMainPipeline.d.ts +3 -0
  153. package/dist/pipeline/createMainPipeline.js +248 -0
  154. package/dist/pipeline/generatePipelineFiles.d.ts +2 -0
  155. package/dist/pipeline/generatePipelineFiles.js +178 -0
  156. package/dist/pipeline/getPipelineStages.js +3 -1
  157. package/dist/pipeline/gitlab/createGitlabJobs.d.ts +15 -5
  158. package/dist/pipeline/gitlab/createGitlabJobs.js +98 -25
  159. package/dist/pipeline/gitlab/createGitlabPipeline.d.ts +7 -2
  160. package/dist/pipeline/gitlab/createGitlabPipeline.js +34 -17
  161. package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.d.ts +1 -0
  162. package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +29 -0
  163. package/dist/pipeline/gitlab/gitlabReleaseJobs.d.ts +33 -0
  164. package/dist/pipeline/gitlab/gitlabReleaseJobs.js +24 -0
  165. package/dist/pipeline/index.d.ts +3 -1
  166. package/dist/pipeline/index.js +16 -8
  167. package/dist/pipeline/packageManager.js +4 -2
  168. package/dist/pipeline/yarn/yarnUtils.js +6 -4
  169. package/dist/rules/index.d.ts +4 -1
  170. package/dist/rules/index.js +25 -18
  171. package/dist/runner/index.d.ts +1 -1
  172. package/dist/runner/index.js +3 -1
  173. package/dist/tsconfig.tsbuildinfo +1 -1
  174. package/dist/types/config.d.ts +18 -15
  175. package/dist/types/config.js +5 -2
  176. package/dist/types/context.d.ts +37 -32
  177. package/dist/types/context.js +3 -1
  178. package/dist/types/environmentContext.d.ts +11 -7
  179. package/dist/types/environmentContext.js +3 -1
  180. package/dist/types/gitlab-ci-yml.d.ts +30 -30
  181. package/dist/types/gitlab-ci-yml.js +3 -2
  182. package/dist/types/gitlab-types.d.ts +4 -6
  183. package/dist/types/gitlab-types.js +3 -1
  184. package/dist/types/index.js +13 -7
  185. package/dist/types/jobs.d.ts +23 -6
  186. package/dist/types/jobs.js +3 -1
  187. package/dist/types/pipeline.d.ts +4 -3
  188. package/dist/types/pipeline.js +3 -1
  189. package/dist/types/utils.d.ts +1 -1
  190. package/dist/types/utils.js +3 -1
  191. package/dist/utils/gitlab.js +3 -1
  192. package/dist/utils/index.d.ts +1 -1
  193. package/dist/utils/index.js +3 -1
  194. package/dist/utils/writeFiles.d.ts +7 -0
  195. package/dist/{pipeline/commitInfo/getBuildId.js → utils/writeFiles.js} +39 -22
  196. package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +480 -384
  197. package/examples/__snapshots__/cloud-run-meteor-with-worker.ts.snap +462 -366
  198. package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +480 -384
  199. package/examples/__snapshots__/cloud-run-no-service.ts.snap +501 -393
  200. package/examples/__snapshots__/cloud-run-non-public.ts.snap +480 -384
  201. package/examples/__snapshots__/cloud-run-post-stop-job.ts.snap +489 -392
  202. package/examples/__snapshots__/cloud-run-service-gen2.ts.snap +480 -384
  203. package/examples/__snapshots__/cloud-run-service-with-volumes.ts.snap +501 -401
  204. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +1155 -915
  205. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1116 -888
  206. package/examples/__snapshots__/cloud-run-with-worker.ts.snap +482 -386
  207. package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +452 -356
  208. package/examples/__snapshots__/custom-build-job.ts.snap +434 -350
  209. package/examples/__snapshots__/custom-deploy.ts.snap +319 -223
  210. package/examples/__snapshots__/custom-envs.ts.snap +123 -81
  211. package/examples/__snapshots__/custom-sbom-java.ts.snap +434 -350
  212. package/examples/__snapshots__/kubernetes-application-customization.ts.snap +846 -969
  213. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +886 -957
  214. package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +894 -969
  215. package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +1626 -1728
  216. package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +974 -1137
  217. package/examples/__snapshots__/local-dot-env.ts.snap +480 -384
  218. package/examples/__snapshots__/meteor-kubernetes.ts.snap +906 -1069
  219. package/examples/__snapshots__/multiline-var.ts.snap +4500 -0
  220. package/examples/__snapshots__/native-app.ts.snap +706 -578
  221. package/examples/__snapshots__/node-build-with-custom-image.ts.snap +480 -384
  222. package/examples/__snapshots__/node-build-with-docker-additions.ts.snap +488 -384
  223. package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +1656 -1942
  224. package/examples/__snapshots__/wait-for-other-deploy.ts.snap +287 -231
  225. package/examples/__utils__/helpers.ts +2 -2
  226. package/examples/custom-deploy.ts +7 -7
  227. package/examples/multiline-var.ts +64 -0
  228. package/package.json +5 -8
  229. package/scripts/generate-gitlab-ci-types.ts +2 -2
  230. package/src/bash/BashExpression.ts +81 -0
  231. package/src/bash/bashExpressionPerPipelineType.ts +16 -0
  232. package/src/bash/bashYaml.ts +46 -0
  233. package/src/bash/getInjectVarsScript.ts +12 -0
  234. package/src/bash/replaceAsync.ts +50 -0
  235. package/src/build/base/__tests__/createArtifactsConfig.test.ts +3 -3
  236. package/src/build/base/createAppBuildJob.ts +8 -4
  237. package/src/build/base/createArtifactsConfig.ts +2 -2
  238. package/src/build/base/index.ts +1 -1
  239. package/src/build/base/writeBuildInfo.ts +1 -1
  240. package/src/build/base/writeDotEnv.ts +6 -1
  241. package/src/build/custom/__tests__/testJob.test.ts +1 -1
  242. package/src/build/custom/buildJob.ts +4 -6
  243. package/src/build/custom/testJob.ts +6 -5
  244. package/src/build/docker.ts +21 -13
  245. package/src/build/index.ts +1 -1
  246. package/src/build/node/buildJob.ts +3 -5
  247. package/src/build/node/cache.ts +4 -4
  248. package/src/build/node/meteor.ts +1 -1
  249. package/src/build/node/testJob.ts +6 -5
  250. package/src/build/node/yarn.ts +14 -9
  251. package/src/build/rails/test.ts +2 -1
  252. package/src/build/types.ts +8 -1
  253. package/src/catladder-gitlab.ts +8 -55
  254. package/src/config/configruedEnvs.ts +6 -6
  255. package/src/config/readConfig.ts +4 -5
  256. package/src/constants.ts +5 -2
  257. package/src/context/__tests__/resolveReferences.test.ts +11 -6
  258. package/src/context/getBuildInfoVariables.ts +40 -0
  259. package/src/context/getEnvConfig.ts +1 -1
  260. package/src/context/getEnvType.ts +1 -1
  261. package/src/context/getEnvironment.ts +7 -30
  262. package/src/context/getEnvironmentContext.ts +25 -29
  263. package/src/context/getEnvironmentVariables.ts +72 -47
  264. package/src/context/getReviewSlug.ts +27 -0
  265. package/src/context/index.ts +26 -25
  266. package/src/context/resolveReferences.ts +40 -17
  267. package/src/context/transformJobOnlyVars.ts +6 -3
  268. package/src/context/utils/envVars.ts +5 -4
  269. package/src/deploy/base/deploy.ts +25 -23
  270. package/src/deploy/base/index.ts +1 -1
  271. package/src/deploy/base/rollback.ts +9 -11
  272. package/src/deploy/base/stop.ts +9 -10
  273. package/src/deploy/cloudRun/artifactsRegistry.ts +13 -8
  274. package/src/deploy/cloudRun/cleanup.ts +3 -3
  275. package/src/deploy/cloudRun/cloudRunRevisions.ts +3 -3
  276. package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +22 -17
  277. package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +7 -6
  278. package/src/deploy/cloudRun/createJobs/common.ts +1 -1
  279. package/src/deploy/cloudRun/createJobs/constants.ts +1 -0
  280. package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +25 -7
  281. package/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts +1 -1
  282. package/src/deploy/cloudRun/createJobs/index.ts +18 -9
  283. package/src/deploy/cloudRun/createJobs/volumes.ts +2 -2
  284. package/src/deploy/cloudRun/index.ts +22 -10
  285. package/src/deploy/cloudRun/utils/createArgsString.ts +3 -2
  286. package/src/deploy/cloudRun/utils/database.ts +7 -7
  287. package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +1 -1
  288. package/src/deploy/cloudRun/utils/jobName.ts +7 -2
  289. package/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.ts +1 -1
  290. package/src/deploy/cloudSql/utils.ts +13 -10
  291. package/src/deploy/index.ts +5 -4
  292. package/src/deploy/kubernetes/cloudSql/index.ts +6 -5
  293. package/src/deploy/kubernetes/deployJob.ts +28 -14
  294. package/src/deploy/kubernetes/index.ts +15 -8
  295. package/src/deploy/kubernetes/kubeEnv.ts +9 -7
  296. package/src/deploy/kubernetes/kubeValues.ts +5 -6
  297. package/src/deploy/kubernetes/mongodb.ts +1 -1
  298. package/src/deploy/kubernetes/processSecretsAsFiles.ts +5 -4
  299. package/src/deploy/types/base.ts +6 -0
  300. package/src/deploy/types/googleCloudRun.ts +2 -0
  301. package/src/deploy/utils.ts +2 -2
  302. package/src/index.ts +2 -1
  303. package/src/packageInfos.ts +10 -0
  304. package/src/pipeline/createAllJobs.ts +28 -14
  305. package/src/pipeline/createChildPipeline.ts +20 -9
  306. package/src/pipeline/createJobsForComponent.ts +15 -23
  307. package/src/pipeline/createMainPipeline.ts +91 -0
  308. package/src/pipeline/generatePipelineFiles.ts +29 -0
  309. package/src/pipeline/getPipelineStages.ts +1 -1
  310. package/src/pipeline/gitlab/createGitlabJobs.ts +182 -59
  311. package/src/pipeline/gitlab/createGitlabPipeline.ts +16 -14
  312. package/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.ts +46 -0
  313. package/src/pipeline/gitlab/gitlabReleaseJobs.ts +20 -0
  314. package/src/pipeline/index.ts +2 -0
  315. package/src/pipeline/packageManager.ts +2 -2
  316. package/src/pipeline/yarn/yarnUtils.ts +7 -7
  317. package/src/rules/index.ts +15 -9
  318. package/src/types/config.ts +12 -3
  319. package/src/types/context.ts +39 -26
  320. package/src/types/environmentContext.ts +13 -7
  321. package/src/types/gitlab-ci-yml.ts +0 -1
  322. package/src/types/gitlab-types.ts +5 -4
  323. package/src/types/jobs.ts +29 -4
  324. package/src/types/pipeline.ts +4 -0
  325. package/src/types/utils.ts +4 -4
  326. package/src/utils/gitlab.ts +1 -1
  327. package/src/utils/index.ts +2 -2
  328. package/src/utils/writeFiles.ts +40 -0
  329. package/dist/deploy/cloudRun/createJobs/variables.d.ts +0 -5
  330. package/dist/deploy/cloudRun/createJobs/variables.js +0 -19
  331. package/dist/pipeline/commitInfo/getBuildId.d.ts +0 -6
  332. package/dist/pipeline/commitInfo/getCommitInfo.d.ts +0 -2
  333. package/src/deploy/cloudRun/createJobs/variables.ts +0 -21
  334. package/src/pipeline/commitInfo/getBuildId.ts +0 -17
  335. package/src/pipeline/commitInfo/getCommitInfo.ts +0 -15
@@ -7,7 +7,7 @@
7
7
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
8
8
  * via the `definition` "image".
9
9
  */
10
- export declare type Image = string | {
10
+ export type Image = string | {
11
11
  /**
12
12
  * Full name of the image that should be used. It should contain the Registry part if needed.
13
13
  */
@@ -24,7 +24,7 @@ export declare type Image = string | {
24
24
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
25
25
  * via the `definition` "services".
26
26
  */
27
- export declare type Services = (string | {
27
+ export type Services = (string | {
28
28
  /**
29
29
  * Full name of the image that should be used. It should contain the Registry part if needed.
30
30
  */
@@ -45,27 +45,27 @@ export declare type Services = (string | {
45
45
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
46
46
  * via the `definition` "before_script".
47
47
  */
48
- export declare type BeforeScript = (string | string[])[];
48
+ export type BeforeScript = (string | string[])[];
49
49
  /**
50
50
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
51
51
  * via the `definition` "after_script".
52
52
  */
53
- export declare type AfterScript = (string | string[])[];
53
+ export type AfterScript = (string | string[])[];
54
54
  /**
55
55
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
56
56
  * via the `definition` "!reference".
57
57
  */
58
- export declare type Reference = string[];
58
+ export type Reference = string[];
59
59
  /**
60
60
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
61
61
  * via the `definition` "interruptible".
62
62
  */
63
- export declare type Interruptible = boolean;
63
+ export type Interruptible = boolean;
64
64
  /**
65
65
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
66
66
  * via the `definition` "retry".
67
67
  */
68
- export declare type Retry = RetryMax | {
68
+ export type Retry = RetryMax | {
69
69
  max?: RetryMax;
70
70
  when?: RetryErrors | RetryErrors[];
71
71
  };
@@ -75,27 +75,27 @@ export declare type Retry = RetryMax | {
75
75
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
76
76
  * via the `definition` "retry_max".
77
77
  */
78
- export declare type RetryMax = number;
78
+ export type RetryMax = number;
79
79
  /**
80
80
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
81
81
  * via the `definition` "retry_errors".
82
82
  */
83
- export declare type RetryErrors = "always" | "unknown_failure" | "script_failure" | "api_failure" | "stuck_or_timeout_failure" | "runner_system_failure" | "runner_unsupported" | "stale_schedule" | "job_execution_timeout" | "archived_failure" | "unmet_prerequisites" | "scheduler_failure" | "data_integrity_failure";
83
+ export type RetryErrors = "always" | "unknown_failure" | "script_failure" | "api_failure" | "stuck_or_timeout_failure" | "runner_system_failure" | "runner_unsupported" | "stale_schedule" | "job_execution_timeout" | "archived_failure" | "unmet_prerequisites" | "scheduler_failure" | "data_integrity_failure";
84
84
  /**
85
85
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
86
86
  * via the `definition` "tags".
87
87
  */
88
- export declare type Tags = (string | string[])[];
88
+ export type Tags = (string | string[])[];
89
89
  /**
90
90
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
91
91
  * via the `definition` "timeout".
92
92
  */
93
- export declare type Timeout = string;
93
+ export type Timeout = string;
94
94
  /**
95
95
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
96
96
  * via the `definition` "include_item".
97
97
  */
98
- export declare type IncludeItem = string | {
98
+ export type IncludeItem = string | {
99
99
  /**
100
100
  * Relative path from local repository root (`/`) to the `yaml`/`yml` file template. The file must be on the same branch, and does not work across git submodules.
101
101
  */
@@ -140,7 +140,7 @@ export declare type IncludeItem = string | {
140
140
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
141
141
  * via the `definition` "includeRules".
142
142
  */
143
- export declare type IncludeRules = ({
143
+ export type IncludeRules = ({
144
144
  if?: If;
145
145
  exists?: Exists;
146
146
  when?: ("never" | "always") | null;
@@ -149,13 +149,13 @@ export declare type IncludeRules = ({
149
149
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
150
150
  * via the `definition` "if".
151
151
  */
152
- export declare type If = string;
152
+ export type If = string;
153
153
  /**
154
154
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
155
155
  * via the `definition` "exists".
156
156
  */
157
- export declare type Exists = string[];
158
- export declare type JobTemplate = {
157
+ export type Exists = string[];
158
+ export type JobTemplate = {
159
159
  image?: Image;
160
160
  services?: Services;
161
161
  before_script?: BeforeScript;
@@ -434,7 +434,7 @@ export declare type JobTemplate = {
434
434
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
435
435
  * via the `definition` "rules".
436
436
  */
437
- export declare type Rules = ({
437
+ export type Rules = ({
438
438
  if?: If;
439
439
  changes?: Changes;
440
440
  exists?: Exists;
@@ -448,7 +448,7 @@ export declare type Rules = ({
448
448
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
449
449
  * via the `definition` "changes".
450
450
  */
451
- export declare type Changes = {
451
+ export type Changes = {
452
452
  /**
453
453
  * List of file paths.
454
454
  */
@@ -462,17 +462,17 @@ export declare type Changes = {
462
462
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
463
463
  * via the `definition` "when".
464
464
  */
465
- export declare type When = "on_success" | "on_failure" | "always" | "never" | "manual" | "delayed";
465
+ export type When = "on_success" | "on_failure" | "always" | "never" | "manual" | "delayed";
466
466
  /**
467
467
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
468
468
  * via the `definition` "start_in".
469
469
  */
470
- export declare type StartIn = string;
470
+ export type StartIn = string;
471
471
  /**
472
472
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
473
473
  * via the `definition` "allow_failure".
474
474
  */
475
- export declare type AllowFailure = boolean | {
475
+ export type AllowFailure = boolean | {
476
476
  exit_codes: number;
477
477
  } | {
478
478
  /**
@@ -484,7 +484,7 @@ export declare type AllowFailure = boolean | {
484
484
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
485
485
  * via the `definition` "rulesNeeds".
486
486
  */
487
- export declare type RulesNeeds = (string | {
487
+ export type RulesNeeds = (string | {
488
488
  /**
489
489
  * Name of a job that is defined in the pipeline.
490
490
  */
@@ -504,14 +504,14 @@ export declare type RulesNeeds = (string | {
504
504
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
505
505
  * via the `definition` "filter_refs".
506
506
  */
507
- export declare type FilterRefs = (("branches" | "tags" | "api" | "external" | "pipelines" | "pushes" | "schedules" | "triggers" | "web") | string)[];
507
+ export type FilterRefs = (("branches" | "tags" | "api" | "external" | "pipelines" | "pushes" | "schedules" | "triggers" | "web") | string)[];
508
508
  /**
509
509
  * Use the `needs:parallel:matrix` keyword to specify parallelized jobs needed to be completed for the job to run. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#needsparallelmatrix)
510
510
  *
511
511
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
512
512
  * via the `definition` "parallel_matrix".
513
513
  */
514
- export declare type ParallelMatrix = {
514
+ export type ParallelMatrix = {
515
515
  /**
516
516
  * Defines different variables for jobs that are running in parallel.
517
517
  *
@@ -527,7 +527,7 @@ export declare type ParallelMatrix = {
527
527
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
528
528
  * via the `definition` "parallel".
529
529
  */
530
- export declare type Parallel = number | {
530
+ export type Parallel = number | {
531
531
  /**
532
532
  * Defines different variables for jobs that are running in parallel.
533
533
  *
@@ -541,7 +541,7 @@ export declare type Parallel = number | {
541
541
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
542
542
  * via the `definition` "job_template".
543
543
  */
544
- export declare type JobTemplate1 = {
544
+ export type JobTemplate1 = {
545
545
  when: "delayed";
546
546
  [k: string]: any | undefined;
547
547
  } | {
@@ -554,17 +554,17 @@ export declare type JobTemplate1 = {
554
554
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
555
555
  * via the `definition` "workflowName".
556
556
  */
557
- export declare type WorkflowName = string;
557
+ export type WorkflowName = string;
558
558
  /**
559
559
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
560
560
  * via the `definition` "string_file_list".
561
561
  */
562
- export declare type StringFileList = string | string[];
562
+ export type StringFileList = string | string[];
563
563
  /**
564
564
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
565
565
  * via the `definition` "filter".
566
566
  */
567
- export declare type Filter = null | FilterRefs | {
567
+ export type Filter = null | FilterRefs | {
568
568
  refs?: FilterRefs;
569
569
  /**
570
570
  * Filter job based on if Kubernetes integration is active.
@@ -580,7 +580,7 @@ export declare type Filter = null | FilterRefs | {
580
580
  * This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
581
581
  * via the `definition` "job".
582
582
  */
583
- export declare type Job = JobTemplate1;
583
+ export type Job = JobTemplate1;
584
584
  export interface JobVariables {
585
585
  [k: string]: any | undefined;
586
586
  }
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
- /* eslint-disable */
4
3
  /**
5
4
  * This file was automatically generated by json-schema-to-typescript.
6
5
  * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
7
6
  * and run json-schema-to-typescript to regenerate this file.
8
7
  */
9
- exports.__esModule = true;
8
+ Object.defineProperty(exports, "__esModule", {
9
+ value: true
10
+ });
@@ -1,11 +1,9 @@
1
1
  import type { Artifacts as GitlabCiArtifacts, JobTemplate, Cache, Rules } from "./gitlab-ci-yml";
2
2
  export { Retry, Image as GitlabJobImage } from "./gitlab-ci-yml";
3
- export interface Artifacts extends Omit<GitlabCiArtifacts, "paths"> {
4
- paths: string[];
5
- }
6
- export declare type GitlabJobCache = Cache;
7
- export declare type GitlabRule = Exclude<Rules, null>[number];
8
- export declare type GitlabEnvironment = Omit<Exclude<JobTemplate["environment"], undefined | string>, "deployment_tier">;
3
+ export type Artifacts = GitlabCiArtifacts;
4
+ export type GitlabJobCache = Cache;
5
+ export type GitlabRule = Exclude<Exclude<Rules, null>[number], string | string[]>;
6
+ export type GitlabEnvironment = Omit<Exclude<JobTemplate["environment"], undefined | string>, "deployment_tier">;
9
7
  export interface GitlabJobDef extends Pick<JobTemplate, "after_script" | "allow_failure" | "artifacts" | "before_script" | "coverage" | "dependencies" | "environment" | "except" | "hooks" | "image" | "interruptible" | "needs" | "only" | "parallel" | "release" | "resource_group" | "retry" | "rules" | "script" | "services" | "stage" | "tags" | "trigger" | "variables"> {
10
8
  stage: JobTemplate["stage"];
11
9
  rules?: GitlabRule[];
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -2,12 +2,16 @@
2
2
 
3
3
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
4
4
  if (k2 === undefined) k2 = k;
5
- Object.defineProperty(o, k2, {
6
- enumerable: true,
7
- get: function () {
8
- return m[k];
9
- }
10
- });
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = {
8
+ enumerable: true,
9
+ get: function () {
10
+ return m[k];
11
+ }
12
+ };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
11
15
  } : function (o, m, k, k2) {
12
16
  if (k2 === undefined) k2 = k;
13
17
  o[k2] = m[k];
@@ -15,7 +19,9 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
15
19
  var __exportStar = this && this.__exportStar || function (m, exports) {
16
20
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
21
  };
18
- exports.__esModule = true;
22
+ Object.defineProperty(exports, "__esModule", {
23
+ value: true
24
+ });
19
25
  __exportStar(require("./config"), exports);
20
26
  __exportStar(require("./gitlab-types"), exports);
21
27
  __exportStar(require("./context"), exports);
@@ -1,12 +1,18 @@
1
- import type { Artifacts, GitlabEnvironment, GitlabJobCache, GitlabRule, GitlabJobImage, GitlabJobDef } from "./gitlab-types";
1
+ import type { UnspecifiedEnvVars } from "..";
2
+ import type { Artifacts, GitlabJobCache, GitlabRule, GitlabJobImage, GitlabJobDef, GitlabEnvironment } from "./gitlab-types";
2
3
  export declare const BASE_STAGES: readonly ["setup", "test", "build", "deploy", "verify", "rollback", "stop"];
3
- export declare type BaseStage = typeof BASE_STAGES[number];
4
- export declare type CatladderJobNeed = string | {
4
+ export type BaseStage = (typeof BASE_STAGES)[number];
5
+ export type CatladderJobNeed = string | {
5
6
  job: string;
6
7
  artifacts: boolean;
7
8
  componentName?: string;
8
9
  };
9
- export declare type CatladderJob<S = BaseStage> = {
10
+ export type CatladderJobEnvironmentConfig = {
11
+ action?: GitlabEnvironment["action"];
12
+ on_stop?: GitlabEnvironment["on_stop"];
13
+ auto_stop_in?: string;
14
+ };
15
+ export type CatladderJob<S = BaseStage> = {
10
16
  /**
11
17
  * the name of the job (without any env or app prefix and suffix)
12
18
  */
@@ -67,12 +73,23 @@ export declare type CatladderJob<S = BaseStage> = {
67
73
  /**
68
74
  * variables to pass
69
75
  */
70
- variables: GitlabJobDef["variables"];
76
+ variables: UnspecifiedEnvVars | undefined;
77
+ /**
78
+ * additional vars only for the runner.
79
+ * Also if you use services: that require env vars, you need to set them here.
80
+ *
81
+ */
82
+ runnerVariables?: Record<string, string>;
71
83
  /**
72
84
  * whether failures are allowed
73
85
  */
74
86
  allow_failure?: boolean;
75
- environment?: GitlabEnvironment;
87
+ /**
88
+ * gitlab environment config, subject to change
89
+ */
90
+ environment?: CatladderJobEnvironmentConfig;
91
+ /** */
92
+ when?: GitlabRule["when"];
76
93
  rules?: GitlabRule[];
77
94
  /**
78
95
  * How many instances of a job should be run in parallel.
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
4
6
  exports.BASE_STAGES = void 0;
5
7
  exports.BASE_STAGES = ["setup", "test", "build", "deploy", "verify", "rollback", "stop"];
@@ -1,4 +1,5 @@
1
1
  import type { GitlabJobDef, GitlabPipeline } from "./gitlab-types";
2
- export declare type PipelineType = "gitlab";
3
- export declare type PipelineJob<T extends PipelineType> = T extends "gitlab" ? GitlabJobDef : never;
4
- export declare type Pipeline<T extends PipelineType> = T extends "gitlab" ? GitlabPipeline : never;
2
+ export type PipelineType = "gitlab";
3
+ export type PipelineMode<T extends PipelineType> = T extends "gitlab" ? "childpipeline" | "local" : "local";
4
+ export type PipelineJob<T extends PipelineType> = T extends "gitlab" ? GitlabJobDef : never;
5
+ export type Pipeline<T extends PipelineType> = T extends "gitlab" ? GitlabPipeline : never;
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1 +1 @@
1
- export declare type PartialDeep<T> = T extends any[] ? T : T extends Record<string, any> ? { [P in keyof T]?: PartialDeep<T[P]> } : T;
1
+ export type PartialDeep<T> = T extends any[] ? T : T extends Record<string, any> ? { [P in keyof T]?: PartialDeep<T[P]> } : T;
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
 
3
- exports.__esModule = true;
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -31,7 +31,9 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
31
31
  }
32
32
  return to.concat(ar || Array.prototype.slice.call(from));
33
33
  };
34
- exports.__esModule = true;
34
+ Object.defineProperty(exports, "__esModule", {
35
+ value: true
36
+ });
35
37
  exports.collapseableSection = exports.repeatOnFailure = exports.sanitizeForBashVariable = exports.allowFailureInScripts = void 0;
36
38
  var allowFailureInScripts = function (script) {
37
39
  return __spreadArray(__spreadArray(["set +e"], __read(script), false), ["set -e" // reenable
@@ -1,3 +1,3 @@
1
1
  export declare function notNil<TValue>(value: TValue | null | undefined): value is TValue;
2
- export declare const ensureArray: <T>(s: T | T[] | undefined) => T[] | null;
2
+ export declare const ensureArray: <T>(s: undefined | T | T[]) => T[] | null;
3
3
  export declare const mergeWithMergingArrays: <A, B>(obj1: A, obj2: B) => A & B;
@@ -31,7 +31,9 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
31
31
  }
32
32
  return to.concat(ar || Array.prototype.slice.call(from));
33
33
  };
34
- exports.__esModule = true;
34
+ Object.defineProperty(exports, "__esModule", {
35
+ value: true
36
+ });
35
37
  exports.mergeWithMergingArrays = exports.ensureArray = exports.notNil = void 0;
36
38
  var lodash_1 = require("lodash");
37
39
  function notNil(value) {
@@ -0,0 +1,7 @@
1
+ export declare const getAutoGeneratedHeader: (commentChar: string) => string;
2
+ export declare const writeGeneratedFile: (path: string, content: string, {
3
+ commentChar
4
+ }: {
5
+ commentChar: string;
6
+ }) => Promise<void>;
7
+ export declare const writeYamlfile: (path: string, data: any) => Promise<void>;
@@ -55,7 +55,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
55
55
  }
56
56
  function step(op) {
57
57
  if (f) throw new TypeError("Generator is already executing.");
58
- while (_) try {
58
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
59
59
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
60
60
  if (y = 0, t) op = [op[0] & 2, t.value];
61
61
  switch (op[0]) {
@@ -115,41 +115,58 @@ var __generator = this && this.__generator || function (thisArg, body) {
115
115
  };
116
116
  }
117
117
  };
118
- exports.__esModule = true;
119
- exports.getCurrentVersionString = exports.getBuildId = void 0;
120
- var child_process_promise_1 = require("child-process-promise");
121
- var getBuildId = function () {
122
- return __awaiter(void 0, void 0, void 0, function () {
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
118
+ var __importDefault = this && this.__importDefault || function (mod) {
119
+ return mod && mod.__esModule ? mod : {
120
+ "default": mod
121
+ };
122
+ };
123
+ Object.defineProperty(exports, "__esModule", {
124
+ value: true
125
+ });
126
+ exports.writeYamlfile = exports.writeGeneratedFile = exports.getAutoGeneratedHeader = void 0;
127
+ var promises_1 = require("fs/promises");
128
+ var yaml_1 = require("yaml");
129
+ var packageInfos_1 = __importDefault(require("../packageInfos"));
130
+ var getAutoGeneratedHeader = function (commentChar) {
131
+ return ["-------------------------------------------------", "\uD83D\uDC31 \uD83D\uDD28 This file is generated by catladder v".concat(packageInfos_1.default.version), "\uD83D\uDEA8 Do not edit this file manually \uD83D\uDEA8", "-------------------------------------------------"].map(function (line) {
132
+ return "".concat(commentChar, " ").concat(line);
133
+ }).join("\n").concat("\n");
134
+ };
135
+ exports.getAutoGeneratedHeader = getAutoGeneratedHeader;
136
+ var writeGeneratedFile = function (path_1, content_1, _a) {
137
+ return __awaiter(void 0, [path_1, content_1, _a], void 0, function (path, content, _b) {
138
+ var commentChar = _b.commentChar;
139
+ return __generator(this, function (_c) {
140
+ switch (_c.label) {
125
141
  case 0:
126
- return [4 /*yield*/, (0, child_process_promise_1.exec)("git describe --tags || git rev-parse HEAD").then(function (s) {
127
- return s.stdout.trim();
142
+ return [4 /*yield*/, (0, promises_1.writeFile)(path,
143
+ // need to spread out the jobs, forgot why
144
+ [(0, exports.getAutoGeneratedHeader)(commentChar), content].join("\n"), {
145
+ encoding: "utf-8"
128
146
  })];
129
147
  case 1:
130
- return [2 /*return*/, _a.sent()];
148
+ _c.sent();
149
+ return [2 /*return*/];
131
150
  }
132
151
  });
133
152
  });
134
153
  };
135
- exports.getBuildId = getBuildId;
136
- // thx chat gpt
137
- /**
138
- * returns the last tagged version string Major.minor.patch
139
- * returns 0.0.0 if there is no tag
140
- */
141
- var getCurrentVersionString = function () {
154
+
155
+ exports.writeGeneratedFile = writeGeneratedFile;
156
+ var writeYamlfile = function (path, data) {
142
157
  return __awaiter(void 0, void 0, void 0, function () {
143
158
  return __generator(this, function (_a) {
144
159
  switch (_a.label) {
145
160
  case 0:
146
- return [4 /*yield*/, (0, child_process_promise_1.exec)('latest_tag=$(git describe --tags --abbrev=0 2>/dev/null); if [ -z "$latest_tag" ]; then echo "0.0.0"; else echo "${latest_tag#v}"; fi | cut -d "." -f 1-3').then(function (s) {
147
- return s.stdout.trim();
161
+ return [4 /*yield*/, (0, exports.writeGeneratedFile)(path, (0, yaml_1.stringify)(data), {
162
+ commentChar: "#"
148
163
  })];
149
164
  case 1:
150
- return [2 /*return*/, _a.sent()];
165
+ _a.sent();
166
+ return [2 /*return*/];
151
167
  }
152
168
  });
153
169
  });
154
170
  };
155
- exports.getCurrentVersionString = getCurrentVersionString;
171
+
172
+ exports.writeYamlfile = writeYamlfile;