@catladder/pipeline 0.0.0-refactor-docker-c24f8608 → 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 (78) hide show
  1. package/dist/build/base/createAppBuildJob.js +6 -6
  2. package/dist/build/base/writeBuildInfo.js +1 -1
  3. package/dist/build/base/writeDotEnv.js +1 -1
  4. package/dist/build/custom/__tests__/testJob.test.js +11 -14
  5. package/dist/build/custom/buildJob.js +3 -3
  6. package/dist/build/custom/testJob.js +5 -5
  7. package/dist/build/docker.d.ts +2 -6
  8. package/dist/build/docker.js +13 -10
  9. package/dist/build/node/buildJob.js +7 -7
  10. package/dist/build/node/cache.js +1 -1
  11. package/dist/build/node/meteor.js +5 -5
  12. package/dist/build/node/testJob.js +11 -11
  13. package/dist/build/rails/build.js +3 -3
  14. package/dist/build/rails/test.js +4 -4
  15. package/dist/build/sbom.js +2 -2
  16. package/dist/bundles/catladder-gitlab/index.js +181 -162
  17. package/dist/constants.js +1 -1
  18. package/dist/context/getLabels.js +1 -1
  19. package/dist/context/index.js +34 -12
  20. package/dist/deploy/base/deploy.js +9 -8
  21. package/dist/deploy/cloudRun/artifactsRegistry.d.ts +1 -5
  22. package/dist/deploy/cloudRun/artifactsRegistry.js +8 -9
  23. package/dist/deploy/cloudRun/cloudRunRevisions.js +4 -5
  24. package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +1 -1
  25. package/dist/deploy/cloudRun/createJobs/common.d.ts +4 -4
  26. package/dist/deploy/cloudRun/createJobs/common.js +2 -1
  27. package/dist/deploy/cloudRun/createJobs/index.js +2 -4
  28. package/dist/deploy/custom/deployJob.js +7 -10
  29. package/dist/deploy/dockerTag/deployJob.js +3 -5
  30. package/dist/deploy/kubernetes/cloudSql/index.js +11 -9
  31. package/dist/deploy/kubernetes/deployJob.js +4 -7
  32. package/dist/deploy/kubernetes/kubeEnv.js +2 -1
  33. package/dist/deploy/kubernetes/kubeValues.js +10 -10
  34. package/dist/deploy/kubernetes/mongodb.js +11 -11
  35. package/dist/deploy/sbom.js +1 -1
  36. package/dist/deploy/types/index.d.ts +1 -1
  37. package/dist/deploy/types/index.js +1 -1
  38. package/dist/deploy/utils.js +2 -1
  39. package/dist/pipeline/createJobsForComponent.js +5 -5
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/dist/types/config.d.ts +1 -1
  42. package/dist/types/context.d.ts +13 -1
  43. package/package.json +1 -1
  44. package/src/build/base/createAppBuildJob.ts +7 -7
  45. package/src/build/base/writeBuildInfo.ts +1 -1
  46. package/src/build/base/writeDotEnv.ts +1 -1
  47. package/src/build/custom/__tests__/testJob.test.ts +5 -8
  48. package/src/build/custom/buildJob.ts +4 -4
  49. package/src/build/custom/testJob.ts +5 -5
  50. package/src/build/docker.ts +21 -14
  51. package/src/build/node/buildJob.ts +8 -8
  52. package/src/build/node/cache.ts +1 -1
  53. package/src/build/node/meteor.ts +9 -15
  54. package/src/build/node/testJob.ts +14 -14
  55. package/src/build/rails/build.ts +3 -3
  56. package/src/build/rails/test.ts +4 -4
  57. package/src/build/sbom.ts +3 -3
  58. package/src/context/getLabels.ts +1 -1
  59. package/src/context/index.ts +21 -5
  60. package/src/deploy/base/deploy.ts +8 -14
  61. package/src/deploy/cloudRun/artifactsRegistry.ts +5 -10
  62. package/src/deploy/cloudRun/cloudRunRevisions.ts +3 -5
  63. package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +1 -1
  64. package/src/deploy/cloudRun/createJobs/common.ts +5 -5
  65. package/src/deploy/cloudRun/createJobs/index.ts +1 -4
  66. package/src/deploy/custom/deployJob.ts +4 -6
  67. package/src/deploy/dockerTag/deployJob.ts +2 -5
  68. package/src/deploy/kubernetes/cloudSql/index.ts +7 -4
  69. package/src/deploy/kubernetes/deployJob.ts +1 -4
  70. package/src/deploy/kubernetes/kubeEnv.ts +1 -1
  71. package/src/deploy/kubernetes/kubeValues.ts +3 -3
  72. package/src/deploy/kubernetes/mongodb.ts +6 -6
  73. package/src/deploy/sbom.ts +1 -2
  74. package/src/deploy/types/index.ts +2 -2
  75. package/src/deploy/utils.ts +1 -1
  76. package/src/pipeline/createJobsForComponent.ts +6 -10
  77. package/src/types/config.ts +3 -1
  78. package/src/types/context.ts +16 -1
@@ -23266,15 +23266,15 @@ var createAppBuildJob = function (context, _a) {
23266
23266
  image: (0, __1.getRunnerImage)("jobs-default"),
23267
23267
  needs: [],
23268
23268
  cache: [],
23269
- 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 : {}),
23270
- 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 : {}),
23269
+ 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 : {}),
23270
+ 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 : {}),
23271
23271
  script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.componentConfig.dotEnv === true // don't build when set to `local`
23272
- ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
23272
+ ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.build)), false), ["cd ".concat(context.build.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
23273
23273
  artifacts: {
23274
- paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
23274
+ paths: [(0, path_1.join)(context.build.dir, "__build_info.json")],
23275
23275
  reports: {
23276
- 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) {
23277
- return (0, path_1.join)(context.componentConfig.dir, p);
23276
+ 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) {
23277
+ return (0, path_1.join)(context.build.dir, p);
23278
23278
  })
23279
23279
  }
23280
23280
  }
@@ -23433,7 +23433,7 @@ Object.defineProperty(exports, "__esModule", ({
23433
23433
  }));
23434
23434
  exports.writeBuildInfo = void 0;
23435
23435
  var writeBuildInfo = function (context) {
23436
- return ["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")];
23436
+ return ["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")];
23437
23437
  };
23438
23438
  exports.writeBuildInfo = writeBuildInfo;
23439
23439
 
@@ -23492,7 +23492,7 @@ var writeDotEnv = function (context) {
23492
23492
  value = _b[1];
23493
23493
  return "".concat(key, "=").concat(value === null || value === void 0 ? void 0 : value.toString().replaceAll("\n", "\\n"));
23494
23494
  }).join("\n");
23495
- return ["cat <<EOF > ".concat(context.componentConfig.dir, "/.env\n").concat(keyValueString, "\nEOF")];
23495
+ return ["cat <<EOF > ".concat(context.build.dir, "/.env\n").concat(keyValueString, "\nEOF")];
23496
23496
  };
23497
23497
  exports.writeDotEnv = writeDotEnv;
23498
23498
 
@@ -23551,7 +23551,7 @@ var RUNNER_BUILD_VARIABLES = {
23551
23551
  };
23552
23552
  var createCustomBuildJobs = function (context) {
23553
23553
  var _a, _b, _c;
23554
- var buildConfig = context.componentConfig.build;
23554
+ var buildConfig = context.build.config;
23555
23555
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
23556
23556
  throw new Error("deploy config is not custom");
23557
23557
  }
@@ -23563,8 +23563,8 @@ var createCustomBuildJobs = function (context) {
23563
23563
  services: buildConfig.jobServices,
23564
23564
  script: __spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
23565
23565
  artifacts: {
23566
- paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist")], __read((_c = (_b = buildConfig.artifactsPaths) === null || _b === void 0 ? void 0 : _b.map(function (path) {
23567
- return (0, path_1.join)(context.componentConfig.dir, path);
23566
+ paths: __spreadArray([(0, path_1.join)(context.build.dir, "__build_info.json"), (0, path_1.join)(context.build.dir, "dist")], __read((_c = (_b = buildConfig.artifactsPaths) === null || _b === void 0 ? void 0 : _b.map(function (path) {
23567
+ return (0, path_1.join)(context.build.dir, path);
23568
23568
  })) !== null && _c !== void 0 ? _c : []), false),
23569
23569
  expire_in: "1 day"
23570
23570
  }
@@ -23695,13 +23695,13 @@ var createCustomTestJobs = function (context) {
23695
23695
  if (context.trigger === "taggedRelease") {
23696
23696
  return [];
23697
23697
  }
23698
- var buildConfig = context.componentConfig.build;
23698
+ var buildConfig = context.build.config;
23699
23699
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
23700
23700
  throw new Error("deploy config is not custom");
23701
23701
  }
23702
23702
  var base = {
23703
23703
  variables: __assign(__assign({
23704
- APP_PATH: context.componentConfig.dir
23704
+ APP_PATH: context.build.dir
23705
23705
  }, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
23706
23706
  runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
23707
23707
  services: buildConfig.jobServices,
@@ -23717,19 +23717,19 @@ var createCustomTestJobs = function (context) {
23717
23717
  cache: undefined,
23718
23718
  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),
23719
23719
  allow_failure: true
23720
- }), (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;
23720
+ }), (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;
23721
23721
  var lintJob = buildConfig.lint ? __assign(__assign(__assign({
23722
23722
  name: "👮 lint"
23723
23723
  }, base), {
23724
23724
  image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : buildConfig.jobImage,
23725
23725
  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)
23726
- }), (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;
23726
+ }), (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;
23727
23727
  var testJob = buildConfig.test ? __assign(__assign(__assign({
23728
23728
  name: "🧪 test"
23729
23729
  }, base), {
23730
23730
  image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : buildConfig.jobImage,
23731
23731
  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)
23732
- }), (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;
23732
+ }), (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;
23733
23733
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
23734
23734
  };
23735
23735
  exports.createCustomTestJobs = createCustomTestJobs;
@@ -23814,7 +23814,9 @@ var DOCKER_BUILD_RUNNER_REQUESTS = {
23814
23814
  KUBERNETES_MEMORY_LIMIT: "2Gi"
23815
23815
  };
23816
23816
  var getDockerImageVariables = function (context) {
23817
- return __assign(__assign({}, (0, deploy_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ? {
23817
+ var _a;
23818
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
23819
+ return __assign(__assign({}, (0, deploy_1.isOfDeployType)(deployConfig, "google-cloudrun") ? {
23818
23820
  DOCKER_REGISTRY: (0, artifactsRegistry_1.getArtifactsRegistryHost)(context),
23819
23821
  DOCKER_IMAGE: (0, artifactsRegistry_1.getArtifactsRegistryImageName)(context),
23820
23822
  DOCKER_CACHE_IMAGE: (0, artifactsRegistry_1.getArtifactsRegistryBuildCacheImage)(context)
@@ -23834,9 +23836,10 @@ exports.getDockerImageVariables = getDockerImageVariables;
23834
23836
  /**
23835
23837
  * Weather the context requires a docker build
23836
23838
  */
23837
- var requiresDockerBuild = function (_a) {
23838
- var deploy = _a.componentConfig.deploy;
23839
- return (0, deploy_1.isOfDeployType)(deploy, "kubernetes", "google-cloudrun", "dockerTag") || (0, deploy_1.isOfDeployType)(deploy, "custom") && deploy.requiresDocker;
23839
+ var requiresDockerBuild = function (context) {
23840
+ var _a;
23841
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
23842
+ return (0, deploy_1.isOfDeployType)(deployConfig, "kubernetes", "google-cloudrun", "dockerTag") || (0, deploy_1.isOfDeployType)(deployConfig, "custom") && deployConfig.requiresDocker;
23840
23843
  };
23841
23844
  exports.requiresDockerBuild = requiresDockerBuild;
23842
23845
  // those need to be runner variables
@@ -23859,14 +23862,14 @@ var getDockerAdditions = function (build) {
23859
23862
  };
23860
23863
  };
23861
23864
  var getDockerBuildVariables = function (context) {
23862
- return __assign(__assign(__assign({}, getDockerAdditions(context.buildContext.config)), {
23863
- APP_DIR: context.buildContext.dir,
23865
+ return __assign(__assign(__assign({}, getDockerAdditions(context.build.config)), {
23866
+ APP_DIR: context.build.dir,
23864
23867
  DOCKER_DIR: "."
23865
23868
  }), (0, exports.getDockerImageVariables)(context));
23866
23869
  };
23867
23870
  exports.getDockerBuildVariables = getDockerBuildVariables;
23868
23871
  exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
23869
- var getDockerJobBaseProps = function (context) {
23872
+ var getDockerJobBaseProps = function () {
23870
23873
  return {
23871
23874
  image: (0, runner_1.getRunnerImage)("docker-build"),
23872
23875
  services: [{
@@ -23886,7 +23889,7 @@ var createDockerBuildJobBase = function (context, _a) {
23886
23889
  name: exports.DOCKER_BUILD_JOB_NAME,
23887
23890
  envMode: "jobPerEnv",
23888
23891
  stage: "build"
23889
- }, (0, exports.getDockerJobBaseProps)(context)), {
23892
+ }, (0, exports.getDockerJobBaseProps)()), {
23890
23893
  script: script || []
23891
23894
  }), {
23892
23895
  variables: (0, exports.getDockerBuildVariables)(context),
@@ -23895,7 +23898,7 @@ var createDockerBuildJobBase = function (context, _a) {
23895
23898
  };
23896
23899
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
23897
23900
  var gitlabDockerLogin = function (context) {
23898
- return (0, deploy_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ? __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), ["gcloud auth configure-docker ".concat((0, artifactsRegistry_1.getArtifactsRegistryHost)(context))], false) : ["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY"];
23901
+ return context.deploy && (0, deploy_1.isOfDeployType)(context.deploy.config, "google-cloudrun") ? __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), ["gcloud auth configure-docker ".concat((0, artifactsRegistry_1.getArtifactsRegistryHost)(context))], false) : ["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY"];
23899
23902
  };
23900
23903
  exports.gitlabDockerLogin = gitlabDockerLogin;
23901
23904
  var BUILT_IN_ENSURE_DOCKERFILE_SCRIPTS = {
@@ -23916,7 +23919,7 @@ var getDockerBuildDefaultScript = function (context, ensureDockerFileScript) {
23916
23919
  };
23917
23920
  exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
23918
23921
  var hasDockerfile = function (context) {
23919
- return (0, fs_1.existsSync)(path_1.default.join(context.componentConfig.dir, "Dockerfile"));
23922
+ return (0, fs_1.existsSync)(path_1.default.join(context.build.dir, "Dockerfile"));
23920
23923
  };
23921
23924
  exports.hasDockerfile = hasDockerfile;
23922
23925
 
@@ -24064,20 +24067,20 @@ var constants_1 = __nccwpck_require__(4899);
24064
24067
  var yarn_1 = __nccwpck_require__(312);
24065
24068
  var createNodeBuildJobs = function (context) {
24066
24069
  var _a, _b, _c, _d, _e, _f, _g;
24067
- var buildConfig = context.componentConfig.build;
24070
+ var buildConfig = context.build.config;
24068
24071
  if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
24069
24072
  throw new Error("deploy config is not node, node-static or storybook");
24070
24073
  }
24071
24074
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
24072
- var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
24075
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build);
24073
24076
  return (0, base_1.createBuildJobs)(context, {
24074
24077
  appBuild: buildConfig.buildCommand !== null ? {
24075
24078
  image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
24076
24079
  runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
24077
- cache: __spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context.buildContext)), false), __read((0, cache_1.getNextCache)(context)), false),
24080
+ 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),
24078
24081
  script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
24079
24082
  artifacts: {
24080
- paths: __spreadArray([context.componentConfig.dir], __read((_e = (_d = context.buildContext.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : []), false).flatMap(function (dir) {
24083
+ paths: __spreadArray([context.build.dir], __read((_e = (_d = context.build.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : []), false).flatMap(function (dir) {
24081
24084
  var _a, _b;
24082
24085
  return __spreadArray([(0, path_1.join)(dir, "__build_info.json"), (0, path_1.join)(dir, "dist"), (0, path_1.join)(dir, ".next")], __read((_b = (_a = buildConfig.artifactsPaths) === null || _a === void 0 ? void 0 : _a.map(function (path) {
24083
24086
  return (0, path_1.join)(dir, path);
@@ -24090,11 +24093,11 @@ var createNodeBuildJobs = function (context) {
24090
24093
  } : undefined,
24091
24094
  dockerBuild: {
24092
24095
  script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "nginx" : "node"),
24093
- cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context.buildContext, "pull")), false),
24096
+ cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context.build, "pull")), false),
24094
24097
  variables: {
24095
24098
  // only required for non static
24096
- DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.buildContext),
24097
- DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.buildContext.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
24099
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
24100
+ DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.build.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
24098
24101
  return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
24099
24102
  })) === null || _g === void 0 ? void 0 : _g.join("\n")
24100
24103
  }
@@ -24201,7 +24204,7 @@ var getNextCache = function (context) {
24201
24204
  return [{
24202
24205
  key: context.componentName + "-next-cache",
24203
24206
  policy: "pull-push",
24204
- paths: [context.componentConfig.dir + "/.next/cache/"]
24207
+ paths: [context.build.dir + "/.next/cache/"]
24205
24208
  }];
24206
24209
  };
24207
24210
  exports.getNextCache = getNextCache;
@@ -24337,18 +24340,18 @@ var getMeteorCache = function (context) {
24337
24340
  return [{
24338
24341
  key: context.componentName + "meteor-build-cache",
24339
24342
  policy: "pull-push",
24340
- paths: [(0, path_1.join)(context.componentConfig.dir, ".meteor/local/resolver-result-cache.json"), (0, path_1.join)(context.componentConfig.dir, ".meteor/local/plugin-cache"), (0, path_1.join)(context.componentConfig.dir, ".meteor/local/isopacks"), (0, path_1.join)(context.componentConfig.dir, ".meteor/local/bundler-cache/scanner")]
24343
+ paths: [(0, path_1.join)(context.build.dir, ".meteor/local/resolver-result-cache.json"), (0, path_1.join)(context.build.dir, ".meteor/local/plugin-cache"), (0, path_1.join)(context.build.dir, ".meteor/local/isopacks"), (0, path_1.join)(context.build.dir, ".meteor/local/bundler-cache/scanner")]
24341
24344
  }];
24342
24345
  };
24343
24346
  var createMeteorBuildJobs = function (context) {
24344
- var buildConfig = context.componentConfig.build;
24347
+ var buildConfig = context.build.config;
24345
24348
  if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
24346
24349
  throw new Error("deploy config is not meteor");
24347
24350
  }
24348
- var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
24351
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build);
24349
24352
  return (0, base_1.createBuildJobs)(context, {
24350
24353
  appBuild: buildConfig.buildCommand !== null ? {
24351
- cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context.buildContext)), false), __read(getMeteorCache(context)), false),
24354
+ cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context.build)), false), __read(getMeteorCache(context)), false),
24352
24355
  image: (0, runner_1.getRunnerImage)("jobs-meteor"),
24353
24356
  variables: {
24354
24357
  METEOR_DISABLE_OPTIMISTIC_CACHING: "1" // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
@@ -24356,7 +24359,7 @@ var createMeteorBuildJobs = function (context) {
24356
24359
 
24357
24360
  script: __spreadArray(__spreadArray([], __read(yarnInstall), false), ['echo "add healthcheck package"', "meteor add panter:healthroute --allow-superuser", "meteor add qualia:prod-shell --allow-superuser", 'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory', "cp ./__build_info.json ./dist/bundle/programs/server"], false),
24358
24361
  artifacts: {
24359
- paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
24362
+ paths: [context.build.dir + "/__build_info.json", context.build.dir + "/dist"]
24360
24363
  }
24361
24364
  } : undefined,
24362
24365
  dockerBuild: {
@@ -24435,41 +24438,41 @@ var createNodeTestJobs = function (context) {
24435
24438
  if (context.trigger === "taggedRelease") {
24436
24439
  return [];
24437
24440
  }
24438
- var buildConfig = context.componentConfig.build;
24441
+ var buildConfig = context.build.config;
24439
24442
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
24440
24443
  var base = {
24441
24444
  variables: __assign(__assign({
24442
- APP_PATH: context.componentConfig.dir
24445
+ APP_PATH: context.build.dir
24443
24446
  }, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
24444
24447
  runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
24445
24448
  stage: "test",
24446
24449
  needs: [],
24447
24450
  envMode: "none"
24448
24451
  };
24449
- var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
24452
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build);
24450
24453
  var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
24451
24454
  name: "🛡 audit"
24452
24455
  }, base), {
24453
24456
  image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
24454
24457
  cache: undefined,
24455
- script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [((_f = context.buildContext.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
24458
+ script: __spreadArray(["cd ".concat(context.build.dir)], __read((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [((_f = context.build.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
24456
24459
  ]), false),
24457
24460
  allow_failure: true
24458
- }), (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;
24461
+ }), (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;
24459
24462
  var lintJob = buildConfig.lint !== false ? __assign(__assign(__assign({
24460
24463
  name: "👮 lint"
24461
24464
  }, base), {
24462
24465
  image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : defaultImage,
24463
- cache: (0, cache_1.getNodeCache)(context.buildContext),
24464
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), ["cd ".concat(context.componentConfig.dir)], 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)
24465
- }), (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;
24466
+ cache: (0, cache_1.getNodeCache)(context.build),
24467
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), ["cd ".concat(context.build.dir)], 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)
24468
+ }), (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;
24466
24469
  var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
24467
24470
  name: "🧪 test"
24468
24471
  }, base), {
24469
24472
  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"),
24470
- cache: (0, cache_1.getNodeCache)(context.buildContext),
24471
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), ["cd ".concat(context.componentConfig.dir)], 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)
24472
- }), (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;
24473
+ cache: (0, cache_1.getNodeCache)(context.build),
24474
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), ["cd ".concat(context.build.dir)], 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)
24475
+ }), (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;
24473
24476
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
24474
24477
  };
24475
24478
  exports.createNodeTestJobs = createNodeTestJobs;
@@ -24617,7 +24620,7 @@ var docker_1 = __nccwpck_require__(9953);
24617
24620
  var types_1 = __nccwpck_require__(6575);
24618
24621
  var createRailsBuildJobs = function (context) {
24619
24622
  var _a, _b, _c;
24620
- var buildConfig = context.componentConfig.build;
24623
+ var buildConfig = context.build.config;
24621
24624
  if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
24622
24625
  // should not happen
24623
24626
  throw new Error("build type is not rails");
@@ -24641,9 +24644,9 @@ var createRailsBuildJobs = function (context) {
24641
24644
  return (0, base_1.createBuildJobs)(context, {
24642
24645
  appBuild: undefined,
24643
24646
  dockerBuild: {
24644
- variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
24647
+ variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.build.config.extraVars),
24645
24648
  // custom script
24646
- script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["cd ".concat(context.componentConfig.dir), "docker pull $DOCKER_CACHE_IMAGE || true", "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"), "chmod +x /usr/local/bin/pack",
24649
+ script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["cd ".concat(context.build.dir), "docker pull $DOCKER_CACHE_IMAGE || true", "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"), "chmod +x /usr/local/bin/pack",
24647
24650
  // replace private git ssh gem sources with https to make bundler with credentials via env var work
24648
24651
  "sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "pack build \"$DOCKER_IMAGE:$DOCKER_IMAGE_TAG\" --builder '".concat(cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.image, "' --publish --cache-image \"$DOCKER_CACHE_IMAGE\" ").concat(packEnvArgs, " ").concat((_c = (_b = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packExtraArgs) === null || _b === void 0 ? void 0 : _b.join(" ")) !== null && _c !== void 0 ? _c : "")], false)
24649
24652
  }
@@ -24762,7 +24765,7 @@ var createRailsTestJobs = function (context) {
24762
24765
  if (context.trigger === "taggedRelease") {
24763
24766
  return [];
24764
24767
  }
24765
- var buildConfig = context.componentConfig.build;
24768
+ var buildConfig = context.build.config;
24766
24769
  var base = {
24767
24770
  variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
24768
24771
  stage: "test",
@@ -24785,7 +24788,7 @@ var createRailsTestJobs = function (context) {
24785
24788
  }, base), {
24786
24789
  cache: undefined,
24787
24790
  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,
24788
- script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
24791
+ script: __spreadArray(["cd ".concat(context.build.dir)], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
24789
24792
  allow_failure: true
24790
24793
  }) : null;
24791
24794
  var lintJob = buildConfig.lint !== false ? __assign(__assign({
@@ -24793,14 +24796,14 @@ var createRailsTestJobs = function (context) {
24793
24796
  }, base), {
24794
24797
  cache: bundlerCache,
24795
24798
  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,
24796
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __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 : ["bundle exec rubocop"]), false)
24799
+ script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __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 : ["bundle exec rubocop"]), false)
24797
24800
  }) : null;
24798
24801
  var testJob = buildConfig.test !== false ? __assign(__assign({
24799
24802
  name: "🧪 test"
24800
24803
  }, base), {
24801
24804
  cache: bundlerCache,
24802
24805
  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,
24803
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __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 : ["bundle exec rspec"]), false)
24806
+ script: __spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __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 : ["bundle exec rspec"]), false)
24804
24807
  }) : null;
24805
24808
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
24806
24809
  };
@@ -24823,9 +24826,9 @@ exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
24823
24826
  exports.SBOM_FILE = "__sbom.json";
24824
24827
  var createSbomBuildJob = function (context) {
24825
24828
  var _a, _b, _c, _d, _e;
24826
- var buildConfig = context.componentConfig.build;
24829
+ var buildConfig = context.build.config;
24827
24830
  var defaultImage = "aquasec/trivy:0.38.3";
24828
- var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.buildContext.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace) ? "." : context.buildContext.dir)];
24831
+ var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.build.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace) ? "." : context.build.dir)];
24829
24832
  var image = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_c = (_b = buildConfig.sbom) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage : defaultImage;
24830
24833
  var script = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_e = (0, utils_1.ensureArray)((_d = buildConfig.sbom) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : defaultScript : defaultScript;
24831
24834
  return {
@@ -25049,7 +25052,7 @@ Object.defineProperty(exports, "__esModule", ({
25049
25052
  value: true
25050
25053
  }));
25051
25054
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
25052
- exports.PIPELINE_IMAGE_TAG = "refactor-docker-c24f8608" || 0;
25055
+ exports.PIPELINE_IMAGE_TAG = "refactor-docker-45f6e733" || 0;
25053
25056
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
25054
25057
 
25055
25058
  /***/ }),
@@ -25685,7 +25688,7 @@ var getLabels = function (context) {
25685
25688
  "app-name": sanitize(context.fullConfig.appName),
25686
25689
  "env-type": sanitize(context.environment.envType),
25687
25690
  "env-name": sanitize(context.environment.shortName),
25688
- "build-type": sanitize((_a = context.componentConfig.build) === null || _a === void 0 ? void 0 : _a.type)
25691
+ "build-type": sanitize((_a = context.build.config) === null || _a === void 0 ? void 0 : _a.type)
25689
25692
  }, (_c = (_b = context.fullConfig.meta) === null || _b === void 0 ? void 0 : _b.labels) !== null && _c !== void 0 ? _c : {});
25690
25693
  return labels;
25691
25694
  };
@@ -25728,6 +25731,16 @@ exports.getReviewSlug = getReviewSlug;
25728
25731
  "use strict";
25729
25732
 
25730
25733
 
25734
+ var __assign = this && this.__assign || function () {
25735
+ __assign = Object.assign || function (t) {
25736
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
25737
+ s = arguments[i];
25738
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
25739
+ }
25740
+ return t;
25741
+ };
25742
+ return __assign.apply(this, arguments);
25743
+ };
25731
25744
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
25732
25745
  if (k2 === undefined) k2 = k;
25733
25746
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -25866,6 +25879,7 @@ Object.defineProperty(exports, "__esModule", ({
25866
25879
  value: true
25867
25880
  }));
25868
25881
  exports.createContext = exports.createComponentContext = void 0;
25882
+ var lodash_1 = __nccwpck_require__(3255);
25869
25883
  var build_1 = __nccwpck_require__(2004);
25870
25884
  var deploy_1 = __nccwpck_require__(1264);
25871
25885
  var utils_1 = __nccwpck_require__(1815);
@@ -25875,10 +25889,9 @@ __exportStar(__nccwpck_require__(4029), exports);
25875
25889
  __exportStar(__nccwpck_require__(2292), exports);
25876
25890
  var createComponentContext = function (ctx) {
25877
25891
  return __awaiter(void 0, void 0, void 0, function () {
25878
- var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
25879
- var _a;
25880
- return __generator(this, function (_b) {
25881
- switch (_b.label) {
25892
+ var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
25893
+ return __generator(this, function (_a) {
25894
+ switch (_a.label) {
25882
25895
  case 0:
25883
25896
  if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
25884
25897
  throw new Error("componentName may only contain lower case letters, numbers and -");
@@ -25893,19 +25906,31 @@ var createComponentContext = function (ctx) {
25893
25906
  deploy: {}
25894
25907
  };
25895
25908
  componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
25896
- _a = {
25909
+ return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
25910
+ case 1:
25911
+ environment = _a.sent();
25912
+ deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
25913
+ context = {
25897
25914
  fullConfig: ctx.config,
25898
25915
  componentConfig: componentConfig,
25899
- buildContext: {
25900
- dir: componentConfig.dir,
25916
+ build: {
25917
+ dir: dir,
25901
25918
  packageManagerInfo: ctx.packageManagerInfo,
25902
- config: componentConfig.build
25919
+ config: build
25903
25920
  },
25904
- componentName: ctx.componentName
25921
+ deploy: deploy ? {
25922
+ config: deploy
25923
+ } : null,
25924
+ componentName: ctx.componentName,
25925
+ environment: environment,
25926
+ packageManagerInfo: ctx.packageManagerInfo,
25927
+ pipelineType: ctx.pipelineType,
25928
+ trigger: ctx.trigger
25905
25929
  };
25906
- return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
25907
- case 1:
25908
- return [2 /*return*/, (_a.environment = _b.sent(), _a.packageManagerInfo = ctx.packageManagerInfo, _a.pipelineType = ctx.pipelineType, _a.trigger = ctx.trigger, _a)];
25930
+ resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs) ? customJobs(context) : customJobs;
25931
+ return [2 /*return*/, __assign(__assign({}, context), {
25932
+ customJobs: resolvedCustomJobs
25933
+ })];
25909
25934
  }
25910
25935
  });
25911
25936
  });
@@ -26518,15 +26543,16 @@ var stop_1 = __nccwpck_require__(7974);
26518
26543
  var variables_1 = __nccwpck_require__(7119);
26519
26544
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
26520
26545
  var createDeployJob = function (context, jobDefinition) {
26521
- var _a, _b, _c, _d, _e, _f;
26546
+ var _a, _b, _c, _d, _e, _f, _g;
26522
26547
  var hasDocker = (0, docker_1.requiresDockerBuild)(context);
26523
26548
  var isStoppable = (0, utils_1.contextIsStoppable)(context);
26524
26549
  var autoStop = context.environment.envType === "review" ? "1 week" : context.environment.envType === "dev" ? "4 weeks" : undefined;
26550
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
26525
26551
  // if auto or manual is configured explicitly, use that
26526
- var whenDeployDefined = context.componentConfig.deploy && context.componentConfig.deploy.when ? context.componentConfig.deploy.when : undefined;
26552
+ var whenDeployDefined = deployConfig && deployConfig.when ? deployConfig.when : undefined;
26527
26553
  // otherwise auto deploy if env is not prod. If its prod, deploy automatically if stage is disabled
26528
26554
  var whenDeployDefault = context.environment.envType !== "prod" ? "auto" // is not stage, auto deploy
26529
- : ((_a = context.componentConfig.env) === null || _a === void 0 ? void 0 : _a.stage) === false ? "auto" // is prod, but no staging, auto deploy
26555
+ : ((_b = context.componentConfig.env) === null || _b === void 0 ? void 0 : _b.stage) === false ? "auto" // is prod, but no staging, auto deploy
26530
26556
  : "manual"; // manually deploy
26531
26557
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
26532
26558
  return {
@@ -26541,13 +26567,13 @@ var createDeployJob = function (context, jobDefinition) {
26541
26567
  needs: __spreadArray(__spreadArray([], __read((0, sbom_2.sbomDeactivated)(context) ? [] : [{
26542
26568
  job: sbom_1.SBOM_BUILD_JOB_NAME,
26543
26569
  artifacts: true
26544
- }]), false), __read(context.componentConfig.deploy ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) {
26570
+ }]), false), __read(deployConfig ? (_d = (_c = deployConfig.waitFor) === null || _c === void 0 ? void 0 : _c.map(function (c) {
26545
26571
  return {
26546
26572
  componentName: c,
26547
26573
  job: exports.DEPLOY_JOB_NAME,
26548
26574
  artifacts: false
26549
26575
  };
26550
- })) !== null && _c !== void 0 ? _c : [] : []), false),
26576
+ })) !== null && _d !== void 0 ? _d : [] : []), false),
26551
26577
  // we don't want to deploy when there is a broken test
26552
26578
  needsStages: [{
26553
26579
  stage: "build",
@@ -26560,13 +26586,13 @@ var createDeployJob = function (context, jobDefinition) {
26560
26586
  when: whenDeploy === "auto" ? "on_success" : "manual",
26561
26587
  allow_failure: whenDeploy === "manual" ? true : false,
26562
26588
  stage: "deploy",
26563
- variables: __assign(__assign(__assign(__assign(__assign({}, context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.environment.jobOnlyVars.deploy.envVars), context.componentConfig.deploy ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {} : {}), jobDefinition.variables),
26564
- runnerVariables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), (_e = jobDefinition.runnerVariables) !== null && _e !== void 0 ? _e : {}), context.componentConfig.deploy ? (_f = context.componentConfig.deploy.runnerVariables) !== null && _f !== void 0 ? _f : {} : {}),
26589
+ 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),
26590
+ 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 : {} : {}),
26565
26591
  environment: isStoppable ? {
26566
26592
  on_stop: stop_1.STOP_JOB_NAME,
26567
26593
  auto_stop_in: autoStop
26568
26594
  } : undefined,
26569
- jobTags: context.componentConfig.deploy ? context.componentConfig.deploy.jobTags : undefined
26595
+ jobTags: deployConfig ? deployConfig.jobTags : undefined
26570
26596
  };
26571
26597
  };
26572
26598
  exports.createDeployJob = createDeployJob;
@@ -26788,17 +26814,18 @@ var BashExpression_1 = __nccwpck_require__(5879);
26788
26814
  var gitlab_1 = __nccwpck_require__(9818);
26789
26815
  var types_1 = __nccwpck_require__(4436);
26790
26816
  var removeFirstLinesFromCommandOutput_1 = __nccwpck_require__(8981);
26791
- var getArtifactsRegistryHost = function (_a) {
26792
- var deploy = _a.componentConfig.deploy;
26793
- if (!(0, types_1.isOfDeployType)(deploy, "google-cloudrun")) {
26817
+ var getArtifactsRegistryHost = function (context) {
26818
+ var _a;
26819
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "google-cloudrun")) {
26794
26820
  // should not happen
26795
26821
  throw new Error("deploy config is wrong");
26796
26822
  }
26797
- return "".concat(deploy.region, "-docker.pkg.dev");
26823
+ return "".concat(context.deploy.config.region, "-docker.pkg.dev");
26798
26824
  };
26799
26825
  exports.getArtifactsRegistryHost = getArtifactsRegistryHost;
26800
26826
  var getArtifactsRegistryDockerUrl = function (context) {
26801
- var deployConfig = context.componentConfig.deploy;
26827
+ var _a;
26828
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
26802
26829
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
26803
26830
  // should not happen
26804
26831
  throw new Error("deploy config is wrong");
@@ -26857,13 +26884,11 @@ var getDeleteImageCommands = function (fullImageName, keepNewest) {
26857
26884
  * @returns
26858
26885
  */
26859
26886
  var getDeleteUnusedImagesCommands = function (context, keep) {
26887
+ var _a;
26860
26888
  if (keep === void 0) {
26861
26889
  keep = 0;
26862
26890
  }
26863
- var deployConfig = context.componentConfig.deploy;
26864
- if (deployConfig === false) {
26865
- return [];
26866
- }
26891
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
26867
26892
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
26868
26893
  // should not happen
26869
26894
  throw new Error("deploy config is wrong");
@@ -26961,8 +26986,9 @@ var createArgsString_1 = __nccwpck_require__(947);
26961
26986
  var getServiceName_1 = __nccwpck_require__(5044);
26962
26987
  var removeFirstLinesFromCommandOutput_1 = __nccwpck_require__(8981);
26963
26988
  var getListRevisionsCommand = function (context, args) {
26989
+ var _a;
26964
26990
  var serviceName = (0, getServiceName_1.getServiceName)(context);
26965
- var deployConfig = context.componentConfig.deploy;
26991
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
26966
26992
  if (!deployConfig || !(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
26967
26993
  // should not happen
26968
26994
  throw new Error("deploy config is wrong");
@@ -26979,10 +27005,8 @@ var getListRevisionsCommand = function (context, args) {
26979
27005
  return "gcloud run revisions list ".concat((0, createArgsString_1.createArgsString)(filterRevisionArgs));
26980
27006
  };
26981
27007
  var getDeleteUnusedRevisionsCommands = function (context, keep) {
26982
- var deployConfig = context.componentConfig.deploy;
26983
- if (deployConfig === false) {
26984
- return [];
26985
- }
27008
+ var _a;
27009
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
26986
27010
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
26987
27011
  // should not happen
26988
27012
  throw new Error("deploy config is wrong");
@@ -27262,7 +27286,7 @@ var getServiceDeployScript = function (context, service, nameSuffix) {
27262
27286
  var commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
27263
27287
  var serviceName = (0, getServiceName_1.getServiceName)(context);
27264
27288
  var customConfig = service !== true ? service : undefined;
27265
- var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
27289
+ var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.build.config.startCommand : undefined;
27266
27290
  var commandArray = command ? Array.isArray(command) ? command : command.split(" ") : undefined;
27267
27291
  var fullServiceName = serviceName.concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "");
27268
27292
  var argsString = createArgsString_1.createArgsString.apply(void 0, __spreadArray([__assign(__assign({
@@ -27369,7 +27393,8 @@ var makeLabelString = function (obj) {
27369
27393
  };
27370
27394
  exports.makeLabelString = makeLabelString;
27371
27395
  var getCloudRunDeployConfig = function (context) {
27372
- var deployConfig = context.componentConfig.deploy;
27396
+ var _a;
27397
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
27373
27398
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
27374
27399
  // should not happen
27375
27400
  throw new Error("deploy config is wrong");
@@ -27570,10 +27595,8 @@ var constants_1 = __nccwpck_require__(4620);
27570
27595
  var getCloudRunDeployScripts_1 = __nccwpck_require__(585);
27571
27596
  var getCloudRunStopScripts_1 = __nccwpck_require__(6857);
27572
27597
  var createGoogleCloudRunDeployJobs = function (context) {
27573
- var deployConfig = context.componentConfig.deploy;
27574
- if (deployConfig === false) {
27575
- return [];
27576
- }
27598
+ var _a;
27599
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
27577
27600
  if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
27578
27601
  // should not happen
27579
27602
  throw new Error("deploy config is wrong");
@@ -28109,28 +28132,25 @@ var base_1 = __nccwpck_require__(5837);
28109
28132
  var sbom_1 = __nccwpck_require__(1634);
28110
28133
  var types_1 = __nccwpck_require__(4436);
28111
28134
  var createCustomDeployJobs = function (context) {
28112
- var _a, _b, _c;
28113
- var deployConfig = context.componentConfig.deploy;
28114
- if (deployConfig === false) {
28115
- return [];
28116
- }
28135
+ var _a, _b, _c, _d;
28136
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
28117
28137
  if (!(0, types_1.isOfDeployType)(deployConfig, "custom")) {
28118
28138
  // should not happen
28119
28139
  throw new Error("deploy config is not custom");
28120
28140
  }
28121
28141
  // FIXME: custom deploy currently assumes yarn-based project
28122
- var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext, {
28142
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.build, {
28123
28143
  noCustomPostInstall: true
28124
28144
  });
28125
28145
  return (0, base_1.createDeployementJobs)(context, {
28126
28146
  deploy: {
28127
- image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
28128
- cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
28129
- script: __spreadArray(__spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(deployConfig.requiresYarnInstall ? yarnInstall : []), false), __read(deployConfig.script), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false),
28147
+ image: (_b = deployConfig.jobImage) !== null && _b !== void 0 ? _b : (0, runner_1.getRunnerImage)("jobs-default"),
28148
+ cache: (_c = deployConfig.jobCache) !== null && _c !== void 0 ? _c : [],
28149
+ script: __spreadArray(__spreadArray(__spreadArray(["cd ".concat(context.build.dir)], __read(deployConfig.requiresYarnInstall ? yarnInstall : []), false), __read(deployConfig.script), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false),
28130
28150
  variables: {}
28131
28151
  },
28132
28152
  stop: deployConfig.stopScript ? {
28133
- image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
28153
+ image: (_d = deployConfig.jobImage) !== null && _d !== void 0 ? _d : (0, runner_1.getRunnerImage)("jobs-default"),
28134
28154
  script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
28135
28155
  variables: {}
28136
28156
  } : undefined
@@ -28221,17 +28241,15 @@ var docker_1 = __nccwpck_require__(9953);
28221
28241
  var base_1 = __nccwpck_require__(5837);
28222
28242
  var types_1 = __nccwpck_require__(4436);
28223
28243
  var createDockerTagDeployJobs = function (context) {
28224
- var deployConfig = context.componentConfig.deploy;
28225
- if (deployConfig === false) {
28226
- return [];
28227
- }
28244
+ var _a;
28245
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
28228
28246
  if (!(0, types_1.isOfDeployType)(deployConfig, "dockerTag")) {
28229
28247
  // should not happen
28230
28248
  throw new Error("deploy config is not dockerTag");
28231
28249
  }
28232
28250
  var tag = deployConfig.tag;
28233
28251
  return (0, base_1.createDeployementJobs)(context, {
28234
- deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)(context)), {
28252
+ deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)()), {
28235
28253
  script: __spreadArray(__spreadArray([], __read((0, docker_1.gitlabDockerLogin)(context)), false), ["docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_IMAGE:".concat(tag), "docker push $DOCKER_IMAGE:".concat(tag), "echo \"pushed as $DOCKER_IMAGE:".concat(tag, "\"")], false)
28236
28254
  })
28237
28255
  });
@@ -28363,39 +28381,41 @@ var context_1 = __nccwpck_require__(7123);
28363
28381
  var utils_1 = __nccwpck_require__(4335);
28364
28382
  var types_1 = __nccwpck_require__(4436);
28365
28383
  var hasKubernetesCloudSQL = function (context) {
28366
- var _a, _b;
28367
- if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
28368
- return (_b = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql) === null || _b === void 0 ? void 0 : _b.enabled;
28384
+ var _a, _b, _c;
28385
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
28386
+ if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
28387
+ return (_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.cloudsql) === null || _c === void 0 ? void 0 : _c.enabled;
28369
28388
  }
28370
28389
  return false;
28371
28390
  };
28372
28391
  exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
28373
28392
  var createKubernetesCloudsqlBaseValues = function (context) {
28374
- var _a, _b, _c, _d, _e, _f;
28375
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
28393
+ var _a, _b, _c, _d, _e, _f, _g;
28394
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
28395
+ if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
28376
28396
  throw new Error("cannot get cloud sql config");
28377
28397
  }
28378
- var config = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
28398
+ var config = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.cloudsql;
28379
28399
  if (!config) {
28380
28400
  throw new Error("cannot get cloud sql config");
28381
28401
  }
28382
28402
  var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
28383
28403
  if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
28384
- 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);
28404
+ 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);
28385
28405
  return {
28386
28406
  cloudsql: {
28387
28407
  enabled: config.enabled,
28388
28408
  dbUser: "postgres",
28389
28409
  instanceConnectionName: instanceConnectionName,
28390
28410
  proxyCredentials: proxyCredentials,
28391
- fullDbName: (_e = context.environment.envVars.KUBE_APP_NAME) !== null && _e !== void 0 ? _e : ""
28411
+ fullDbName: (_f = context.environment.envVars.KUBE_APP_NAME) !== null && _f !== void 0 ? _f : ""
28392
28412
  }
28393
28413
  };
28394
28414
  } else if (config.type === "unmanaged") {
28395
28415
  return {
28396
28416
  cloudsql: {
28397
28417
  enabled: config.enabled,
28398
- dbUser: (_f = config.dbUser) !== null && _f !== void 0 ? _f : "postgres",
28418
+ dbUser: (_g = config.dbUser) !== null && _g !== void 0 ? _g : "postgres",
28399
28419
  instanceConnectionName: config.instanceConnectionName,
28400
28420
  proxyCredentials: proxyCredentials,
28401
28421
  fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.componentName)
@@ -28470,11 +28490,8 @@ var bashYaml_1 = __nccwpck_require__(2325);
28470
28490
  var gitlab_1 = __nccwpck_require__(9818);
28471
28491
  var ALL_VALUES_FILE = "__all_values.yml";
28472
28492
  var createKubernetesDeployJobs = function (context) {
28473
- var _a, _b;
28474
- var deployConfig = context.componentConfig.deploy;
28475
- if (deployConfig === false) {
28476
- return [];
28477
- }
28493
+ var _a, _b, _c;
28494
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
28478
28495
  if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
28479
28496
  // should not happen
28480
28497
  throw new Error("deploy config is not kubernetes");
@@ -28493,8 +28510,8 @@ var createKubernetesDeployJobs = function (context) {
28493
28510
  RELEASE_NAME: context.environment.fullName,
28494
28511
  HELM_EXPERIMENTAL_OCI: "1",
28495
28512
  KUBE_DOCKER_IMAGE_PULL_SECRET: "gitlab-registry-".concat(context.componentName),
28496
- HELM_GITLAB_CHART_NAME: (_a = deployConfig.chartName) !== null && _a !== void 0 ? _a : "/helm-charts/the-panter-chart",
28497
- HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_b = deployConfig.additionalHelmArgs) !== null && _b !== void 0 ? _b : []), false).join(" "),
28513
+ HELM_GITLAB_CHART_NAME: (_b = deployConfig.chartName) !== null && _b !== void 0 ? _b : "/helm-charts/the-panter-chart",
28514
+ HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_c = deployConfig.additionalHelmArgs) !== null && _c !== void 0 ? _c : []), false).join(" "),
28498
28515
  COMPONENT_NAME: context.componentName,
28499
28516
  /** @deprecated */
28500
28517
  BUILD_ID: context.environment.envVars.BUILD_INFO_BUILD_ID
@@ -28678,7 +28695,8 @@ var shouldGoIntoSecrets = function (key, value) {
28678
28695
  * we evalulate the actual values later, but want to store the secrets in kubernetes secrets
28679
28696
  */
28680
28697
  var createKubeEnv = function (context) {
28681
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
28698
+ var _a;
28699
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
28682
28700
  // should not happen
28683
28701
  throw new Error("deploy config is not kubernetes");
28684
28702
  }
@@ -28773,7 +28791,7 @@ var createAppConfig = function (context, application) {
28773
28791
  rest = __rest(_a, ["healthRoute", "command"]);
28774
28792
  return (0, utils_1.mergeWithMergingArrays)({
28775
28793
  host: context.environment.host,
28776
- command: command !== null && command !== void 0 ? command : context.componentConfig.build.startCommand,
28794
+ command: command !== null && command !== void 0 ? command : context.build.config.startCommand,
28777
28795
  livenessProbe: {
28778
28796
  httpGet: {
28779
28797
  path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
@@ -28802,9 +28820,9 @@ var removeFalsy = function (record) {
28802
28820
  }));
28803
28821
  };
28804
28822
  var createKubeValues = function (context) {
28805
- var _a, _b;
28806
- var deployConfig = context.componentConfig.deploy;
28807
- if (deployConfig === false) {
28823
+ var _a, _b, _c;
28824
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
28825
+ if (!deployConfig) {
28808
28826
  return [];
28809
28827
  }
28810
28828
  if (!(0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
@@ -28814,16 +28832,16 @@ var createKubeValues = function (context) {
28814
28832
  var values = deployConfig.values;
28815
28833
  // 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
28816
28834
  // we only merge the rest of the values in
28817
- var _c = values !== null && values !== void 0 ? values : {},
28818
- application = _c.application,
28819
- jobs = _c.jobs,
28820
- cronjobs = _c.cronjobs,
28821
- rest = __rest(_c, ["application", "jobs", "cronjobs"]);
28835
+ var _d = values !== null && values !== void 0 ? values : {},
28836
+ application = _d.application,
28837
+ jobs = _d.jobs,
28838
+ cronjobs = _d.cronjobs,
28839
+ rest = __rest(_d, ["application", "jobs", "cronjobs"]);
28822
28840
  var env = (0, kubeEnv_1.createKubeEnv)(context);
28823
28841
  var defaultKubeValues = (0, lodash_1.merge)({
28824
28842
  env: env,
28825
28843
  application: createAppConfig(context, application)
28826
- }, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
28844
+ }, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
28827
28845
  var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
28828
28846
  jobs: removeFalsy(jobs),
28829
28847
  cronjobs: removeFalsy(cronjobs)
@@ -28873,15 +28891,15 @@ var getMongodbReplicasetHost = function (context, index) {
28873
28891
  return getMongodbHost(context, "".concat(fullAppname, "-mongodb-").concat(index, ".").concat(fullAppname, "-mongodb-headless"));
28874
28892
  };
28875
28893
  var createMongodbUrl = function (context, dbName) {
28876
- var _a, _b;
28877
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
28894
+ var _a, _b, _c, _d;
28895
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
28878
28896
  throw new Error("can only createMongodbUrl on supported deploys");
28879
28897
  }
28880
- var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
28898
+ var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
28881
28899
  var queryParams = undefined;
28882
28900
  var hosts = "";
28883
28901
  if ((mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset") {
28884
- hosts = (0, lodash_1.range)(0, (_b = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.replicaCount) !== null && _b !== void 0 ? _b : 2).map(function (i) {
28902
+ hosts = (0, lodash_1.range)(0, (_d = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.replicaCount) !== null && _d !== void 0 ? _d : 2).map(function (i) {
28885
28903
  return getMongodbReplicasetHost(context, i);
28886
28904
  }).join(",");
28887
28905
  queryParams = "replicaSet=rs0&authSource=admin";
@@ -28892,11 +28910,11 @@ var createMongodbUrl = function (context, dbName) {
28892
28910
  return "mongodb://".concat(getCredentialString(context)).concat(hosts, "/").concat(dbName).concat(queryParams ? "?".concat(queryParams) : "");
28893
28911
  };
28894
28912
  var createMongoBackupDefaultConfig = function (context) {
28895
- var _a;
28896
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
28913
+ var _a, _b, _c;
28914
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
28897
28915
  throw new Error("can only create mongodb base config on supported deploys");
28898
28916
  }
28899
- var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
28917
+ var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
28900
28918
  var fullAppName = context.environment.envVars.KUBE_APP_NAME;
28901
28919
  var backupEnabled = ["prod", "stage"].includes(context.environment.envType);
28902
28920
  var hostToBackup;
@@ -28921,11 +28939,11 @@ var createMongoBackupDefaultConfig = function (context) {
28921
28939
  };
28922
28940
  };
28923
28941
  var createMongodbBaseConfig = function (context) {
28924
- var _a, _b;
28925
- if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
28942
+ var _a, _b, _c, _d;
28943
+ if (!(0, types_1.isOfDeployType)((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config, "kubernetes")) {
28926
28944
  throw new Error("can only create mongodb base config on supported deploys");
28927
28945
  }
28928
- var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
28946
+ var mongodbConfig = (_c = (_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.values) === null || _c === void 0 ? void 0 : _c.mongodb;
28929
28947
  return {
28930
28948
  mongodb: {
28931
28949
  enabled: true,
@@ -28941,7 +28959,7 @@ var createMongodbBaseConfig = function (context) {
28941
28959
  },
28942
28960
  env: {
28943
28961
  secret: __assign({
28944
- MONGO_URL: createMongodbUrl(context, (_b = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.dbName) !== null && _b !== void 0 ? _b : "app")
28962
+ MONGO_URL: createMongodbUrl(context, (_d = mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.dbName) !== null && _d !== void 0 ? _d : "app")
28945
28963
  }, (mongodbConfig === null || mongodbConfig === void 0 ? void 0 : mongodbConfig.architecture) === "replicaset" ? {
28946
28964
  MONGO_OPLOG_URL: createMongodbUrl(context, "local")
28947
28965
  } // oplog only works with replicasets
@@ -29005,7 +29023,7 @@ Object.defineProperty(exports, "__esModule", ({
29005
29023
  exports.getDependencyTrackDeleteScript = exports.getDependencyTrackUploadScript = exports.sbomDeactivated = void 0;
29006
29024
  var sbom_1 = __nccwpck_require__(1433);
29007
29025
  var sbomDeactivated = function (context) {
29008
- return context.componentConfig.build.type === "custom" && context.componentConfig.build.sbom === false;
29026
+ return context.build.config.type === "custom" && context.build.config.sbom === false;
29009
29027
  };
29010
29028
  exports.sbomDeactivated = sbomDeactivated;
29011
29029
  var getDependencyTrackUploadScript = function (context) {
@@ -29093,7 +29111,7 @@ var isOfDeployType = function (t) {
29093
29111
  for (var _i = 1; _i < arguments.length; _i++) {
29094
29112
  types[_i - 1] = arguments[_i];
29095
29113
  }
29096
- return t && types.includes(t.type);
29114
+ return t && types.includes(t.type) ? true : false;
29097
29115
  };
29098
29116
  exports.isOfDeployType = isOfDeployType;
29099
29117
 
@@ -29133,7 +29151,8 @@ var getKubernetesNamespace = function (config, env) {
29133
29151
  };
29134
29152
  exports.getKubernetesNamespace = getKubernetesNamespace;
29135
29153
  var contextIsStoppable = function (context) {
29136
- var deployConfig = context.componentConfig.deploy;
29154
+ var _a;
29155
+ var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
29137
29156
  if ((0, types_1.isOfDeployType)(deployConfig, "kubernetes")) {
29138
29157
  return true;
29139
29158
  }
@@ -29735,7 +29754,6 @@ Object.defineProperty(exports, "__esModule", ({
29735
29754
  value: true
29736
29755
  }));
29737
29756
  exports.createJobsForComponent = void 0;
29738
- var lodash_1 = __nccwpck_require__(3255);
29739
29757
  var build_1 = __nccwpck_require__(2004);
29740
29758
  var context_1 = __nccwpck_require__(7123);
29741
29759
  var deploy_1 = __nccwpck_require__(1264);
@@ -29751,15 +29769,16 @@ var injectDefaultVarsInCustomJobs = function (context, jobs) {
29751
29769
  });
29752
29770
  };
29753
29771
  var getCustomJobs = function (context) {
29754
- if (!context.componentConfig.customJobs) {
29772
+ if (!context.customJobs) {
29755
29773
  return [];
29756
29774
  }
29757
- var rawJobs = (0, lodash_1.isFunction)(context.componentConfig.customJobs) ? context.componentConfig.customJobs(context) : context.componentConfig.customJobs;
29775
+ var rawJobs = context.customJobs;
29758
29776
  return injectDefaultVarsInCustomJobs(context, rawJobs);
29759
29777
  };
29760
29778
  var createRawJobs = function (context) {
29761
- var buildJobs = build_1.BUILD_TYPES[context.componentConfig.build.type].jobs(context);
29762
- var deployJobs = context.componentConfig.deploy !== false ? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context) : [];
29779
+ var _a, _b;
29780
+ var buildJobs = build_1.BUILD_TYPES[context.build.config.type].jobs(context);
29781
+ var deployJobs = ((_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config) ? deploy_1.DEPLOY_TYPES[(_b = context.deploy) === null || _b === void 0 ? void 0 : _b.config.type].jobs(context) : [];
29763
29782
  var customJobs = getCustomJobs(context);
29764
29783
  return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
29765
29784
  };