@catladder/cli 0.0.0-refactor-docker-427f63d6 → 0.0.0-refactor-docker-45f6e733

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 (183) hide show
  1. package/dist/bundles/catenv/index.js +212 -193
  2. package/dist/bundles/cli/index.js +330 -298
  3. package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +22 -19
  4. package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
  5. package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js +10 -9
  6. package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js.map +1 -1
  7. package/dist/cli/src/apps/cli/commands/project/commandPortForward.js +18 -16
  8. package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +1 -1
  9. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.d.ts +2 -2
  10. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +10 -9
  11. package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
  12. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
  13. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +9 -8
  14. package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
  15. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
  16. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +23 -22
  17. package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
  18. package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js +10 -9
  19. package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js.map +1 -1
  20. package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.d.ts +2 -2
  21. package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
  22. package/dist/cli/src/config/getProjectConfig.d.ts +2 -2
  23. package/dist/cli/src/config/getProjectConfig.js +1 -1
  24. package/dist/cli/src/config/getProjectConfig.js.map +1 -1
  25. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.d.ts +2 -2
  26. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js +6 -5
  27. package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
  28. package/dist/cli/src/gcloud/serviceAccounts.d.ts +2 -2
  29. package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
  30. package/dist/cli/src/kubernetes/openKubernetesDashboards.d.ts +3 -3
  31. package/dist/cli/src/kubernetes/openKubernetesDashboards.js +10 -8
  32. package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
  33. package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +2 -2
  34. package/dist/pipeline/src/build/base/createAppBuildJob.js +8 -6
  35. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  36. package/dist/pipeline/src/build/base/index.d.ts +2 -2
  37. package/dist/pipeline/src/build/base/index.js.map +1 -1
  38. package/dist/pipeline/src/build/base/writeBuildInfo.d.ts +2 -2
  39. package/dist/pipeline/src/build/base/writeBuildInfo.js +1 -1
  40. package/dist/pipeline/src/build/base/writeBuildInfo.js.map +1 -1
  41. package/dist/pipeline/src/build/base/writeDotEnv.d.ts +2 -2
  42. package/dist/pipeline/src/build/base/writeDotEnv.js +1 -1
  43. package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
  44. package/dist/pipeline/src/build/custom/buildJob.d.ts +2 -2
  45. package/dist/pipeline/src/build/custom/buildJob.js +4 -4
  46. package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
  47. package/dist/pipeline/src/build/custom/index.d.ts +2 -2
  48. package/dist/pipeline/src/build/custom/index.js.map +1 -1
  49. package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
  50. package/dist/pipeline/src/build/custom/testJob.js +5 -5
  51. package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
  52. package/dist/pipeline/src/build/docker.d.ts +11 -11
  53. package/dist/pipeline/src/build/docker.js +17 -14
  54. package/dist/pipeline/src/build/docker.js.map +1 -1
  55. package/dist/pipeline/src/build/index.d.ts +2 -2
  56. package/dist/pipeline/src/build/node/buildJob.d.ts +2 -2
  57. package/dist/pipeline/src/build/node/buildJob.js +8 -8
  58. package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
  59. package/dist/pipeline/src/build/node/cache.d.ts +5 -5
  60. package/dist/pipeline/src/build/node/cache.js +5 -5
  61. package/dist/pipeline/src/build/node/cache.js.map +1 -1
  62. package/dist/pipeline/src/build/node/index.d.ts +4 -4
  63. package/dist/pipeline/src/build/node/index.js.map +1 -1
  64. package/dist/pipeline/src/build/node/meteor.d.ts +2 -2
  65. package/dist/pipeline/src/build/node/meteor.js +9 -9
  66. package/dist/pipeline/src/build/node/meteor.js.map +1 -1
  67. package/dist/pipeline/src/build/node/testJob.d.ts +2 -2
  68. package/dist/pipeline/src/build/node/testJob.js +12 -12
  69. package/dist/pipeline/src/build/node/testJob.js.map +1 -1
  70. package/dist/pipeline/src/build/node/yarn.d.ts +4 -4
  71. package/dist/pipeline/src/build/node/yarn.js +1 -3
  72. package/dist/pipeline/src/build/node/yarn.js.map +1 -1
  73. package/dist/pipeline/src/build/rails/build.d.ts +2 -2
  74. package/dist/pipeline/src/build/rails/build.js +3 -3
  75. package/dist/pipeline/src/build/rails/build.js.map +1 -1
  76. package/dist/pipeline/src/build/rails/index.d.ts +2 -2
  77. package/dist/pipeline/src/build/rails/index.js.map +1 -1
  78. package/dist/pipeline/src/build/rails/test.d.ts +2 -2
  79. package/dist/pipeline/src/build/rails/test.js +4 -4
  80. package/dist/pipeline/src/build/rails/test.js.map +1 -1
  81. package/dist/pipeline/src/build/sbom.d.ts +2 -2
  82. package/dist/pipeline/src/build/sbom.js +3 -3
  83. package/dist/pipeline/src/build/sbom.js.map +1 -1
  84. package/dist/pipeline/src/context/getEnvironment.d.ts +2 -2
  85. package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
  86. package/dist/pipeline/src/context/getEnvironmentContext.d.ts +2 -2
  87. package/dist/pipeline/src/context/getEnvironmentContext.js.map +1 -1
  88. package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +4 -4
  89. package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
  90. package/dist/pipeline/src/context/getLabels.d.ts +2 -2
  91. package/dist/pipeline/src/context/getLabels.js +1 -1
  92. package/dist/pipeline/src/context/getLabels.js.map +1 -1
  93. package/dist/pipeline/src/context/index.d.ts +7 -3
  94. package/dist/pipeline/src/context/index.js +46 -15
  95. package/dist/pipeline/src/context/index.js.map +1 -1
  96. package/dist/pipeline/src/deploy/base/deploy.d.ts +2 -2
  97. package/dist/pipeline/src/deploy/base/deploy.js +10 -17
  98. package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
  99. package/dist/pipeline/src/deploy/base/index.d.ts +2 -2
  100. package/dist/pipeline/src/deploy/base/index.js.map +1 -1
  101. package/dist/pipeline/src/deploy/base/rollback.d.ts +2 -2
  102. package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
  103. package/dist/pipeline/src/deploy/base/stop.d.ts +2 -2
  104. package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
  105. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.d.ts +7 -7
  106. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +8 -9
  107. package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
  108. package/dist/pipeline/src/deploy/cloudRun/cleanup.d.ts +2 -2
  109. package/dist/pipeline/src/deploy/cloudRun/cleanup.js.map +1 -1
  110. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
  111. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js +4 -5
  112. package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js.map +1 -1
  113. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
  114. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
  115. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
  116. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +1 -1
  117. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
  118. package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js +2 -1
  119. package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
  120. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
  121. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
  122. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
  123. package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
  124. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.d.ts +2 -2
  125. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js +2 -4
  126. package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js.map +1 -1
  127. package/dist/pipeline/src/deploy/cloudRun/utils/database.d.ts +3 -3
  128. package/dist/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
  129. package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
  130. package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js.map +1 -1
  131. package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
  132. package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js.map +1 -1
  133. package/dist/pipeline/src/deploy/custom/deployJob.d.ts +2 -2
  134. package/dist/pipeline/src/deploy/custom/deployJob.js +9 -10
  135. package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
  136. package/dist/pipeline/src/deploy/dockerTag/deployJob.d.ts +2 -2
  137. package/dist/pipeline/src/deploy/dockerTag/deployJob.js +3 -5
  138. package/dist/pipeline/src/deploy/dockerTag/deployJob.js.map +1 -1
  139. package/dist/pipeline/src/deploy/index.d.ts +2 -2
  140. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +3 -3
  141. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +11 -9
  142. package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
  143. package/dist/pipeline/src/deploy/kubernetes/deployJob.d.ts +2 -2
  144. package/dist/pipeline/src/deploy/kubernetes/deployJob.js +3 -6
  145. package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
  146. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +2 -2
  147. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js +2 -1
  148. package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js.map +1 -1
  149. package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
  150. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +6 -6
  151. package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
  152. package/dist/pipeline/src/deploy/kubernetes/mongodb.d.ts +2 -2
  153. package/dist/pipeline/src/deploy/kubernetes/mongodb.js +11 -11
  154. package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
  155. package/dist/pipeline/src/deploy/sbom.d.ts +4 -4
  156. package/dist/pipeline/src/deploy/sbom.js +1 -2
  157. package/dist/pipeline/src/deploy/sbom.js.map +1 -1
  158. package/dist/pipeline/src/deploy/types/index.d.ts +1 -1
  159. package/dist/pipeline/src/deploy/types/index.js +1 -1
  160. package/dist/pipeline/src/deploy/types/index.js.map +1 -1
  161. package/dist/pipeline/src/deploy/utils.d.ts +2 -2
  162. package/dist/pipeline/src/deploy/utils.js +2 -1
  163. package/dist/pipeline/src/deploy/utils.js.map +1 -1
  164. package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +2 -2
  165. package/dist/pipeline/src/pipeline/createJobsForComponent.js +7 -9
  166. package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
  167. package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
  168. package/dist/pipeline/src/types/config.d.ts +2 -2
  169. package/dist/pipeline/src/types/context.d.ts +28 -2
  170. package/dist/tsconfig.tsbuildinfo +1 -1
  171. package/package.json +1 -1
  172. package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +9 -12
  173. package/src/apps/cli/commands/project/commandOpenDashboard.ts +2 -2
  174. package/src/apps/cli/commands/project/commandPortForward.ts +9 -6
  175. package/src/apps/cli/commands/project/setup/setupCloudRun.ts +4 -4
  176. package/src/apps/cli/commands/project/setup/setupContext.ts +4 -4
  177. package/src/apps/cli/commands/project/setup/setupKubernetes.ts +3 -3
  178. package/src/apps/cli/commands/project/utils/ensureCluster.ts +2 -4
  179. package/src/apps/cli/commands/project/utils/ensureNamespace.ts +2 -2
  180. package/src/config/getProjectConfig.ts +2 -2
  181. package/src/gcloud/cloudRun/openCloudRunDashboards.ts +4 -4
  182. package/src/gcloud/serviceAccounts.ts +3 -3
  183. package/src/kubernetes/openKubernetesDashboards.ts +5 -5
@@ -811,7 +811,7 @@ var getPipelineContextByChoice = function (env, componentName) { return __awaite
811
811
  case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
812
812
  case 1:
813
813
  config = _a.sent();
814
- return [4 /*yield*/, (0, pipeline_1.createContext)({
814
+ return [4 /*yield*/, (0, pipeline_1.createComponentContext)({
815
815
  config: config,
816
816
  componentName: componentName,
817
817
  env: env,
@@ -2267,17 +2267,19 @@ var createAppBuildJob = function (context, _a) {
2267
2267
  image: (0, __1.getRunnerImage)("jobs-default"),
2268
2268
  needs: [],
2269
2269
  cache: [],
2270
- variables: __assign(__assign(__assign(__assign({}, (variables !== null && variables !== void 0 ? variables : {})), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), ((_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {})),
2271
- runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), (runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {})), ((_c = context.componentConfig.build.runnerVariables) !== null && _c !== void 0 ? _c : {})),
2270
+ variables: __assign(__assign(__assign(__assign({}, (variables !== null && variables !== void 0 ? variables : {})), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), ((_b = context.build.config.extraVars) !== null && _b !== void 0 ? _b : {})),
2271
+ runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), (runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {})), ((_c = context.build.config.runnerVariables) !== null && _c !== void 0 ? _c : {})),
2272
2272
  script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((context.componentConfig.dotEnv === true // don't build when set to `local`
2273
2273
  ? (0, writeDotEnv_1.writeDotEnv)(context)
2274
- : [])), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), [
2275
- "cd ".concat(context.componentConfig.dir)
2274
+ : [])), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
2275
+ "cd ".concat(context.build.dir)
2276
2276
  ], false), __read(((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : [])), false),
2277
2277
  artifacts: {
2278
- paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
2278
+ paths: [(0, path_1.join)(context.build.dir, "__build_info.json")],
2279
2279
  reports: {
2280
- junit: (_f = (_e = context.componentConfig.build.artifactsReports) === null || _e === void 0 ? void 0 : _e.junit) === null || _f === void 0 ? void 0 : _f.map(function (p) { return (0, path_1.join)(context.componentConfig.dir, p); }),
2280
+ junit: (_f = (_e = context.build.config.artifactsReports) === null || _e === void 0 ? void 0 : _e.junit) === null || _f === void 0 ? void 0 : _f.map(function (p) {
2281
+ return (0, path_1.join)(context.build.dir, p);
2282
+ }),
2281
2283
  },
2282
2284
  },
2283
2285
  }, def);
@@ -2425,7 +2427,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
2425
2427
  exports.writeBuildInfo = void 0;
2426
2428
  var writeBuildInfo = function (context) {
2427
2429
  return [
2428
- "echo '{\"id\":\"".concat(context.environment.envVars.BUILD_INFO_BUILD_ID, "\",\"time\":\"").concat(context.environment.envVars.BUILD_INFO_BUILD_TIME, "\"}' > ").concat(context.componentConfig.dir, "/__build_info.json"),
2430
+ "echo '{\"id\":\"".concat(context.environment.envVars.BUILD_INFO_BUILD_ID, "\",\"time\":\"").concat(context.environment.envVars.BUILD_INFO_BUILD_TIME, "\"}' > ").concat(context.build.dir, "/__build_info.json"),
2429
2431
  ];
2430
2432
  };
2431
2433
  exports.writeBuildInfo = writeBuildInfo;
@@ -2477,7 +2479,7 @@ var writeDotEnv = function (context) {
2477
2479
  })
2478
2480
  .join("\n");
2479
2481
  return [
2480
- "cat <<EOF > ".concat(context.componentConfig.dir, "/.env\n").concat(keyValueString, "\nEOF"),
2482
+ "cat <<EOF > ".concat(context.build.dir, "/.env\n").concat(keyValueString, "\nEOF"),
2481
2483
  ];
2482
2484
  };
2483
2485
  exports.writeDotEnv = writeDotEnv;
@@ -2529,7 +2531,7 @@ var RUNNER_BUILD_VARIABLES = {
2529
2531
  };
2530
2532
  var createCustomBuildJobs = function (context) {
2531
2533
  var _a, _b, _c;
2532
- var buildConfig = context.componentConfig.build;
2534
+ var buildConfig = context.build.config;
2533
2535
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
2534
2536
  throw new Error("deploy config is not custom");
2535
2537
  }
@@ -2543,10 +2545,10 @@ var createCustomBuildJobs = function (context) {
2543
2545
  script: __spreadArray([], __read(((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : [])), false),
2544
2546
  artifacts: {
2545
2547
  paths: __spreadArray([
2546
- (0, path_1.join)(context.componentConfig.dir, "__build_info.json"),
2547
- (0, path_1.join)(context.componentConfig.dir, "dist")
2548
+ (0, path_1.join)(context.build.dir, "__build_info.json"),
2549
+ (0, path_1.join)(context.build.dir, "dist")
2548
2550
  ], __read(((_c = (_b = buildConfig.artifactsPaths) === null || _b === void 0 ? void 0 : _b.map(function (path) {
2549
- return (0, path_1.join)(context.componentConfig.dir, path);
2551
+ return (0, path_1.join)(context.build.dir, path);
2550
2552
  })) !== null && _c !== void 0 ? _c : [])), false),
2551
2553
  expire_in: "1 day",
2552
2554
  },
@@ -2663,12 +2665,12 @@ var createCustomTestJobs = function (context) {
2663
2665
  if (context.trigger === "taggedRelease") {
2664
2666
  return [];
2665
2667
  }
2666
- var buildConfig = context.componentConfig.build;
2668
+ var buildConfig = context.build.config;
2667
2669
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
2668
2670
  throw new Error("deploy config is not custom");
2669
2671
  }
2670
2672
  var base = {
2671
- variables: __assign(__assign({ APP_PATH: context.componentConfig.dir }, context.environment.jobOnlyVars.build.envVars), ((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {})),
2673
+ variables: __assign(__assign({ APP_PATH: context.build.dir }, context.environment.jobOnlyVars.build.envVars), ((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {})),
2672
2674
  runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
2673
2675
  services: buildConfig.jobServices,
2674
2676
  cache: buildConfig.jobCache,
@@ -2677,11 +2679,11 @@ var createCustomTestJobs = function (context) {
2677
2679
  envMode: "none",
2678
2680
  };
2679
2681
  var auditJob = buildConfig.audit
2680
- ? __assign(__assign(__assign({ name: "🛡 audit" }, base), { image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage, cache: undefined, script: __spreadArray([], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
2682
+ ? __assign(__assign(__assign({ name: "🛡 audit" }, base), { image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage, cache: undefined, script: __spreadArray([], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
2681
2683
  var lintJob = buildConfig.lint
2682
- ? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage, script: __spreadArray([], __read(((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : [])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
2684
+ ? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage, script: __spreadArray([], __read(((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : [])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
2683
2685
  var testJob = buildConfig.test
2684
- ? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : buildConfig.jobImage, script: __spreadArray([], __read(((_s = (0, utils_1.ensureArray)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : [])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
2686
+ ? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : buildConfig.jobImage, script: __spreadArray([], __read(((_s = (0, utils_1.ensureArray)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : [])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
2685
2687
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
2686
2688
  };
2687
2689
  exports.createCustomTestJobs = createCustomTestJobs;
@@ -2746,21 +2748,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2746
2748
  };
2747
2749
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2748
2750
  exports.hasDockerfile = exports.getDockerBuildDefaultScript = exports.getDockerBuildScriptWithBuiltInDockerFile = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
2749
- var lodash_1 = __nccwpck_require__(3255);
2750
- var deploy_1 = __nccwpck_require__(8483);
2751
- var runner_1 = __nccwpck_require__(4058);
2752
2751
  var fs_1 = __nccwpck_require__(7147);
2752
+ var lodash_1 = __nccwpck_require__(3255);
2753
2753
  var path_1 = __importDefault(__nccwpck_require__(1017));
2754
- var gitlab_1 = __nccwpck_require__(8490);
2754
+ var deploy_1 = __nccwpck_require__(8483);
2755
2755
  var artifactsRegistry_1 = __nccwpck_require__(4963);
2756
2756
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(6320);
2757
+ var runner_1 = __nccwpck_require__(4058);
2758
+ var gitlab_1 = __nccwpck_require__(8490);
2757
2759
  var DOCKER_BUILD_RUNNER_REQUESTS = {
2758
2760
  KUBERNETES_CPU_REQUEST: "0.5",
2759
2761
  KUBERNETES_MEMORY_REQUEST: "1Gi",
2760
2762
  KUBERNETES_MEMORY_LIMIT: "2Gi",
2761
2763
  };
2762
2764
  var getDockerImageVariables = function (context) {
2763
- return __assign(__assign({}, ((0, deploy_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")
2765
+ var _a;
2766
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
2767
+ return __assign(__assign({}, ((0, deploy_1.isOfDeployType)(deployConfig, "google-cloudrun")
2764
2768
  ? {
2765
2769
  DOCKER_REGISTRY: (0, artifactsRegistry_1.getArtifactsRegistryHost)(context),
2766
2770
  DOCKER_IMAGE: (0, artifactsRegistry_1.getArtifactsRegistryImageName)(context),
@@ -2779,10 +2783,11 @@ exports.getDockerImageVariables = getDockerImageVariables;
2779
2783
  /**
2780
2784
  * Weather the context requires a docker build
2781
2785
  */
2782
- var requiresDockerBuild = function (_a) {
2783
- var deploy = _a.componentConfig.deploy;
2784
- return (0, deploy_1.isOfDeployType)(deploy, "kubernetes", "google-cloudrun", "dockerTag") ||
2785
- ((0, deploy_1.isOfDeployType)(deploy, "custom") && deploy.requiresDocker);
2786
+ var requiresDockerBuild = function (context) {
2787
+ var _a;
2788
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
2789
+ return ((0, deploy_1.isOfDeployType)(deployConfig, "kubernetes", "google-cloudrun", "dockerTag") ||
2790
+ ((0, deploy_1.isOfDeployType)(deployConfig, "custom") && deployConfig.requiresDocker));
2786
2791
  };
2787
2792
  exports.requiresDockerBuild = requiresDockerBuild;
2788
2793
  // those need to be runner variables
@@ -2808,11 +2813,11 @@ var getDockerAdditions = function (build) {
2808
2813
  };
2809
2814
  };
2810
2815
  var getDockerBuildVariables = function (context) {
2811
- return __assign(__assign(__assign({}, getDockerAdditions(context.componentConfig.build)), { APP_DIR: context.componentConfig.dir, DOCKER_DIR: "." }), (0, exports.getDockerImageVariables)(context));
2816
+ return __assign(__assign(__assign({}, getDockerAdditions(context.build.config)), { APP_DIR: context.build.dir, DOCKER_DIR: "." }), (0, exports.getDockerImageVariables)(context));
2812
2817
  };
2813
2818
  exports.getDockerBuildVariables = getDockerBuildVariables;
2814
2819
  exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
2815
- var getDockerJobBaseProps = function (context) {
2820
+ var getDockerJobBaseProps = function () {
2816
2821
  return {
2817
2822
  image: (0, runner_1.getRunnerImage)("docker-build"),
2818
2823
  services: [
@@ -2828,14 +2833,14 @@ var getDockerJobBaseProps = function (context) {
2828
2833
  exports.getDockerJobBaseProps = getDockerJobBaseProps;
2829
2834
  var createDockerBuildJobBase = function (context, _a) {
2830
2835
  var script = _a.script, def = __rest(_a, ["script"]);
2831
- return (0, lodash_1.merge)(__assign(__assign({ name: exports.DOCKER_BUILD_JOB_NAME, envMode: "jobPerEnv", stage: "build" }, (0, exports.getDockerJobBaseProps)(context)), { script: script || [] }), {
2836
+ return (0, lodash_1.merge)(__assign(__assign({ name: exports.DOCKER_BUILD_JOB_NAME, envMode: "jobPerEnv", stage: "build" }, (0, exports.getDockerJobBaseProps)()), { script: script || [] }), {
2832
2837
  variables: (0, exports.getDockerBuildVariables)(context),
2833
2838
  runnerVariables: __assign(__assign({}, DOCKER_BUILD_RUNNER_REQUESTS), getDockerBuildRunnerVariables()),
2834
2839
  }, def);
2835
2840
  };
2836
2841
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
2837
2842
  var gitlabDockerLogin = function (context) {
2838
- return (0, deploy_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")
2843
+ return context.deploy && (0, deploy_1.isOfDeployType)(context.deploy.config, "google-cloudrun")
2839
2844
  ? __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), [
2840
2845
  "gcloud auth configure-docker ".concat((0, artifactsRegistry_1.getArtifactsRegistryHost)(context)),
2841
2846
  ], false) : [
@@ -2872,7 +2877,7 @@ var getDockerBuildDefaultScript = function (context, ensureDockerFileScript) {
2872
2877
  };
2873
2878
  exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
2874
2879
  var hasDockerfile = function (context) {
2875
- return (0, fs_1.existsSync)(path_1.default.join(context.componentConfig.dir, "Dockerfile"));
2880
+ return (0, fs_1.existsSync)(path_1.default.join(context.build.dir, "Dockerfile"));
2876
2881
  };
2877
2882
  exports.hasDockerfile = hasDockerfile;
2878
2883
  //# sourceMappingURL=docker.js.map
@@ -2993,23 +2998,23 @@ var constants_1 = __nccwpck_require__(1765);
2993
2998
  var yarn_1 = __nccwpck_require__(5043);
2994
2999
  var createNodeBuildJobs = function (context) {
2995
3000
  var _a, _b, _c, _d, _e, _f, _g;
2996
- var buildConfig = context.componentConfig.build;
3001
+ var buildConfig = context.build.config;
2997
3002
  if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
2998
3003
  throw new Error("deploy config is not node, node-static or storybook");
2999
3004
  }
3000
3005
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
3001
- var yarnInstall = (0, yarn_1.getYarnInstall)(context);
3006
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build);
3002
3007
  return (0, base_1.createBuildJobs)(context, {
3003
3008
  appBuild: buildConfig.buildCommand !== null
3004
3009
  ? {
3005
3010
  image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
3006
3011
  runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
3007
- cache: __spreadArray(__spreadArray(__spreadArray([], __read(((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : [])), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
3012
+ cache: __spreadArray(__spreadArray(__spreadArray([], __read(((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : [])), false), __read((0, cache_1.getNodeCache)(context.build)), false), __read((0, cache_1.getNextCache)(context)), false),
3008
3013
  script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read(((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : [])), false),
3009
3014
  artifacts: {
3010
3015
  paths: __spreadArray([
3011
- context.componentConfig.dir
3012
- ], __read(((_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : [])), false).flatMap(function (dir) {
3016
+ context.build.dir
3017
+ ], __read(((_e = (_d = context.build.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : [])), false).flatMap(function (dir) {
3013
3018
  var _a, _b;
3014
3019
  return __spreadArray([
3015
3020
  (0, path_1.join)(dir, "__build_info.json"),
@@ -3029,11 +3034,11 @@ var createNodeBuildJobs = function (context) {
3029
3034
  script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static" || buildConfig.type === "storybook"
3030
3035
  ? "nginx"
3031
3036
  : "node"),
3032
- cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
3037
+ cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context.build, "pull")), false),
3033
3038
  variables: {
3034
3039
  // only required for non static
3035
- DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
3036
- DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _g === void 0 ? void 0 : _g.join("\n"),
3040
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
3041
+ DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.build.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _g === void 0 ? void 0 : _g.join("\n"),
3037
3042
  },
3038
3043
  },
3039
3044
  });
@@ -3093,9 +3098,9 @@ var getYarnCache = function (context, policy) {
3093
3098
  paths: [".yarn"],
3094
3099
  }
3095
3100
  : {
3096
- key: (0, slugify_1.default)(context.componentConfig.dir) + "-yarn",
3101
+ key: (0, slugify_1.default)(context.dir) + "-yarn",
3097
3102
  policy: policy,
3098
- paths: [(0, path_1.join)(context.componentConfig.dir, ".yarn")],
3103
+ paths: [(0, path_1.join)(context.dir, ".yarn")],
3099
3104
  },
3100
3105
  ];
3101
3106
  };
@@ -3111,7 +3116,7 @@ var getNodeModulesCache = function (context, policy) {
3111
3116
  // if component is in a shared workspace, use workspace cache. use individual cache else
3112
3117
  key: componentIsInWorkspace
3113
3118
  ? "node-modules-workspace"
3114
- : (0, slugify_1.default)(context.componentConfig.dir) + "-node-modules", // we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
3119
+ : (0, slugify_1.default)(context.dir) + "-node-modules", // we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
3115
3120
  policy: policy,
3116
3121
  paths: __spreadArray([], __read((componentIsInWorkspace
3117
3122
  ? (0, lodash_1.uniq)(__spreadArray([
@@ -3119,7 +3124,7 @@ var getNodeModulesCache = function (context, policy) {
3119
3124
  ], __read(((_c = (_b = context.packageManagerInfo) === null || _b === void 0 ? void 0 : _b.workspaces.map(function (w) {
3120
3125
  return (0, path_1.join)(w.location, "node_modules");
3121
3126
  })) !== null && _c !== void 0 ? _c : [])), false))
3122
- : [(0, path_1.join)(context.componentConfig.dir, "node_modules")])), false),
3127
+ : [(0, path_1.join)(context.dir, "node_modules")])), false),
3123
3128
  },
3124
3129
  ];
3125
3130
  };
@@ -3133,7 +3138,7 @@ var getNextCache = function (context) { return [
3133
3138
  {
3134
3139
  key: context.componentName + "-next-cache",
3135
3140
  policy: "pull-push",
3136
- paths: [context.componentConfig.dir + "/.next/cache/"],
3141
+ paths: [context.build.dir + "/.next/cache/"],
3137
3142
  },
3138
3143
  ]; };
3139
3144
  exports.getNextCache = getNextCache;
@@ -3252,23 +3257,23 @@ var getMeteorCache = function (context) { return [
3252
3257
  key: context.componentName + "meteor-build-cache",
3253
3258
  policy: "pull-push",
3254
3259
  paths: [
3255
- (0, path_1.join)(context.componentConfig.dir, ".meteor/local/resolver-result-cache.json"),
3256
- (0, path_1.join)(context.componentConfig.dir, ".meteor/local/plugin-cache"),
3257
- (0, path_1.join)(context.componentConfig.dir, ".meteor/local/isopacks"),
3258
- (0, path_1.join)(context.componentConfig.dir, ".meteor/local/bundler-cache/scanner"),
3260
+ (0, path_1.join)(context.build.dir, ".meteor/local/resolver-result-cache.json"),
3261
+ (0, path_1.join)(context.build.dir, ".meteor/local/plugin-cache"),
3262
+ (0, path_1.join)(context.build.dir, ".meteor/local/isopacks"),
3263
+ (0, path_1.join)(context.build.dir, ".meteor/local/bundler-cache/scanner"),
3259
3264
  ],
3260
3265
  },
3261
3266
  ]; };
3262
3267
  var createMeteorBuildJobs = function (context) {
3263
- var buildConfig = context.componentConfig.build;
3268
+ var buildConfig = context.build.config;
3264
3269
  if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
3265
3270
  throw new Error("deploy config is not meteor");
3266
3271
  }
3267
- var yarnInstall = (0, yarn_1.getYarnInstall)(context);
3272
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build);
3268
3273
  return (0, base_1.createBuildJobs)(context, {
3269
3274
  appBuild: buildConfig.buildCommand !== null
3270
3275
  ? {
3271
- cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
3276
+ cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context.build)), false), __read(getMeteorCache(context)), false),
3272
3277
  image: (0, runner_1.getRunnerImage)("jobs-meteor"),
3273
3278
  variables: {
3274
3279
  METEOR_DISABLE_OPTIMISTIC_CACHING: "1", // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
@@ -3282,8 +3287,8 @@ var createMeteorBuildJobs = function (context) {
3282
3287
  ], false),
3283
3288
  artifacts: {
3284
3289
  paths: [
3285
- context.componentConfig.dir + "/__build_info.json",
3286
- context.componentConfig.dir + "/dist",
3290
+ context.build.dir + "/__build_info.json",
3291
+ context.build.dir + "/dist",
3287
3292
  ],
3288
3293
  },
3289
3294
  }
@@ -3357,32 +3362,32 @@ var createNodeTestJobs = function (context) {
3357
3362
  if (context.trigger === "taggedRelease") {
3358
3363
  return [];
3359
3364
  }
3360
- var buildConfig = context.componentConfig.build;
3365
+ var buildConfig = context.build.config;
3361
3366
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
3362
3367
  var base = {
3363
- variables: __assign(__assign({ APP_PATH: context.componentConfig.dir }, context.environment.jobOnlyVars.build.envVars), ((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {})),
3368
+ variables: __assign(__assign({ APP_PATH: context.build.dir }, context.environment.jobOnlyVars.build.envVars), ((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {})),
3364
3369
  runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
3365
3370
  stage: "test",
3366
3371
  needs: [],
3367
3372
  envMode: "none",
3368
3373
  };
3369
- var yarnInstall = (0, yarn_1.getYarnInstall)(context);
3374
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build);
3370
3375
  var auditJob = buildConfig.audit !== false
3371
3376
  ? __assign(__assign(__assign({ name: "🛡 audit" }, base), { image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage, cache: undefined, script: __spreadArray([
3372
- "cd ".concat(context.componentConfig.dir)
3377
+ "cd ".concat(context.build.dir)
3373
3378
  ], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
3374
- ((_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic)
3379
+ ((_f = context.build.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic)
3375
3380
  ? "yarn audit"
3376
3381
  : "yarn npm audit --environment production", // yarn 2
3377
- ])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifacts)) : null;
3382
+ ])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifacts)) : null;
3378
3383
  var lintJob = buildConfig.lint !== false
3379
- ? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : defaultImage, cache: (0, cache_1.getNodeCache)(context), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), [
3380
- "cd ".concat(context.componentConfig.dir)
3381
- ], false), __read(yarnInstall), false), __read(((_m = (0, utils_1.ensureArray)((_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.command)) !== null && _m !== void 0 ? _m : ["yarn lint"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifactsReports, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifacts)) : null;
3384
+ ? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : defaultImage, cache: (0, cache_1.getNodeCache)(context.build), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
3385
+ "cd ".concat(context.build.dir)
3386
+ ], false), __read(yarnInstall), false), __read(((_m = (0, utils_1.ensureArray)((_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.command)) !== null && _m !== void 0 ? _m : ["yarn lint"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifactsReports, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifacts)) : null;
3382
3387
  var testJob = buildConfig.test !== false
3383
- ? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (_r = (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.jobImage) !== null && _r !== void 0 ? _r : (0, runner_1.getRunnerImage)("jobs-testing-chrome"), cache: (0, cache_1.getNodeCache)(context), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), [
3384
- "cd ".concat(context.componentConfig.dir)
3385
- ], false), __read(yarnInstall), false), __read(((_t = (0, utils_1.ensureArray)((_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.command)) !== null && _t !== void 0 ? _t : ["yarn test"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifactsReports, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifacts)) : null;
3388
+ ? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (_r = (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.jobImage) !== null && _r !== void 0 ? _r : (0, runner_1.getRunnerImage)("jobs-testing-chrome"), cache: (0, cache_1.getNodeCache)(context.build), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
3389
+ "cd ".concat(context.build.dir)
3390
+ ], false), __read(yarnInstall), false), __read(((_t = (0, utils_1.ensureArray)((_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.command)) !== null && _t !== void 0 ? _t : ["yarn test"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifactsReports, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifacts)) : null;
3386
3391
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
3387
3392
  };
3388
3393
  exports.createNodeTestJobs = createNodeTestJobs;
@@ -3444,9 +3449,7 @@ var ensureNodeVersion = function (context) {
3444
3449
  exports.ensureNodeVersion = ensureNodeVersion;
3445
3450
  var getYarnInstall = function (context, options) {
3446
3451
  var _a;
3447
- var postInstall = "postInstall" in context.componentConfig.build
3448
- ? context.componentConfig.build.postInstall
3449
- : null;
3452
+ var postInstall = "postInstall" in context.config ? context.config.postInstall : null;
3450
3453
  return __spreadArray(__spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), __read((0, gitlab_1.collapseableSection)("yarninstall", "Yarn install")([getYarnInstallCommand(context)])), false), __read((postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall)
3451
3454
  ? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((_a = (0, utils_1.ensureArray)(postInstall)) !== null && _a !== void 0 ? _a : [])
3452
3455
  : [])), false);
@@ -3521,7 +3524,7 @@ var docker_1 = __nccwpck_require__(9641);
3521
3524
  var types_1 = __nccwpck_require__(4466);
3522
3525
  var createRailsBuildJobs = function (context) {
3523
3526
  var _a, _b, _c;
3524
- var buildConfig = context.componentConfig.build;
3527
+ var buildConfig = context.build.config;
3525
3528
  if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
3526
3529
  // should not happen
3527
3530
  throw new Error("build type is not rails");
@@ -3545,10 +3548,10 @@ var createRailsBuildJobs = function (context) {
3545
3548
  return (0, base_1.createBuildJobs)(context, {
3546
3549
  appBuild: undefined,
3547
3550
  dockerBuild: {
3548
- variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
3551
+ variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.build.config.extraVars),
3549
3552
  // custom script
3550
3553
  script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), [
3551
- "cd ".concat(context.componentConfig.dir),
3554
+ "cd ".concat(context.build.dir),
3552
3555
  "docker pull $DOCKER_CACHE_IMAGE || true",
3553
3556
  "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "/pack-v").concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packVersion, "-linux.tgz | tar -zx --directory /usr/local/bin pack"),
3554
3557
  "chmod +x /usr/local/bin/pack",
@@ -3657,7 +3660,7 @@ var createRailsTestJobs = function (context) {
3657
3660
  if (context.trigger === "taggedRelease") {
3658
3661
  return [];
3659
3662
  }
3660
- var buildConfig = context.componentConfig.build;
3663
+ var buildConfig = context.build.config;
3661
3664
  var base = {
3662
3665
  variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), ((_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {})),
3663
3666
  stage: "test",
@@ -3679,20 +3682,20 @@ var createRailsTestJobs = function (context) {
3679
3682
  };
3680
3683
  var auditJob = buildConfig.audit !== false
3681
3684
  ? __assign(__assign({ name: "🛡 audit" }, base), { cache: undefined, image: (_d = (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage) !== null && _d !== void 0 ? _d : defaultImage, script: __spreadArray([
3682
- "cd ".concat(context.componentConfig.dir)
3685
+ "cd ".concat(context.build.dir)
3683
3686
  ], __read(((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [
3684
3687
  "gem install bundler-audit",
3685
3688
  "bundle audit check",
3686
3689
  ])), false), allow_failure: true }) : null;
3687
3690
  var lintJob = buildConfig.lint !== false
3688
3691
  ? __assign(__assign({ name: "👮 lint" }, base), { cache: bundlerCache, image: (_j = (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage) !== null && _j !== void 0 ? _j : defaultImage, script: __spreadArray(__spreadArray([
3689
- "cd ".concat(context.componentConfig.dir)
3692
+ "cd ".concat(context.build.dir)
3690
3693
  ], __read(bundlerInstall), false), __read(((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : [
3691
3694
  "bundle exec rubocop",
3692
3695
  ])), false) }) : null;
3693
3696
  var testJob = buildConfig.test !== false
3694
3697
  ? __assign(__assign({ name: "🧪 test" }, base), { cache: bundlerCache, image: (_p = (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage) !== null && _p !== void 0 ? _p : defaultImage, script: __spreadArray(__spreadArray([
3695
- "cd ".concat(context.componentConfig.dir)
3698
+ "cd ".concat(context.build.dir)
3696
3699
  ], __read(bundlerInstall), false), __read(((_r = (0, utils_1.ensureArray)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : [
3697
3700
  "bundle exec rspec",
3698
3701
  ])), false) }) : null;
@@ -3715,12 +3718,12 @@ exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
3715
3718
  exports.SBOM_FILE = "__sbom.json";
3716
3719
  var createSbomBuildJob = function (context) {
3717
3720
  var _a, _b, _c, _d, _e;
3718
- var buildConfig = context.componentConfig.build;
3721
+ var buildConfig = context.build.config;
3719
3722
  var defaultImage = "aquasec/trivy:0.38.3";
3720
3723
  var defaultScript = [
3721
- "trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace)
3724
+ "trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.build.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace)
3722
3725
  ? "."
3723
- : context.componentConfig.dir),
3726
+ : context.build.dir),
3724
3727
  ];
3725
3728
  var image = buildConfig.type === "custom" && buildConfig.sbom !== false
3726
3729
  ? (_c = (_b = buildConfig.sbom) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage
@@ -4346,7 +4349,7 @@ var sanitize = function (value) {
4346
4349
  };
4347
4350
  var getLabels = function (context) {
4348
4351
  var _a, _b, _c;
4349
- var labels = __assign({ "customer-name": sanitize(context.fullConfig.customerName), "component-name": sanitize(context.componentName), "app-name": sanitize(context.fullConfig.appName), "env-type": sanitize(context.environment.envType), "env-name": sanitize(context.environment.shortName), "build-type": sanitize((_a = context.componentConfig.build) === null || _a === void 0 ? void 0 : _a.type) }, ((_c = (_b = context.fullConfig.meta) === null || _b === void 0 ? void 0 : _b.labels) !== null && _c !== void 0 ? _c : {}));
4352
+ var labels = __assign({ "customer-name": sanitize(context.fullConfig.customerName), "component-name": sanitize(context.componentName), "app-name": sanitize(context.fullConfig.appName), "env-type": sanitize(context.environment.envType), "env-name": sanitize(context.environment.shortName), "build-type": sanitize((_a = context.build.config) === null || _a === void 0 ? void 0 : _a.type) }, ((_c = (_b = context.fullConfig.meta) === null || _b === void 0 ? void 0 : _b.labels) !== null && _c !== void 0 ? _c : {}));
4350
4353
  return labels;
4351
4354
  };
4352
4355
  exports.getLabels = getLabels;
@@ -4385,6 +4388,17 @@ exports.getReviewSlug = getReviewSlug;
4385
4388
 
4386
4389
  "use strict";
4387
4390
 
4391
+ var __assign = (this && this.__assign) || function () {
4392
+ __assign = Object.assign || function(t) {
4393
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4394
+ s = arguments[i];
4395
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
4396
+ t[p] = s[p];
4397
+ }
4398
+ return t;
4399
+ };
4400
+ return __assign.apply(this, arguments);
4401
+ };
4388
4402
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4389
4403
  if (k2 === undefined) k2 = k;
4390
4404
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -4436,7 +4450,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
4436
4450
  }
4437
4451
  };
4438
4452
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4439
- exports.createContext = void 0;
4453
+ exports.createContext = exports.createComponentContext = void 0;
4454
+ var lodash_1 = __nccwpck_require__(3255);
4440
4455
  var build_1 = __nccwpck_require__(7862);
4441
4456
  var deploy_1 = __nccwpck_require__(8483);
4442
4457
  var utils_1 = __nccwpck_require__(2497);
@@ -4444,11 +4459,10 @@ var getEnvironment_1 = __nccwpck_require__(5699);
4444
4459
  var getEnvironmentContext_1 = __nccwpck_require__(3663);
4445
4460
  __exportStar(__nccwpck_require__(5699), exports);
4446
4461
  __exportStar(__nccwpck_require__(5133), exports);
4447
- var createContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
4448
- var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
4449
- var _a;
4450
- return __generator(this, function (_b) {
4451
- switch (_b.label) {
4462
+ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
4463
+ var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
4464
+ return __generator(this, function (_a) {
4465
+ switch (_a.label) {
4452
4466
  case 0:
4453
4467
  if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
4454
4468
  throw new Error("componentName may only contain lower case letters, numbers and -");
@@ -4465,21 +4479,41 @@ var createContext = function (ctx) { return __awaiter(void 0, void 0, void 0, fu
4465
4479
  deploy: {},
4466
4480
  };
4467
4481
  componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
4468
- _a = {
4482
+ return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
4483
+ case 1:
4484
+ environment = _a.sent();
4485
+ deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
4486
+ context = {
4469
4487
  fullConfig: ctx.config,
4470
4488
  componentConfig: componentConfig,
4471
- componentName: ctx.componentName
4489
+ build: {
4490
+ dir: dir,
4491
+ packageManagerInfo: ctx.packageManagerInfo,
4492
+ config: build,
4493
+ },
4494
+ deploy: deploy
4495
+ ? {
4496
+ config: deploy,
4497
+ }
4498
+ : null,
4499
+ componentName: ctx.componentName,
4500
+ environment: environment,
4501
+ packageManagerInfo: ctx.packageManagerInfo,
4502
+ pipelineType: ctx.pipelineType,
4503
+ trigger: ctx.trigger,
4472
4504
  };
4473
- return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
4474
- case 1: return [2 /*return*/, (_a.environment = _b.sent(),
4475
- _a.packageManagerInfo = ctx.packageManagerInfo,
4476
- _a.pipelineType = ctx.pipelineType,
4477
- _a.trigger = ctx.trigger,
4478
- _a)];
4505
+ resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs)
4506
+ ? customJobs(context)
4507
+ : customJobs;
4508
+ return [2 /*return*/, __assign(__assign({}, context), { customJobs: resolvedCustomJobs })];
4479
4509
  }
4480
4510
  });
4481
4511
  }); };
4482
- exports.createContext = createContext;
4512
+ exports.createComponentContext = createComponentContext;
4513
+ /**
4514
+ * @deprecated use createComponentContext instead
4515
+ */
4516
+ exports.createContext = exports.createComponentContext;
4483
4517
  //# sourceMappingURL=index.js.map
4484
4518
 
4485
4519
  /***/ }),
@@ -4886,7 +4920,7 @@ var stop_1 = __nccwpck_require__(2846);
4886
4920
  var variables_1 = __nccwpck_require__(2422);
4887
4921
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
4888
4922
  var createDeployJob = function (context, jobDefinition) {
4889
- var _a, _b, _c, _d, _e, _f;
4923
+ var _a, _b, _c, _d, _e, _f, _g;
4890
4924
  var hasDocker = (0, docker_1.requiresDockerBuild)(context);
4891
4925
  var isStoppable = (0, utils_1.contextIsStoppable)(context);
4892
4926
  var autoStop = context.environment.envType === "review"
@@ -4894,14 +4928,13 @@ var createDeployJob = function (context, jobDefinition) {
4894
4928
  : context.environment.envType === "dev"
4895
4929
  ? "4 weeks"
4896
4930
  : undefined;
4931
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
4897
4932
  // if auto or manual is configured explicitly, use that
4898
- var whenDeployDefined = context.componentConfig.deploy && context.componentConfig.deploy.when
4899
- ? context.componentConfig.deploy.when
4900
- : undefined;
4933
+ var whenDeployDefined = deployConfig && deployConfig.when ? deployConfig.when : undefined;
4901
4934
  // otherwise auto deploy if env is not prod. If its prod, deploy automatically if stage is disabled
4902
4935
  var whenDeployDefault = context.environment.envType !== "prod"
4903
4936
  ? "auto" // is not stage, auto deploy
4904
- : ((_a = context.componentConfig.env) === null || _a === void 0 ? void 0 : _a.stage) === false
4937
+ : ((_b = context.componentConfig.env) === null || _b === void 0 ? void 0 : _b.stage) === false
4905
4938
  ? "auto" // is prod, but no staging, auto deploy
4906
4939
  : "manual"; // manually deploy
4907
4940
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
@@ -4915,12 +4948,12 @@ var createDeployJob = function (context, jobDefinition) {
4915
4948
  envMode: "stagePerEnv", // makes it easier to run manual tasks er env
4916
4949
  needs: __spreadArray(__spreadArray([], __read(((0, sbom_2.sbomDeactivated)(context)
4917
4950
  ? []
4918
- : [{ job: sbom_1.SBOM_BUILD_JOB_NAME, artifacts: true }])), false), __read((context.componentConfig.deploy
4919
- ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) { return ({
4951
+ : [{ job: sbom_1.SBOM_BUILD_JOB_NAME, artifacts: true }])), false), __read((deployConfig
4952
+ ? (_d = (_c = deployConfig.waitFor) === null || _c === void 0 ? void 0 : _c.map(function (c) { return ({
4920
4953
  componentName: c,
4921
4954
  job: exports.DEPLOY_JOB_NAME,
4922
4955
  artifacts: false,
4923
- }); })) !== null && _c !== void 0 ? _c : []
4956
+ }); })) !== null && _d !== void 0 ? _d : []
4924
4957
  : [])), false),
4925
4958
  // we don't want to deploy when there is a broken test
4926
4959
  needsStages: [
@@ -4936,21 +4969,15 @@ var createDeployJob = function (context, jobDefinition) {
4936
4969
  when: whenDeploy === "auto" ? "on_success" : "manual",
4937
4970
  allow_failure: whenDeploy === "manual" ? true : false,
4938
4971
  stage: "deploy",
4939
- variables: __assign(__assign(__assign(__assign(__assign({}, context.environment.envVars), (hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {})), context.environment.jobOnlyVars.deploy.envVars), (context.componentConfig.deploy
4940
- ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {}
4941
- : {})), jobDefinition.variables),
4942
- runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), ((_e = jobDefinition.runnerVariables) !== null && _e !== void 0 ? _e : {})), (context.componentConfig.deploy
4943
- ? (_f = context.componentConfig.deploy.runnerVariables) !== null && _f !== void 0 ? _f : {}
4944
- : {})),
4972
+ variables: __assign(__assign(__assign(__assign(__assign({}, context.environment.envVars), (hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {})), context.environment.jobOnlyVars.deploy.envVars), (deployConfig ? (_e = deployConfig.extraVars) !== null && _e !== void 0 ? _e : {} : {})), jobDefinition.variables),
4973
+ runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), ((_f = jobDefinition.runnerVariables) !== null && _f !== void 0 ? _f : {})), (deployConfig ? (_g = deployConfig.runnerVariables) !== null && _g !== void 0 ? _g : {} : {})),
4945
4974
  environment: isStoppable
4946
4975
  ? {
4947
4976
  on_stop: stop_1.STOP_JOB_NAME,
4948
4977
  auto_stop_in: autoStop,
4949
4978
  }
4950
4979
  : undefined,
4951
- jobTags: context.componentConfig.deploy
4952
- ? context.componentConfig.deploy.jobTags
4953
- : undefined,
4980
+ jobTags: deployConfig ? deployConfig.jobTags : undefined,
4954
4981
  };
4955
4982
  };
4956
4983
  exports.createDeployJob = createDeployJob;
@@ -5148,17 +5175,18 @@ var BashExpression_1 = __nccwpck_require__(2376);
5148
5175
  var gitlab_1 = __nccwpck_require__(8490);
5149
5176
  var types_1 = __nccwpck_require__(5781);
5150
5177
  var removeFirstLinesFromCommandOutput_1 = __nccwpck_require__(4398);
5151
- var getArtifactsRegistryHost = function (_a) {
5152
- var deploy = _a.componentConfig.deploy;
5153
- if (!(0, types_1.isOfDeployType)(deploy, "google-cloudrun")) {
5178
+ var getArtifactsRegistryHost = function (context) {
5179
+ var _a;
5180
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "google-cloudrun")) {
5154
5181
  // should not happen
5155
5182
  throw new Error("deploy config is wrong");
5156
5183
  }
5157
- return "".concat(deploy.region, "-docker.pkg.dev");
5184
+ return "".concat(context.deploy.config.region, "-docker.pkg.dev");
5158
5185
  };
5159
5186
  exports.getArtifactsRegistryHost = getArtifactsRegistryHost;
5160
5187
  var getArtifactsRegistryDockerUrl = function (context) {
5161
- var deployConfig = context.componentConfig.deploy;
5188
+ var _a;
5189
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
5162
5190
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
5163
5191
  // should not happen
5164
5192
  throw new Error("deploy config is wrong");
@@ -5221,11 +5249,9 @@ var getDeleteImageCommands = function (fullImageName, keepNewest) {
5221
5249
  * @returns
5222
5250
  */
5223
5251
  var getDeleteUnusedImagesCommands = function (context, keep) {
5252
+ var _a;
5224
5253
  if (keep === void 0) { keep = 0; }
5225
- var deployConfig = context.componentConfig.deploy;
5226
- if (deployConfig === false) {
5227
- return [];
5228
- }
5254
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
5229
5255
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
5230
5256
  // should not happen
5231
5257
  throw new Error("deploy config is wrong");
@@ -5316,8 +5342,9 @@ var createArgsString_1 = __nccwpck_require__(9598);
5316
5342
  var getServiceName_1 = __nccwpck_require__(8128);
5317
5343
  var removeFirstLinesFromCommandOutput_1 = __nccwpck_require__(4398);
5318
5344
  var getListRevisionsCommand = function (context, args) {
5345
+ var _a;
5319
5346
  var serviceName = (0, getServiceName_1.getServiceName)(context);
5320
- var deployConfig = context.componentConfig.deploy;
5347
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
5321
5348
  if (!deployConfig || !(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
5322
5349
  // should not happen
5323
5350
  throw new Error("deploy config is wrong");
@@ -5329,10 +5356,8 @@ var getListRevisionsCommand = function (context, args) {
5329
5356
  return "gcloud run revisions list ".concat((0, createArgsString_1.createArgsString)(filterRevisionArgs));
5330
5357
  };
5331
5358
  var getDeleteUnusedRevisionsCommands = function (context, keep) {
5332
- var deployConfig = context.componentConfig.deploy;
5333
- if (deployConfig === false) {
5334
- return [];
5335
- }
5359
+ var _a;
5360
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
5336
5361
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
5337
5362
  // should not happen
5338
5363
  throw new Error("deploy config is wrong");
@@ -5601,7 +5626,7 @@ var getServiceDeployScript = function (context, service, nameSuffix) {
5601
5626
  var serviceName = (0, getServiceName_1.getServiceName)(context);
5602
5627
  var customConfig = service !== true ? service : undefined;
5603
5628
  var command = service !== true
5604
- ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand
5629
+ ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.build.config.startCommand
5605
5630
  : undefined;
5606
5631
  var commandArray = command
5607
5632
  ? Array.isArray(command)
@@ -5696,7 +5721,8 @@ var makeLabelString = function (obj) {
5696
5721
  };
5697
5722
  exports.makeLabelString = makeLabelString;
5698
5723
  var getCloudRunDeployConfig = function (context) {
5699
- var deployConfig = context.componentConfig.deploy;
5724
+ var _a;
5725
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
5700
5726
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
5701
5727
  // should not happen
5702
5728
  throw new Error("deploy config is wrong");
@@ -5878,10 +5904,8 @@ var constants_1 = __nccwpck_require__(8865);
5878
5904
  var getCloudRunDeployScripts_1 = __nccwpck_require__(3695);
5879
5905
  var getCloudRunStopScripts_1 = __nccwpck_require__(3747);
5880
5906
  var createGoogleCloudRunDeployJobs = function (context) {
5881
- var deployConfig = context.componentConfig.deploy;
5882
- if (deployConfig === false) {
5883
- return [];
5884
- }
5907
+ var _a;
5908
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
5885
5909
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
5886
5910
  // should not happen
5887
5911
  throw new Error("deploy config is wrong");
@@ -6361,29 +6385,28 @@ var base_1 = __nccwpck_require__(2024);
6361
6385
  var sbom_1 = __nccwpck_require__(4986);
6362
6386
  var types_1 = __nccwpck_require__(5781);
6363
6387
  var createCustomDeployJobs = function (context) {
6364
- var _a, _b, _c;
6365
- var deployConfig = context.componentConfig.deploy;
6366
- if (deployConfig === false) {
6367
- return [];
6368
- }
6388
+ var _a, _b, _c, _d;
6389
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
6369
6390
  if (!(0, types_1.isOfDeployType)(deployConfig, "custom")) {
6370
6391
  // should not happen
6371
6392
  throw new Error("deploy config is not custom");
6372
6393
  }
6373
6394
  // FIXME: custom deploy currently assumes yarn-based project
6374
- var yarnInstall = (0, yarn_1.getYarnInstall)(context, { noCustomPostInstall: true });
6395
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build, {
6396
+ noCustomPostInstall: true,
6397
+ });
6375
6398
  return (0, base_1.createDeployementJobs)(context, {
6376
6399
  deploy: {
6377
- image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
6378
- cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
6400
+ image: (_b = deployConfig.jobImage) !== null && _b !== void 0 ? _b : (0, runner_1.getRunnerImage)("jobs-default"),
6401
+ cache: (_c = deployConfig.jobCache) !== null && _c !== void 0 ? _c : [],
6379
6402
  script: __spreadArray(__spreadArray(__spreadArray([
6380
- "cd ".concat(context.componentConfig.dir)
6403
+ "cd ".concat(context.build.dir)
6381
6404
  ], __read((deployConfig.requiresYarnInstall ? yarnInstall : [])), false), __read(deployConfig.script), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false),
6382
6405
  variables: {},
6383
6406
  },
6384
6407
  stop: deployConfig.stopScript
6385
6408
  ? {
6386
- image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
6409
+ image: (_d = deployConfig.jobImage) !== null && _d !== void 0 ? _d : (0, runner_1.getRunnerImage)("jobs-default"),
6387
6410
  script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
6388
6411
  variables: {},
6389
6412
  }
@@ -6460,17 +6483,15 @@ var docker_1 = __nccwpck_require__(9641);
6460
6483
  var base_1 = __nccwpck_require__(2024);
6461
6484
  var types_1 = __nccwpck_require__(5781);
6462
6485
  var createDockerTagDeployJobs = function (context) {
6463
- var deployConfig = context.componentConfig.deploy;
6464
- if (deployConfig === false) {
6465
- return [];
6466
- }
6486
+ var _a;
6487
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
6467
6488
  if (!(0, types_1.isOfDeployType)(deployConfig, "dockerTag")) {
6468
6489
  // should not happen
6469
6490
  throw new Error("deploy config is not dockerTag");
6470
6491
  }
6471
6492
  var tag = deployConfig.tag;
6472
6493
  return (0, base_1.createDeployementJobs)(context, {
6473
- deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)(context)), { script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), [
6494
+ deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)()), { script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), [
6474
6495
  "docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
6475
6496
  "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_IMAGE:".concat(tag),
6476
6497
  "docker push $DOCKER_IMAGE:".concat(tag),
@@ -6582,32 +6603,34 @@ var context_1 = __nccwpck_require__(5875);
6582
6603
  var utils_1 = __nccwpck_require__(2089);
6583
6604
  var types_1 = __nccwpck_require__(5781);
6584
6605
  var hasKubernetesCloudSQL = function (context) {
6585
- var _a, _b;
6586
- if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
6587
- return (_b = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql) === null || _b === void 0 ? void 0 : _b.enabled;
6606
+ var _a, _b, _c;
6607
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
6608
+ if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
6609
+ return (_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.cloudsql) === null || _c === void 0 ? void 0 : _c.enabled;
6588
6610
  }
6589
6611
  return false;
6590
6612
  };
6591
6613
  exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
6592
6614
  var createKubernetesCloudsqlBaseValues = function (context) {
6593
- var _a, _b, _c, _d, _e, _f;
6594
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
6615
+ var _a, _b, _c, _d, _e, _f, _g;
6616
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
6617
+ if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
6595
6618
  throw new Error("cannot get cloud sql config");
6596
6619
  }
6597
- var config = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
6620
+ var config = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.cloudsql;
6598
6621
  if (!config) {
6599
6622
  throw new Error("cannot get cloud sql config");
6600
6623
  }
6601
6624
  var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
6602
6625
  if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
6603
- var instanceConnectionName = "".concat((_b = config.projectId) !== null && _b !== void 0 ? _b : "skynet-164509", ":").concat((_c = config.region) !== null && _c !== void 0 ? _c : "europe-west6", ":").concat((_d = config.instanceId) !== null && _d !== void 0 ? _d : context.environment.envVars.KUBE_NAMESPACE);
6626
+ var instanceConnectionName = "".concat((_c = config.projectId) !== null && _c !== void 0 ? _c : "skynet-164509", ":").concat((_d = config.region) !== null && _d !== void 0 ? _d : "europe-west6", ":").concat((_e = config.instanceId) !== null && _e !== void 0 ? _e : context.environment.envVars.KUBE_NAMESPACE);
6604
6627
  return {
6605
6628
  cloudsql: {
6606
6629
  enabled: config.enabled,
6607
6630
  dbUser: "postgres",
6608
6631
  instanceConnectionName: instanceConnectionName,
6609
6632
  proxyCredentials: proxyCredentials,
6610
- fullDbName: (_e = context.environment.envVars.KUBE_APP_NAME) !== null && _e !== void 0 ? _e : "",
6633
+ fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : "",
6611
6634
  },
6612
6635
  };
6613
6636
  }
@@ -6615,7 +6638,7 @@ var createKubernetesCloudsqlBaseValues = function (context) {
6615
6638
  return {
6616
6639
  cloudsql: {
6617
6640
  enabled: config.enabled,
6618
- dbUser: (_f = config.dbUser) !== null && _f !== void 0 ? _f : "postgres",
6641
+ dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
6619
6642
  instanceConnectionName: config.instanceConnectionName,
6620
6643
  proxyCredentials: proxyCredentials,
6621
6644
  fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.componentName),
@@ -6684,11 +6707,8 @@ var bashYaml_1 = __nccwpck_require__(4660);
6684
6707
  var gitlab_1 = __nccwpck_require__(8490);
6685
6708
  var ALL_VALUES_FILE = "__all_values.yml";
6686
6709
  var createKubernetesDeployJobs = function (context) {
6687
- var _a, _b;
6688
- var deployConfig = context.componentConfig.deploy;
6689
- if (deployConfig === false) {
6690
- return [];
6691
- }
6710
+ var _a, _b, _c;
6711
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
6692
6712
  if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
6693
6713
  // should not happen
6694
6714
  throw new Error("deploy config is not kubernetes");
@@ -6702,7 +6722,7 @@ var createKubernetesDeployJobs = function (context) {
6702
6722
  when: "always",
6703
6723
  },
6704
6724
  }
6705
- : {})), { variables: __assign(__assign({}, context.environment.envVars), { RELEASE_NAME: context.environment.fullName, HELM_EXPERIMENTAL_OCI: "1", KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.componentName), HELM_GITLAB_CHART_NAME: (_a = deployConfig.chartName) !== null && _a !== void 0 ? _a : "/helm-charts/the-panter-chart", HELM_ARGS: __spreadArray(__spreadArray([], __read((deployConfig.debug ? ["--debug"] : [])), false), __read(((_b = deployConfig.additionalHelmArgs) !== null && _b !== void 0 ? _b : [])), false).join(" "), COMPONENT_NAME: context.componentName,
6725
+ : {})), { variables: __assign(__assign({}, context.environment.envVars), { RELEASE_NAME: context.environment.fullName, HELM_EXPERIMENTAL_OCI: "1", KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.componentName), HELM_GITLAB_CHART_NAME: (_b = deployConfig.chartName) !== null && _b !== void 0 ? _b : "/helm-charts/the-panter-chart", HELM_ARGS: __spreadArray(__spreadArray([], __read((deployConfig.debug ? ["--debug"] : [])), false), __read(((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : [])), false).join(" "), COMPONENT_NAME: context.componentName,
6706
6726
  /** @deprecated */
6707
6727
  BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID }) });
6708
6728
  var clusterName = "kube-".concat(context.environment.fullName);
@@ -6868,7 +6888,8 @@ var shouldGoIntoSecrets = function (key, value) {
6868
6888
  * we evalulate the actual values later, but want to store the secrets in kubernetes secrets
6869
6889
  */
6870
6890
  var createKubeEnv = function (context) {
6871
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
6891
+ var _a;
6892
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
6872
6893
  // should not happen
6873
6894
  throw new Error("deploy config is not kubernetes");
6874
6895
  }
@@ -6954,7 +6975,7 @@ var createAppConfig = function (context, application) {
6954
6975
  var _a = application !== null && application !== void 0 ? application : {}, healthRoute = _a.healthRoute, command = _a.command, rest = __rest(_a, ["healthRoute", "command"]);
6955
6976
  return (0, utils_1.mergeWithMergingArrays)({
6956
6977
  host: context.environment.host,
6957
- command: command !== null && command !== void 0 ? command : context.componentConfig.build.startCommand,
6978
+ command: command !== null && command !== void 0 ? command : context.build.config.startCommand,
6958
6979
  livenessProbe: {
6959
6980
  httpGet: {
6960
6981
  path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health",
@@ -6982,9 +7003,9 @@ var removeFalsy = function (record) {
6982
7003
  }));
6983
7004
  };
6984
7005
  var createKubeValues = function (context) {
6985
- var _a, _b;
6986
- var deployConfig = context.componentConfig.deploy;
6987
- if (deployConfig === false) {
7006
+ var _a, _b, _c;
7007
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
7008
+ if (!deployConfig) {
6988
7009
  return [];
6989
7010
  }
6990
7011
  if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
@@ -6994,14 +7015,14 @@ var createKubeValues = function (context) {
6994
7015
  var values = deployConfig.values;
6995
7016
  // we remove the application config because it can be just the value `false` which is a convenience feature, but not supported in the helm chart
6996
7017
  // we only merge the rest of the values in
6997
- var _c = values !== null && values !== void 0 ? values : {}, application = _c.application, jobs = _c.jobs, cronjobs = _c.cronjobs, rest = __rest(_c, ["application", "jobs", "cronjobs"]);
7018
+ var _d = values !== null && values !== void 0 ? values : {}, application = _d.application, jobs = _d.jobs, cronjobs = _d.cronjobs, rest = __rest(_d, ["application", "jobs", "cronjobs"]);
6998
7019
  var env = (0, kubeEnv_1.createKubeEnv)(context);
6999
7020
  var defaultKubeValues = (0, lodash_1.merge)({
7000
7021
  env: env,
7001
7022
  application: createAppConfig(context, application),
7002
7023
  }, (0, cloudSql_1.hasKubernetesCloudSQL)(context)
7003
7024
  ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context)
7004
- : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled)
7025
+ : {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled)
7005
7026
  ? (0, mongodb_1.createMongodbBaseConfig)(context)
7006
7027
  : {});
7007
7028
  var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({ jobs: removeFalsy(jobs), cronjobs: removeFalsy(cronjobs) }, rest)));
@@ -7049,15 +7070,15 @@ var getMongodbReplicasetHost = function (context, index) {
7049
7070
  return getMongodbHost(context, "".concat(fullAppname, "-mongodb-").concat(index, ".").concat(fullAppname, "-mongodb-headless"));
7050
7071
  };
7051
7072
  var createMongodbUrl = function (context, dbName) {
7052
- var _a, _b;
7053
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
7073
+ var _a, _b, _c, _d;
7074
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
7054
7075
  throw new Error("can only createMongodbUrl on supported deploys");
7055
7076
  }
7056
- var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
7077
+ var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
7057
7078
  var queryParams = undefined;
7058
7079
  var hosts = "";
7059
7080
  if ((mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset") {
7060
- hosts = (0, lodash_1.range)(0, (_b = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.replicaCount) !== null && _b !== void 0 ? _b : 2)
7081
+ hosts = (0, lodash_1.range)(0, (_d = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.replicaCount) !== null && _d !== void 0 ? _d : 2)
7061
7082
  .map(function (i) { return getMongodbReplicasetHost(context, i); })
7062
7083
  .join(",");
7063
7084
  queryParams = "replicaSet=rs0&authSource=admin";
@@ -7069,11 +7090,11 @@ var createMongodbUrl = function (context, dbName) {
7069
7090
  return "mongodb://".concat(getCredentialString(context)).concat(hosts, "/").concat(dbName).concat(queryParams ? "?".concat(queryParams) : "");
7070
7091
  };
7071
7092
  var createMongoBackupDefaultConfig = function (context) {
7072
- var _a;
7073
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
7093
+ var _a, _b, _c;
7094
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
7074
7095
  throw new Error("can only create mongodb base config on supported deploys");
7075
7096
  }
7076
- var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
7097
+ var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
7077
7098
  var fullAppName = context.environment.envVars.KUBE_APP_NAME;
7078
7099
  var backupEnabled = ["prod", "stage"].includes(context.environment.envType);
7079
7100
  var hostToBackup;
@@ -7103,11 +7124,11 @@ var createMongoBackupDefaultConfig = function (context) {
7103
7124
  };
7104
7125
  };
7105
7126
  var createMongodbBaseConfig = function (context) {
7106
- var _a, _b;
7107
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
7127
+ var _a, _b, _c, _d;
7128
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
7108
7129
  throw new Error("can only create mongodb base config on supported deploys");
7109
7130
  }
7110
- var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
7131
+ var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
7111
7132
  return {
7112
7133
  mongodb: {
7113
7134
  enabled: true,
@@ -7122,7 +7143,7 @@ var createMongodbBaseConfig = function (context) {
7122
7143
  backup: createMongoBackupDefaultConfig(context),
7123
7144
  },
7124
7145
  env: {
7125
- secret: __assign({ MONGO_URL: createMongodbUrl(context, (_b = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.dbName) !== null && _b !== void 0 ? _b : "app") }, ((mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset"
7146
+ secret: __assign({ MONGO_URL: createMongodbUrl(context, (_d = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.dbName) !== null && _d !== void 0 ? _d : "app") }, ((mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset"
7126
7147
  ? { MONGO_OPLOG_URL: createMongodbUrl(context, "local") } // oplog only works with replicasets
7127
7148
  : {})),
7128
7149
  },
@@ -7178,8 +7199,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
7178
7199
  exports.getDependencyTrackDeleteScript = exports.getDependencyTrackUploadScript = exports.sbomDeactivated = void 0;
7179
7200
  var sbom_1 = __nccwpck_require__(7038);
7180
7201
  var sbomDeactivated = function (context) {
7181
- return context.componentConfig.build.type === "custom" &&
7182
- context.componentConfig.build.sbom === false;
7202
+ return context.build.config.type === "custom" && context.build.config.sbom === false;
7183
7203
  };
7184
7204
  exports.sbomDeactivated = sbomDeactivated;
7185
7205
  var getDependencyTrackUploadScript = function (context) {
@@ -7264,7 +7284,7 @@ var isOfDeployType = function (t) {
7264
7284
  for (var _i = 1; _i < arguments.length; _i++) {
7265
7285
  types[_i - 1] = arguments[_i];
7266
7286
  }
7267
- return t && types.includes(t.type);
7287
+ return t && types.includes(t.type) ? true : false;
7268
7288
  };
7269
7289
  exports.isOfDeployType = isOfDeployType;
7270
7290
  //# sourceMappingURL=index.js.map
@@ -7300,7 +7320,8 @@ var getKubernetesNamespace = function (config, env) {
7300
7320
  };
7301
7321
  exports.getKubernetesNamespace = getKubernetesNamespace;
7302
7322
  var contextIsStoppable = function (context) {
7303
- var deployConfig = context.componentConfig.deploy;
7323
+ var _a;
7324
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
7304
7325
  if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
7305
7326
  return true;
7306
7327
  }
@@ -7636,7 +7657,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
7636
7657
  };
7637
7658
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7638
7659
  exports.createJobsForComponent = void 0;
7639
- var lodash_1 = __nccwpck_require__(3255);
7640
7660
  var build_1 = __nccwpck_require__(7862);
7641
7661
  var context_1 = __nccwpck_require__(5875);
7642
7662
  var deploy_1 = __nccwpck_require__(8483);
@@ -7649,18 +7669,17 @@ var injectDefaultVarsInCustomJobs = function (context, jobs) {
7649
7669
  });
7650
7670
  };
7651
7671
  var getCustomJobs = function (context) {
7652
- if (!context.componentConfig.customJobs) {
7672
+ if (!context.customJobs) {
7653
7673
  return [];
7654
7674
  }
7655
- var rawJobs = (0, lodash_1.isFunction)(context.componentConfig.customJobs)
7656
- ? context.componentConfig.customJobs(context)
7657
- : context.componentConfig.customJobs;
7675
+ var rawJobs = context.customJobs;
7658
7676
  return injectDefaultVarsInCustomJobs(context, rawJobs);
7659
7677
  };
7660
7678
  var createRawJobs = function (context) {
7661
- var buildJobs = build_1.BUILD_TYPES[context.componentConfig.build.type].jobs(context);
7662
- var deployJobs = context.componentConfig.deploy !== false
7663
- ? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context)
7679
+ var _a, _b;
7680
+ var buildJobs = build_1.BUILD_TYPES[context.build.config.type].jobs(context);
7681
+ var deployJobs = ((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config)
7682
+ ? deploy_1.DEPLOY_TYPES[(_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.type].jobs(context)
7664
7683
  : [];
7665
7684
  var customJobs = getCustomJobs(context);
7666
7685
  return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
@@ -7672,7 +7691,7 @@ var createJobsForComponent = function (contextContext) { return __awaiter(void 0
7672
7691
  case 0: return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(contextContext.config, contextContext.componentName)];
7673
7692
  case 1:
7674
7693
  packageManagerInfo = _a.sent();
7675
- return [4 /*yield*/, (0, context_1.createContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
7694
+ return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
7676
7695
  case 2:
7677
7696
  context = _a.sent();
7678
7697
  return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];