@catladder/pipeline 4.0.1 → 4.2.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 (83) hide show
  1. package/dist/build/artifacts/createBuildJobArtifact.d.ts +1 -1
  2. package/dist/build/artifacts/createBuildJobArtifact.js +193 -30
  3. package/dist/build/base/createAppBuildJob.d.ts +1 -1
  4. package/dist/build/base/createAppBuildJob.js +149 -22
  5. package/dist/build/base/index.d.ts +2 -2
  6. package/dist/build/base/index.js +159 -9
  7. package/dist/build/custom/buildJob.d.ts +1 -1
  8. package/dist/build/custom/buildJob.js +130 -10
  9. package/dist/build/custom/index.d.ts +1 -1
  10. package/dist/build/custom/index.js +127 -1
  11. package/dist/build/docker.js +1 -1
  12. package/dist/build/rails/build.d.ts +1 -1
  13. package/dist/build/rails/build.js +153 -33
  14. package/dist/build/rails/index.d.ts +1 -1
  15. package/dist/build/rails/index.js +127 -1
  16. package/dist/constants.js +1 -1
  17. package/dist/context/createComponentContext.js +27 -9
  18. package/dist/context/createWorkspaceContext.js +15 -3
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/dist/types/context.d.ts +1 -1
  21. package/examples/__snapshots__/automatic-releases.test.ts.snap +4 -4
  22. package/examples/__snapshots__/cloud-run-execute-script-on-deploy.test.ts.snap +4 -4
  23. package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +4 -4
  24. package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +4 -4
  25. package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +4 -4
  26. package/examples/__snapshots__/cloud-run-http2.test.ts.snap +4 -4
  27. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +4 -4
  28. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +4 -4
  29. package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +4 -4
  30. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +4 -4
  31. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +4 -4
  32. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +4 -4
  33. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +4 -4
  34. package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +4 -4
  35. package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +4 -4
  36. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +4 -4
  37. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +4 -4
  38. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +4 -4
  39. package/examples/__snapshots__/cloud-run-session-affinity.test.ts.snap +4 -4
  40. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +4 -4
  41. package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +4 -4
  42. package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +4 -4
  43. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +4 -4
  44. package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +4 -4
  45. package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +12 -12
  46. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +8 -8
  47. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +4 -4
  48. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +4 -4
  49. package/examples/__snapshots__/cloud-run-worker-pool.test.ts.snap +4 -4
  50. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +4 -4
  51. package/examples/__snapshots__/custom-build-job.test.ts.snap +4 -4
  52. package/examples/__snapshots__/custom-deploy.test.ts.snap +4 -4
  53. package/examples/__snapshots__/custom-docker-file.test.ts.snap +4 -4
  54. package/examples/__snapshots__/custom-verify-job.test.ts.snap +4 -4
  55. package/examples/__snapshots__/git-submodule.test.ts.snap +4 -4
  56. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +4 -4
  57. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +4 -4
  58. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +8 -8
  59. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +4 -4
  60. package/examples/__snapshots__/local-dot-env.test.ts.snap +4 -4
  61. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +4 -4
  62. package/examples/__snapshots__/multiline-var.test.ts.snap +12 -12
  63. package/examples/__snapshots__/native-app.test.ts.snap +4 -4
  64. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +4 -4
  65. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +4 -4
  66. package/examples/__snapshots__/override-secrets.test.ts.snap +4 -4
  67. package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +4 -4
  68. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +4 -4
  69. package/examples/__snapshots__/referencing-other-vars.test.ts.snap +12 -12
  70. package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +8 -8
  71. package/examples/__snapshots__/workspace-api-www.test.ts.snap +8 -8
  72. package/package.json +1 -1
  73. package/src/build/artifacts/createBuildJobArtifact.ts +28 -21
  74. package/src/build/base/createAppBuildJob.ts +3 -3
  75. package/src/build/base/index.ts +6 -6
  76. package/src/build/custom/buildJob.ts +2 -2
  77. package/src/build/custom/index.ts +6 -3
  78. package/src/build/docker.ts +1 -1
  79. package/src/build/rails/build.ts +2 -2
  80. package/src/build/rails/index.ts +6 -3
  81. package/src/context/createComponentContext.ts +3 -6
  82. package/src/context/createWorkspaceContext.ts +8 -2
  83. package/src/types/context.ts +1 -1
@@ -303,7 +303,7 @@ before_script:
303
303
  stage: build
304
304
  image: path/to/docker/docker-build:the-version
305
305
  services:
306
- - name: docker:24.0.6-dind
306
+ - name: docker:29.5.1-dind
307
307
  command:
308
308
  - --tls=false
309
309
  - --registry-mirror=https://mirror.gcr.io
@@ -724,7 +724,7 @@ before_script:
724
724
  stage: build
725
725
  image: path/to/docker/docker-build:the-version
726
726
  services:
727
- - name: docker:24.0.6-dind
727
+ - name: docker:29.5.1-dind
728
728
  command:
729
729
  - --tls=false
730
730
  - --registry-mirror=https://mirror.gcr.io
@@ -1040,7 +1040,7 @@ before_script:
1040
1040
  stage: build
1041
1041
  image: path/to/docker/docker-build:the-version
1042
1042
  services:
1043
- - name: docker:24.0.6-dind
1043
+ - name: docker:29.5.1-dind
1044
1044
  command:
1045
1045
  - --tls=false
1046
1046
  - --registry-mirror=https://mirror.gcr.io
@@ -1341,7 +1341,7 @@ before_script:
1341
1341
  stage: build
1342
1342
  image: path/to/docker/docker-build:the-version
1343
1343
  services:
1344
- - name: docker:24.0.6-dind
1344
+ - name: docker:29.5.1-dind
1345
1345
  command:
1346
1346
  - --tls=false
1347
1347
  - --registry-mirror=https://mirror.gcr.io
@@ -1747,7 +1747,7 @@ before_script:
1747
1747
  stage: build
1748
1748
  image: path/to/docker/docker-build:the-version
1749
1749
  services:
1750
- - name: docker:24.0.6-dind
1750
+ - name: docker:29.5.1-dind
1751
1751
  command:
1752
1752
  - --tls=false
1753
1753
  - --registry-mirror=https://mirror.gcr.io
@@ -2178,7 +2178,7 @@ before_script:
2178
2178
  stage: build
2179
2179
  image: path/to/docker/docker-build:the-version
2180
2180
  services:
2181
- - name: docker:24.0.6-dind
2181
+ - name: docker:29.5.1-dind
2182
2182
  command:
2183
2183
  - --tls=false
2184
2184
  - --registry-mirror=https://mirror.gcr.io
@@ -2504,7 +2504,7 @@ before_script:
2504
2504
  stage: build
2505
2505
  image: path/to/docker/docker-build:the-version
2506
2506
  services:
2507
- - name: docker:24.0.6-dind
2507
+ - name: docker:29.5.1-dind
2508
2508
  command:
2509
2509
  - --tls=false
2510
2510
  - --registry-mirror=https://mirror.gcr.io
@@ -2815,7 +2815,7 @@ before_script:
2815
2815
  stage: build
2816
2816
  image: path/to/docker/docker-build:the-version
2817
2817
  services:
2818
- - name: docker:24.0.6-dind
2818
+ - name: docker:29.5.1-dind
2819
2819
  command:
2820
2820
  - --tls=false
2821
2821
  - --registry-mirror=https://mirror.gcr.io
@@ -3221,7 +3221,7 @@ before_script:
3221
3221
  stage: build
3222
3222
  image: path/to/docker/docker-build:the-version
3223
3223
  services:
3224
- - name: docker:24.0.6-dind
3224
+ - name: docker:29.5.1-dind
3225
3225
  command:
3226
3226
  - --tls=false
3227
3227
  - --registry-mirror=https://mirror.gcr.io
@@ -3732,7 +3732,7 @@ before_script:
3732
3732
  stage: build
3733
3733
  image: path/to/docker/docker-build:the-version
3734
3734
  services:
3735
- - name: docker:24.0.6-dind
3735
+ - name: docker:29.5.1-dind
3736
3736
  command:
3737
3737
  - --tls=false
3738
3738
  - --registry-mirror=https://mirror.gcr.io
@@ -4133,7 +4133,7 @@ before_script:
4133
4133
  stage: build
4134
4134
  image: path/to/docker/docker-build:the-version
4135
4135
  services:
4136
- - name: docker:24.0.6-dind
4136
+ - name: docker:29.5.1-dind
4137
4137
  command:
4138
4138
  - --tls=false
4139
4139
  - --registry-mirror=https://mirror.gcr.io
@@ -4524,7 +4524,7 @@ before_script:
4524
4524
  stage: build
4525
4525
  image: path/to/docker/docker-build:the-version
4526
4526
  services:
4527
- - name: docker:24.0.6-dind
4527
+ - name: docker:29.5.1-dind
4528
4528
  command:
4529
4529
  - --tls=false
4530
4530
  - --registry-mirror=https://mirror.gcr.io
@@ -704,7 +704,7 @@ before_script:
704
704
  stage: build
705
705
  image: path/to/docker/docker-build:the-version
706
706
  services:
707
- - name: docker:24.0.6-dind
707
+ - name: docker:29.5.1-dind
708
708
  command:
709
709
  - --tls=false
710
710
  - --registry-mirror=https://mirror.gcr.io
@@ -902,7 +902,7 @@ before_script:
902
902
  stage: build
903
903
  image: path/to/docker/docker-build:the-version
904
904
  services:
905
- - name: docker:24.0.6-dind
905
+ - name: docker:29.5.1-dind
906
906
  command:
907
907
  - --tls=false
908
908
  - --registry-mirror=https://mirror.gcr.io
@@ -1108,7 +1108,7 @@ before_script:
1108
1108
  stage: build
1109
1109
  image: path/to/docker/docker-build:the-version
1110
1110
  services:
1111
- - name: docker:24.0.6-dind
1111
+ - name: docker:29.5.1-dind
1112
1112
  command:
1113
1113
  - --tls=false
1114
1114
  - --registry-mirror=https://mirror.gcr.io
@@ -1299,7 +1299,7 @@ before_script:
1299
1299
  stage: build
1300
1300
  image: path/to/docker/docker-build:the-version
1301
1301
  services:
1302
- - name: docker:24.0.6-dind
1302
+ - name: docker:29.5.1-dind
1303
1303
  command:
1304
1304
  - --tls=false
1305
1305
  - --registry-mirror=https://mirror.gcr.io
@@ -1490,7 +1490,7 @@ before_script:
1490
1490
  stage: build
1491
1491
  image: path/to/docker/docker-build:the-version
1492
1492
  services:
1493
- - name: docker:24.0.6-dind
1493
+ - name: docker:29.5.1-dind
1494
1494
  command:
1495
1495
  - --tls=false
1496
1496
  - --registry-mirror=https://mirror.gcr.io
@@ -1691,7 +1691,7 @@ before_script:
1691
1691
  stage: build
1692
1692
  image: path/to/docker/docker-build:the-version
1693
1693
  services:
1694
- - name: docker:24.0.6-dind
1694
+ - name: docker:29.5.1-dind
1695
1695
  command:
1696
1696
  - --tls=false
1697
1697
  - --registry-mirror=https://mirror.gcr.io
@@ -1900,7 +1900,7 @@ before_script:
1900
1900
  stage: build
1901
1901
  image: path/to/docker/docker-build:the-version
1902
1902
  services:
1903
- - name: docker:24.0.6-dind
1903
+ - name: docker:29.5.1-dind
1904
1904
  command:
1905
1905
  - --tls=false
1906
1906
  - --registry-mirror=https://mirror.gcr.io
@@ -2094,7 +2094,7 @@ before_script:
2094
2094
  stage: build
2095
2095
  image: path/to/docker/docker-build:the-version
2096
2096
  services:
2097
- - name: docker:24.0.6-dind
2097
+ - name: docker:29.5.1-dind
2098
2098
  command:
2099
2099
  - --tls=false
2100
2100
  - --registry-mirror=https://mirror.gcr.io
@@ -696,7 +696,7 @@ before_script:
696
696
  stage: build
697
697
  image: path/to/docker/docker-build:the-version
698
698
  services:
699
- - name: docker:24.0.6-dind
699
+ - name: docker:29.5.1-dind
700
700
  command:
701
701
  - --tls=false
702
702
  - --registry-mirror=https://mirror.gcr.io
@@ -893,7 +893,7 @@ before_script:
893
893
  stage: build
894
894
  image: path/to/docker/docker-build:the-version
895
895
  services:
896
- - name: docker:24.0.6-dind
896
+ - name: docker:29.5.1-dind
897
897
  command:
898
898
  - --tls=false
899
899
  - --registry-mirror=https://mirror.gcr.io
@@ -1098,7 +1098,7 @@ before_script:
1098
1098
  stage: build
1099
1099
  image: path/to/docker/docker-build:the-version
1100
1100
  services:
1101
- - name: docker:24.0.6-dind
1101
+ - name: docker:29.5.1-dind
1102
1102
  command:
1103
1103
  - --tls=false
1104
1104
  - --registry-mirror=https://mirror.gcr.io
@@ -1288,7 +1288,7 @@ before_script:
1288
1288
  stage: build
1289
1289
  image: path/to/docker/docker-build:the-version
1290
1290
  services:
1291
- - name: docker:24.0.6-dind
1291
+ - name: docker:29.5.1-dind
1292
1292
  command:
1293
1293
  - --tls=false
1294
1294
  - --registry-mirror=https://mirror.gcr.io
@@ -1478,7 +1478,7 @@ before_script:
1478
1478
  stage: build
1479
1479
  image: path/to/docker/docker-build:the-version
1480
1480
  services:
1481
- - name: docker:24.0.6-dind
1481
+ - name: docker:29.5.1-dind
1482
1482
  command:
1483
1483
  - --tls=false
1484
1484
  - --registry-mirror=https://mirror.gcr.io
@@ -1678,7 +1678,7 @@ before_script:
1678
1678
  stage: build
1679
1679
  image: path/to/docker/docker-build:the-version
1680
1680
  services:
1681
- - name: docker:24.0.6-dind
1681
+ - name: docker:29.5.1-dind
1682
1682
  command:
1683
1683
  - --tls=false
1684
1684
  - --registry-mirror=https://mirror.gcr.io
@@ -1886,7 +1886,7 @@ before_script:
1886
1886
  stage: build
1887
1887
  image: path/to/docker/docker-build:the-version
1888
1888
  services:
1889
- - name: docker:24.0.6-dind
1889
+ - name: docker:29.5.1-dind
1890
1890
  command:
1891
1891
  - --tls=false
1892
1892
  - --registry-mirror=https://mirror.gcr.io
@@ -2079,7 +2079,7 @@ before_script:
2079
2079
  stage: build
2080
2080
  image: path/to/docker/docker-build:the-version
2081
2081
  services:
2082
- - name: docker:24.0.6-dind
2082
+ - name: docker:29.5.1-dind
2083
2083
  command:
2084
2084
  - --tls=false
2085
2085
  - --registry-mirror=https://mirror.gcr.io
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "4.0.1",
56
+ "version": "4.2.0",
57
57
  "scripts": {
58
58
  "build:tsc": "yarn tsc",
59
59
  "build": "yarn build:compile && yarn build:inline-variables",
@@ -11,20 +11,28 @@ import { componentContextNeedsBuildTimeDotEnv } from "../base/writeDotEnv";
11
11
  const uniqueAndAlphabeticalSort = (arr: string[]): string[] => {
12
12
  return uniq(arr).sort((a, b) => a.localeCompare(b));
13
13
  };
14
- export const createBuildJobArtifacts = (
14
+ export const createBuildJobArtifacts = async (
15
15
  context: Context,
16
- ): CatladderJob["artifacts"] => {
16
+ ): Promise<CatladderJob["artifacts"]> => {
17
17
  const paths =
18
18
  context.type === "workspace"
19
- ? context.components.flatMap((c) => getArtifactsPathForComponent(c))
20
- : getArtifactsPathForComponent(context, ["__build_info.json"]);
19
+ ? (
20
+ await Promise.all(
21
+ context.components.map((c) => getArtifactsPathForComponent(c)),
22
+ )
23
+ ).flat()
24
+ : await getArtifactsPathForComponent(context, ["__build_info.json"]);
21
25
 
22
26
  const exclude =
23
27
  context.type === "workspace"
24
- ? context.components.flatMap((c) =>
25
- getAllArtifactExcludePathsForComponent(c),
26
- )
27
- : getAllArtifactExcludePathsForComponent(context);
28
+ ? (
29
+ await Promise.all(
30
+ context.components.map((c) =>
31
+ getAllArtifactExcludePathsForComponent(c),
32
+ ),
33
+ )
34
+ ).flat()
35
+ : await getAllArtifactExcludePathsForComponent(context);
28
36
  return {
29
37
  paths: uniqueAndAlphabeticalSort(paths),
30
38
  ...(exclude.length > 0
@@ -43,44 +51,43 @@ export const createBuildJobArtifacts = (
43
51
  : {},
44
52
  };
45
53
  };
46
- const _getArtifactPathsForComponent = (
54
+ const _getArtifactPathsForComponent = async (
47
55
  c: ComponentContext,
48
56
  configKey: "artifactsPaths" | "artifactsExcludePaths",
49
57
  additionalPaths?: string[],
50
- ): string[] => {
58
+ ): Promise<string[]> => {
59
+ // in theory, we only need "direct",
60
+ // but in some cases project may have packages in the workspace that create build artifacts, which aren't components
61
+ // this highly depends on the build tool. To be safe, we get all
62
+ const componentDirs = await c.build.getComponentDirs("all");
51
63
  return [
52
64
  ...(c.build.type !== "disabled" ? (c.build.config[configKey] ?? []) : []),
53
65
  ...(additionalPaths ?? []),
54
66
  ]?.flatMap((artifact) =>
55
- c.build
56
- // in theory, we only need "direct",
57
- // but in some cases project may have packages in the workspace that create build artifacts, which aren't components
58
- // this highly depends on the build tool. To be safe, we get all
59
- .getComponentDirs("all")
60
- .flatMap((cDir) => join(cDir, artifact)),
67
+ componentDirs.flatMap((cDir: string) => join(cDir, artifact)),
61
68
  );
62
69
  };
63
70
 
64
71
  const getArtifactsPathForComponent = (
65
72
  c: ComponentContext,
66
73
  additionalPaths?: string[],
67
- ): string[] => {
74
+ ): Promise<string[]> => {
68
75
  return _getArtifactPathsForComponent(c, "artifactsPaths", additionalPaths);
69
76
  };
70
77
 
71
- const getAllArtifactExcludePathsForComponent = (
78
+ const getAllArtifactExcludePathsForComponent = async (
72
79
  c: ComponentContext,
73
- ): string[] => {
80
+ ): Promise<string[]> => {
74
81
  return [
75
82
  ...getDotEnvPathsForComponent(c), // always exclude .env files
76
- ...getArtifactExcludePathsForComponent(c),
83
+ ...(await getArtifactExcludePathsForComponent(c)),
77
84
  ];
78
85
  };
79
86
 
80
87
  const getArtifactExcludePathsForComponent = (
81
88
  c: ComponentContext,
82
89
  additionalPaths?: string[],
83
- ): string[] => {
90
+ ): Promise<string[]> => {
84
91
  return _getArtifactPathsForComponent(
85
92
  c,
86
93
  "artifactsExcludePaths",
@@ -21,10 +21,10 @@ import {
21
21
  writeDotEnv,
22
22
  } from "./writeDotEnv";
23
23
 
24
- export const createAppBuildJob = (
24
+ export const createAppBuildJob = async (
25
25
  context: ComponentContext<BuildContextStandalone> | WorkspaceContext,
26
26
  { script, variables, runnerVariables, cache, ...def }: AppBuildJobDefinition,
27
- ): CatladderJob => {
27
+ ): Promise<CatladderJob> => {
28
28
  return merge(
29
29
  {
30
30
  name: APP_BUILD_JOB_NAME,
@@ -63,7 +63,7 @@ export const createAppBuildJob = (
63
63
  `cd ${context.build.dir}`,
64
64
  ...ensureArray(script),
65
65
  ],
66
- artifacts: createBuildJobArtifacts(context),
66
+ artifacts: await createBuildJobArtifacts(context),
67
67
  },
68
68
  def,
69
69
  );
@@ -15,16 +15,16 @@ import { createDockerBuildJobBase, requiresDockerBuild } from "../docker";
15
15
  import { APP_BUILD_JOB_NAME } from "./constants";
16
16
  import { createAppBuildJob } from "./createAppBuildJob";
17
17
 
18
- export const createComponentBuildJobs = (
18
+ export const createComponentBuildJobs = async (
19
19
  context: ComponentContextWithBuild,
20
20
  definitions: {
21
21
  appBuild?: AppBuildJobDefinition;
22
22
  dockerBuild: DockerBuildJobDefinition;
23
23
  },
24
- ): CatladderJob[] => {
24
+ ): Promise<CatladderJob[]> => {
25
25
  return [
26
26
  ...(definitions.appBuild && componentContextIsStandaloneBuild(context)
27
- ? [createAppBuildJob(context, definitions.appBuild)]
27
+ ? [await createAppBuildJob(context, definitions.appBuild)]
28
28
  : []),
29
29
  ...(requiresDockerBuild(context)
30
30
  ? [
@@ -51,13 +51,13 @@ export const createComponentBuildJobs = (
51
51
  ];
52
52
  };
53
53
 
54
- export const createWorkspaceBuildJobs = (
54
+ export const createWorkspaceBuildJobs = async (
55
55
  context: WorkspaceContext,
56
56
  definitions: {
57
57
  appBuild?: AppBuildJobDefinition;
58
58
  },
59
- ): CatladderJob[] => {
59
+ ): Promise<CatladderJob[]> => {
60
60
  return definitions.appBuild
61
- ? [createAppBuildJob(context, definitions.appBuild)]
61
+ ? [await createAppBuildJob(context, definitions.appBuild)]
62
62
  : [];
63
63
  };
@@ -6,9 +6,9 @@ import type { CatladderJob } from "../../types/jobs";
6
6
  import { createComponentBuildJobs } from "../base";
7
7
  import { createBuildJobDefinition } from "../base/createBuildJobDefinition";
8
8
 
9
- export const createCustomBuildJobs = (
9
+ export const createCustomBuildJobs = async (
10
10
  context: ComponentContextWithBuild,
11
- ): CatladderJob[] => {
11
+ ): Promise<CatladderJob[]> => {
12
12
  const buildConfig = context.build.config;
13
13
 
14
14
  if (!isOfBuildType(buildConfig, "custom")) {
@@ -3,8 +3,11 @@ import type { CatladderJob } from "../../types/jobs";
3
3
  import { createCustomBuildJobs } from "./buildJob";
4
4
  import { createCustomTestJobs } from "./testJob";
5
5
 
6
- export const createCustomJobs = (
6
+ export const createCustomJobs = async (
7
7
  context: ComponentContextWithBuild,
8
- ): CatladderJob[] => {
9
- return [...createCustomTestJobs(context), ...createCustomBuildJobs(context)];
8
+ ): Promise<CatladderJob[]> => {
9
+ return [
10
+ ...createCustomTestJobs(context),
11
+ ...(await createCustomBuildJobs(context)),
12
+ ];
10
13
  };
@@ -114,7 +114,7 @@ export const getDockerJobBaseProps = (): Pick<
114
114
  image: getRunnerImage("docker-build"),
115
115
  services: [
116
116
  {
117
- name: "docker:24.0.6-dind", // see see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27300#note_466755332
117
+ name: "docker:29.5.1-dind", // see see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27300#note_466755332
118
118
  command: ["--tls=false", "--registry-mirror=https://mirror.gcr.io"],
119
119
  },
120
120
  ],
@@ -9,9 +9,9 @@ import {
9
9
  } from "../docker";
10
10
  import { isOfBuildType } from "../types";
11
11
 
12
- export const createRailsBuildJobs = (
12
+ export const createRailsBuildJobs = async (
13
13
  context: ComponentContextWithBuild,
14
- ): CatladderJob[] => {
14
+ ): Promise<CatladderJob[]> => {
15
15
  const buildConfig = context.build.config;
16
16
  if (!isOfBuildType(buildConfig, "rails")) {
17
17
  // should not happen
@@ -3,8 +3,11 @@ import type { CatladderJob } from "../../types/jobs";
3
3
  import { createRailsBuildJobs } from "./build";
4
4
  import { createRailsTestJobs } from "./testJob";
5
5
 
6
- export const createRailsJobs = (
6
+ export const createRailsJobs = async (
7
7
  context: ComponentContextWithBuild,
8
- ): CatladderJob[] => {
9
- return [...createRailsTestJobs(context), ...createRailsBuildJobs(context)];
8
+ ): Promise<CatladderJob[]> => {
9
+ return [
10
+ ...createRailsTestJobs(context),
11
+ ...(await createRailsBuildJobs(context)),
12
+ ];
10
13
  };
@@ -75,16 +75,13 @@ export const createComponentContext = async (
75
75
  componentConfigWithoutDefaults,
76
76
  );
77
77
 
78
- const [environment, packageManagerInfo] = await Promise.all([
79
- getEnvironment(ctx),
80
- packageManagerInfoPromise,
81
- ]);
78
+ const environment = await getEnvironment(ctx);
82
79
  const { deploy, build, customJobs, dir } = componentConfig;
83
- const getComponentDirs: BuildContext["getComponentDirs"] = (mode) => [
80
+ const getComponentDirs: BuildContext["getComponentDirs"] = async (mode) => [
84
81
  dir,
85
82
  // also copy workspace dependencies in monorepo if packages are shared and they create build artifacts
86
83
  ...(mode === "all"
87
- ? (packageManagerInfo.currentWorkspaceDependencies ?? [])
84
+ ? ((await packageManagerInfoPromise).currentWorkspaceDependencies ?? [])
88
85
  : []),
89
86
  ];
90
87
  const _getBuildContext = (): BuildContextComponent => {
@@ -47,8 +47,14 @@ export async function createWorkspaceContext({
47
47
  build: {
48
48
  type: "workspace",
49
49
  dir: workspaceConfig.dir ?? ".",
50
- getComponentDirs: (mode) =>
51
- uniq(components.flatMap((c) => c.build.getComponentDirs(mode))),
50
+ getComponentDirs: async (mode) =>
51
+ uniq(
52
+ (
53
+ await Promise.all(
54
+ components.map((c) => c.build.getComponentDirs(mode)),
55
+ )
56
+ ).flat(),
57
+ ),
52
58
  buildType: workspaceConfig.type,
53
59
  config: workspaceConfig,
54
60
  },
@@ -104,7 +104,7 @@ export type BuildContextBase = {
104
104
  *
105
105
  * in case of a workspace this contains all components in the workspace (+ yarn workspace dependencies if mode = all)
106
106
  */
107
- getComponentDirs: (mode: "direct" | "all") => string[];
107
+ getComponentDirs: (mode: "direct" | "all") => Promise<string[]>;
108
108
  };
109
109
 
110
110
  export type BuildContextComponentBase = BuildContextBase;