@catladder/cli 0.0.0-next-81cdc7a3 → 0.0.0-next-aff40897

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 (51) hide show
  1. package/dist/bundles/catenv/index.js +102 -82
  2. package/dist/bundles/cli/index.js +88 -70
  3. package/dist/cli/src/apps/catenv/printVariables.js +4 -2
  4. package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
  5. package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +1 -1
  6. package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
  7. package/dist/cli/src/apps/catenv/writeEnvDTs.js +1 -1
  8. package/dist/cli/src/apps/catenv/writeEnvDTs.js.map +1 -1
  9. package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +1 -2
  10. package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
  11. package/dist/pipeline/src/build/base/createBuildJobDefinition.d.ts +3 -4
  12. package/dist/pipeline/src/build/base/createBuildJobDefinition.js.map +1 -1
  13. package/dist/pipeline/src/build/base/index.d.ts +1 -2
  14. package/dist/pipeline/src/build/base/index.js.map +1 -1
  15. package/dist/pipeline/src/build/base/writeDotEnv.js +2 -1
  16. package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
  17. package/dist/pipeline/src/build/cache/createJobCache.d.ts +3 -2
  18. package/dist/pipeline/src/build/cache/createJobCache.js +2 -2
  19. package/dist/pipeline/src/build/cache/createJobCache.js.map +1 -1
  20. package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.d.ts +2 -2
  21. package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +4 -7
  22. package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js.map +1 -1
  23. package/dist/pipeline/src/build/docker.d.ts +2 -3
  24. package/dist/pipeline/src/build/docker.js.map +1 -1
  25. package/dist/pipeline/src/build/node/buildJob.d.ts +1 -2
  26. package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
  27. package/dist/pipeline/src/build/types.d.ts +6 -0
  28. package/dist/pipeline/src/build/types.js.map +1 -1
  29. package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +1 -1
  30. package/dist/pipeline/src/deploy/base/deploy.d.ts +1 -1
  31. package/dist/pipeline/src/deploy/base/deploy.js +4 -1
  32. package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
  33. package/dist/pipeline/src/deploy/base/index.d.ts +1 -3
  34. package/dist/pipeline/src/deploy/base/index.js.map +1 -1
  35. package/dist/pipeline/src/deploy/base/rollback.d.ts +1 -1
  36. package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
  37. package/dist/pipeline/src/deploy/base/stop.d.ts +1 -1
  38. package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
  39. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +70 -55
  40. package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
  41. package/dist/pipeline/src/deploy/custom/deployJob.js +6 -4
  42. package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
  43. package/dist/pipeline/src/deploy/types/custom.d.ts +2 -6
  44. package/dist/pipeline/src/deploy/types/index.d.ts +3 -3
  45. package/dist/pipeline/src/types/config.d.ts +6 -4
  46. package/dist/pipeline/src/types/jobDefinition.d.ts +7 -1
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +1 -1
  49. package/src/apps/catenv/printVariables.ts +2 -2
  50. package/src/apps/catenv/writeDotEnvFiles.ts +1 -1
  51. package/src/apps/catenv/writeEnvDTs.ts +1 -1
@@ -40,10 +40,11 @@ exports.printVariables = void 0;
40
40
  const getProjectConfig_1 = __nccwpck_require__(5264);
41
41
  const utils_1 = __nccwpck_require__(4560);
42
42
  const getAllVariablesToPrint = async (config, choice) => {
43
+ var _a;
43
44
  const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
44
45
  if (currentComponent) {
45
46
  // don't print vars if dotenv is enabled
46
- if (config.components[currentComponent].dotEnv) {
47
+ if ((_a = config.components[currentComponent].dotEnv) !== null && _a !== void 0 ? _a : true) {
47
48
  return {};
48
49
  }
49
50
  return await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, currentComponent);
@@ -53,8 +54,9 @@ const getAllVariablesToPrint = async (config, choice) => {
53
54
  // this is not 100% correct, but better than not exporting any vars at all
54
55
  // so we also add prefixed variants
55
56
  return await Object.keys(config.components).reduce(async (acc, componentName) => {
57
+ var _a;
56
58
  // don't print vars if dotenv is enabled
57
- if (config.components[componentName].dotEnv) {
59
+ if ((_a = config.components[componentName].dotEnv) !== null && _a !== void 0 ? _a : true) {
58
60
  return await acc;
59
61
  }
60
62
  const subappvars = await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName);
@@ -141,7 +143,7 @@ const utils_1 = __nccwpck_require__(4560);
141
143
  const writeDotEnvFiles = async (config, choice) => {
142
144
  const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
143
145
  const componentsWithEnabledDotEnvWrite = Object.entries(config.components)
144
- .filter(([, component]) => component === null || component === void 0 ? void 0 : component.dotEnv) // when set to true or "local"
146
+ .filter(([, component]) => { var _a; return (_a = component === null || component === void 0 ? void 0 : component.dotEnv) !== null && _a !== void 0 ? _a : true; }) // when set to true or "local"
145
147
  .map(([componentName]) => componentName);
146
148
  const componentsToActuallyWriteDotEnvNow = currentComponent
147
149
  ? componentsWithEnabledDotEnvWrite.includes(currentComponent)
@@ -181,7 +183,7 @@ const utils_1 = __nccwpck_require__(4560);
181
183
  const writeDTsFiles = async (config, choice) => {
182
184
  const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
183
185
  const componentsWithEnabledEnvDTsWrite = Object.entries(config.components)
184
- .filter(([, component]) => component === null || component === void 0 ? void 0 : component.envDTs)
186
+ .filter(([, component]) => { var _a; return (_a = component === null || component === void 0 ? void 0 : component.envDTs) !== null && _a !== void 0 ? _a : true; })
185
187
  .map(([componentName]) => componentName);
186
188
  const componentsToActuallyWriteEnvDts = currentComponent
187
189
  ? componentsWithEnabledEnvDTsWrite.includes(currentComponent)
@@ -1057,7 +1059,7 @@ const lodash_1 = __nccwpck_require__(3255);
1057
1059
  const __1 = __nccwpck_require__(603);
1058
1060
  const utils_1 = __nccwpck_require__(2497);
1059
1061
  const createBuildJobArtifact_1 = __nccwpck_require__(8774);
1060
- const createJobCache_1 = __nccwpck_require__(4372);
1062
+ const createJobCache_1 = __nccwpck_require__(340);
1061
1063
  const yarn_1 = __nccwpck_require__(5043);
1062
1064
  const constants_1 = __nccwpck_require__(2786);
1063
1065
  const writeBuildInfo_1 = __nccwpck_require__(9578);
@@ -1288,14 +1290,15 @@ EOF`,
1288
1290
  };
1289
1291
  exports.writeDotEnv = writeDotEnv;
1290
1292
  const componentContextNeedsBuildTimeDotEnv = (context) => {
1291
- return context.componentConfig.dotEnv === true; // don't build when set to `local`
1293
+ var _a;
1294
+ return ((_a = context.componentConfig.dotEnv) !== null && _a !== void 0 ? _a : true) === true; // don't build when set to `local`
1292
1295
  };
1293
1296
  exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDotEnv;
1294
1297
  //# sourceMappingURL=writeDotEnv.js.map
1295
1298
 
1296
1299
  /***/ }),
1297
1300
 
1298
- /***/ 4372:
1301
+ /***/ 340:
1299
1302
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
1300
1303
 
1301
1304
  "use strict";
@@ -1351,8 +1354,8 @@ const createJobCacheFromCacheConfigs = (context, caches) => {
1351
1354
  };
1352
1355
  exports.createJobCacheFromCacheConfigs = createJobCacheFromCacheConfigs;
1353
1356
  /** shortcut, used in some build types */
1354
- const createJobCacheFromConfig = (context, buildConfig) => {
1355
- return (0, exports.createJobCacheFromCacheConfigs)(context, (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, buildConfig));
1357
+ const createJobCacheFromConfig = (context, configWithCache) => {
1358
+ return (0, exports.createJobCacheFromCacheConfigs)(context, (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, configWithCache));
1356
1359
  };
1357
1360
  exports.createJobCacheFromConfig = createJobCacheFromConfig;
1358
1361
  //# sourceMappingURL=createJobCache.js.map
@@ -1368,15 +1371,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1368
1371
  exports.getAllCacheConfigsFromConfig = void 0;
1369
1372
  const index_1 = __nccwpck_require__(2497);
1370
1373
  const transformLegacyJobCache_1 = __nccwpck_require__(6673);
1371
- const getAllCacheConfigsFromConfig = (context, buildConfig) => {
1374
+ const getAllCacheConfigsFromConfig = (context, configWithCache) => {
1372
1375
  return [
1373
- ...("jobCache" in buildConfig
1374
- ? (0, transformLegacyJobCache_1.transformLegacyJobCache)(buildConfig.jobCache)
1376
+ ...("jobCache" in configWithCache
1377
+ ? (0, transformLegacyJobCache_1.transformLegacyJobCache)(configWithCache.jobCache)
1375
1378
  : []),
1376
- ...(0, index_1.ensureArray)(buildConfig.cache).map((c) => ({
1377
- ...c,
1378
- context,
1379
- })),
1379
+ ...(0, index_1.ensureArray)(configWithCache.cache),
1380
1380
  ...(context.type === "workspace"
1381
1381
  ? // also add cache configs of the components of that workspace
1382
1382
  context.components.flatMap((componentContext) => {
@@ -1475,7 +1475,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1475
1475
  exports.createCustomTestJobs = void 0;
1476
1476
  const utils_1 = __nccwpck_require__(2497);
1477
1477
  const createArtifactsConfig_1 = __nccwpck_require__(2820);
1478
- const createJobCache_1 = __nccwpck_require__(4372);
1478
+ const createJobCache_1 = __nccwpck_require__(340);
1479
1479
  const types_1 = __nccwpck_require__(4466);
1480
1480
  const RUNNER_CUSTOM_TEST_VARIABLES = {
1481
1481
  KUBERNETES_CPU_REQUEST: "0.45",
@@ -1559,7 +1559,7 @@ const artifactsRegistry_1 = __nccwpck_require__(4963);
1559
1559
  const gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(6320);
1560
1560
  const runner_1 = __nccwpck_require__(4058);
1561
1561
  const gitlab_1 = __nccwpck_require__(8490);
1562
- const createJobCache_1 = __nccwpck_require__(4372);
1562
+ const createJobCache_1 = __nccwpck_require__(340);
1563
1563
  const DOCKER_BUILD_RUNNER_REQUESTS = {
1564
1564
  KUBERNETES_CPU_REQUEST: "0.45",
1565
1565
  KUBERNETES_MEMORY_REQUEST: "1Gi",
@@ -2042,7 +2042,7 @@ const createArtifactsConfig_1 = __nccwpck_require__(2820);
2042
2042
  const cache_1 = __nccwpck_require__(2026);
2043
2043
  const constants_1 = __nccwpck_require__(1765);
2044
2044
  const yarn_1 = __nccwpck_require__(5043);
2045
- const createJobCache_1 = __nccwpck_require__(4372);
2045
+ const createJobCache_1 = __nccwpck_require__(340);
2046
2046
  const createNodeTestJobs = (context) => {
2047
2047
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
2048
2048
  // don't run tests after release
@@ -3254,6 +3254,7 @@ exports.BASE_RETRY = {
3254
3254
 
3255
3255
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3256
3256
  exports.createDeployJob = exports.DEPLOY_JOB_NAME = void 0;
3257
+ const createJobCache_1 = __nccwpck_require__(340);
3257
3258
  const docker_1 = __nccwpck_require__(9641);
3258
3259
  const sbom_1 = __nccwpck_require__(7038);
3259
3260
  const context_1 = __nccwpck_require__(1724);
@@ -3285,7 +3286,9 @@ const createDeployJob = (context, jobDefinition) => {
3285
3286
  name: exports.DEPLOY_JOB_NAME,
3286
3287
  script: jobDefinition.script,
3287
3288
  image: jobDefinition.image,
3288
- cache: jobDefinition.cache,
3289
+ cache: jobDefinition.cache
3290
+ ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, jobDefinition.cache)
3291
+ : undefined,
3289
3292
  artifacts: jobDefinition.artifacts,
3290
3293
  services: jobDefinition.services,
3291
3294
  envMode: "stagePerEnv", // makes it easier to run manual tasks er env
@@ -3683,13 +3686,13 @@ exports.getDeleteUnusedRevisionsCommands = getDeleteUnusedRevisionsCommands;
3683
3686
 
3684
3687
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3685
3688
  exports.getCreateScheduleScripts = exports.getJobCreateScripts = exports.getJobRunScripts = exports.getDeleteJobsScripts = exports.getDeleteSchedulesScripts = void 0;
3686
- const gitlab_1 = __nccwpck_require__(8490);
3687
3689
  const createArgsString_1 = __nccwpck_require__(9598);
3688
3690
  const jobName_1 = __nccwpck_require__(9626);
3689
3691
  const common_1 = __nccwpck_require__(3325);
3690
3692
  const getLabels_1 = __nccwpck_require__(920);
3691
3693
  const volumes_1 = __nccwpck_require__(847);
3692
3694
  const constants_1 = __nccwpck_require__(8865);
3695
+ const utils_1 = __nccwpck_require__(2497);
3693
3696
  const getJobRunScriptForJob = (context, jobName, wait) => {
3694
3697
  const commonArgs = (0, common_1.getCommonCloudRunArgs)(context);
3695
3698
  const commonArgsString = (0, createArgsString_1.createArgsString)(commonArgs);
@@ -3731,76 +3734,90 @@ const getJobRunScripts = (context, when) => {
3731
3734
  ["preStop", "postStop"].includes(when)));
3732
3735
  };
3733
3736
  exports.getJobRunScripts = getJobRunScripts;
3734
- const getJobCreateScripts = (context) => {
3735
- const jobsWithNames = getCloudRunJobsWithNames(context);
3736
- return jobsWithNames
3737
- .map(({ job, jobName }) => getJobCreateScriptsForJob(context, jobName, job))
3738
- .flat();
3739
- };
3740
- exports.getJobCreateScripts = getJobCreateScripts;
3741
- const getJobCreateScriptsForJob = (context, jobName, job) => {
3742
- const commonDeployArgs = (0, common_1.getCommonDeployArgs)(context);
3743
- // due to some oversight from google, jobs create does not yet accept `--add-volume` 🤦
3744
- // lucky, update on the other hand accepts it... so let's just imediatly update it
3745
- // we cannot upsert a job, so we have to create it and catch the error and then update
3746
- const commandArray = Array.isArray(job.command)
3747
- ? job.command
3748
- : job.command.split(" ");
3737
+ const getJobCreateScripts = (context) => getCloudRunJobsWithNames(context).map(({ job: { command, image, cpu, memory = "512Mi", timeout = "10m", parallelism = 1, volumes, }, jobName, }, jobIndex) => {
3738
+ const commandArray = Array.isArray(command)
3739
+ ? command
3740
+ : command.split(" ");
3741
+ const { image: commonImage, project, region, ...deployArgs } = (0, common_1.getCommonDeployArgs)(context);
3749
3742
  const commonDeployArgsString = (0, createArgsString_1.createArgsString)({
3750
- command: '"' + commandArray.join(",") + '"',
3751
- ...commonDeployArgs,
3752
- labels: (0, common_1.makeLabelString)({
3753
- ...(0, getLabels_1.getLabels)(context),
3754
- "cloud-run-job-name": jobName.toString(),
3755
- }),
3756
- image: job.image || commonDeployArgs.image,
3757
- cpu: job === null || job === void 0 ? void 0 : job.cpu,
3758
- memory: job.memory || "512Mi",
3759
- "task-timeout": job.timeout || "10m",
3760
- parallelism: job.parallelism || 1,
3743
+ command: `"${commandArray.join(",")}"`,
3744
+ labels: `"${(0, common_1.makeLabelString)((0, getLabels_1.getLabels)(context))},cloud-run-job-name=$current_job_name"`,
3745
+ image: `"${image !== null && image !== void 0 ? image : commonImage}"`,
3746
+ project,
3747
+ region,
3748
+ cpu,
3749
+ memory,
3750
+ parallelism,
3751
+ "task-timeout": timeout,
3761
3752
  "env-vars-file": constants_1.ENV_VARS_FILENAME,
3762
3753
  "max-retries": 0,
3754
+ ...deployArgs,
3763
3755
  });
3764
- const requiresBeta = (job === null || job === void 0 ? void 0 : job.volumes) && Object.keys(job === null || job === void 0 ? void 0 : job.volumes).length > 0;
3765
- const argsString = `${jobName} ${commonDeployArgsString}`;
3756
+ // due to some oversight from google, jobs create does not yet accept `--add-volume` 🤦
3757
+ // lucky, update on the other hand accepts it... so let's just imediatly update it
3758
+ // we cannot upsert a job, so we have to create it and catch the error and then update
3759
+ const hasVolumes = Object.keys(volumes || {}).length > 0;
3760
+ const needsBeta = hasVolumes ? "beta" : undefined;
3761
+ const volumeArgs = hasVolumes
3762
+ ? (0, createArgsString_1.createArgsString)(...(0, volumes_1.createVolumeConfig)(volumes, "job"))
3763
+ : "";
3766
3764
  return [
3767
- ...(0, gitlab_1.allowFailureInScripts)([`${(0, common_1.gcloudRunCmd)()} jobs create ${argsString}`]),
3768
- `${(0, common_1.gcloudRunCmd)(requiresBeta ? "beta" : undefined)} jobs update ${argsString} ${(0, createArgsString_1.createArgsString)(...(0, volumes_1.createVolumeConfig)(job === null || job === void 0 ? void 0 : job.volumes, "job"))}`,
3769
- ];
3770
- };
3765
+ jobIndex === 0
3766
+ ? `exist_job_names="$(\n ${(0, common_1.gcloudRunCmd)()} jobs list --filter='metadata.name ~ ${context.env}.*${context.name}' --format='value(name)' --limit=999 --project='${project}' --region='${region}'\n)"`
3767
+ : null,
3768
+ `current_job_name="${jobName}"`,
3769
+ 'if grep "$current_job_name" <<<"$exist_job_names" >/dev/null; then',
3770
+ ` ${(0, common_1.gcloudRunCmd)(needsBeta)} jobs update "$current_job_name" ${commonDeployArgsString} ${volumeArgs}`,
3771
+ "else",
3772
+ ` ${(0, common_1.gcloudRunCmd)()} jobs create "$current_job_name" ${commonDeployArgsString}`,
3773
+ "fi",
3774
+ ]
3775
+ .filter(utils_1.notNil)
3776
+ .join("\n");
3777
+ });
3778
+ exports.getJobCreateScripts = getJobCreateScripts;
3771
3779
  const getCreateScheduleScripts = (context) => {
3772
3780
  const jobsWithSchedule = getCloudRunJobsWithSchedule(context);
3773
- const deployConfig = (0, common_1.getCloudRunDeployConfig)(context);
3774
- return jobsWithSchedule
3775
- .map(({ job, jobName, schedulerName }) => {
3776
- var _a;
3781
+ const { region: location, projectId: project } = (0, common_1.getCloudRunDeployConfig)(context);
3782
+ const uriBase = `https://${location}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${project}/jobs`;
3783
+ const gcloudArgs = {
3784
+ project,
3785
+ location,
3786
+ uri: `"$current_job_uri"`,
3787
+ "http-method": "POST",
3788
+ "oauth-service-account-email": `"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"`,
3789
+ };
3790
+ return jobsWithSchedule.map(({ job: { maxRetryAttempts, schedule }, jobName, schedulerName }, jobIndex) => {
3777
3791
  const argsString = (0, createArgsString_1.createArgsString)({
3778
- project: deployConfig.projectId,
3779
- location: deployConfig.region,
3780
- schedule: `"${job.schedule}"`,
3781
- "max-retry-attempts": (_a = job.maxRetryAttempts) !== null && _a !== void 0 ? _a : 0,
3782
- uri: `"https://${deployConfig.region}-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/${deployConfig.projectId}/jobs/${jobName}:run"`,
3783
- "http-method": "POST",
3784
- "oauth-service-account-email": "$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com",
3792
+ ...gcloudArgs,
3793
+ schedule: `"${schedule}"`,
3794
+ "max-retry-attempts": maxRetryAttempts !== null && maxRetryAttempts !== void 0 ? maxRetryAttempts : 0,
3785
3795
  });
3786
- const commonArgs = `http ${schedulerName} ${argsString}`;
3787
3796
  return [
3788
- ...(0, gitlab_1.allowFailureInScripts)([
3789
- `${(0, common_1.gcloudSchedulerCmd)()} jobs create ${commonArgs}`,
3790
- ]),
3791
- `${(0, common_1.gcloudSchedulerCmd)()} jobs update ${commonArgs}`,
3792
- ];
3793
- })
3794
- .flat();
3797
+ jobIndex === 0
3798
+ ? `exist_scheduler_names="$(\n ${(0, common_1.gcloudSchedulerCmd)()} jobs list --filter='httpTarget.uri ~ ${context.env}.*${context.name}' --format='value(name)' --limit=999 --location='${location}' --project='${project}'\n)"`
3799
+ : null,
3800
+ `current_job_uri="${uriBase}/${jobName}:run"`,
3801
+ `current_scheduler_name="${schedulerName}"`,
3802
+ `if grep "$current_scheduler_name" <<<"$exist_scheduler_names" >/dev/null; then`,
3803
+ ` ${(0, common_1.gcloudSchedulerCmd)()} jobs update http "$current_scheduler_name" ${argsString}`,
3804
+ `else`,
3805
+ ` ${(0, common_1.gcloudSchedulerCmd)()} jobs create http "$current_scheduler_name" ${argsString}`,
3806
+ `fi`,
3807
+ ]
3808
+ .filter(utils_1.notNil)
3809
+ .join("\n");
3810
+ });
3795
3811
  };
3796
3812
  exports.getCreateScheduleScripts = getCreateScheduleScripts;
3797
3813
  const getCloudRunJobsWithSchedule = (context) => {
3798
3814
  const jobsWithNames = getCloudRunJobsWithNames(context);
3799
3815
  return jobsWithNames
3800
3816
  .filter((entry) => entry.job.when === "schedule")
3801
- .map(({ job, jobName }) => ({
3817
+ .map(({ job, jobName, jobKey }) => ({
3802
3818
  job,
3803
3819
  jobName,
3820
+ jobKey,
3804
3821
  schedulerName: jobName.concat("-scheduler"),
3805
3822
  }));
3806
3823
  };
@@ -3811,9 +3828,10 @@ const getCloudRunJobsWithNames = (context) => {
3811
3828
  const jobsWithNames = Object.entries((_a = deployConfig.jobs) !== null && _a !== void 0 ? _a : {})
3812
3829
  // filter out disabled jobs
3813
3830
  .filter((entry) => Boolean(entry[1]))
3814
- .map(([name, job]) => ({
3815
- jobName: getFullJobName(name),
3831
+ .map(([jobKey, job]) => ({
3832
+ jobName: getFullJobName(jobKey),
3816
3833
  job,
3834
+ jobKey,
3817
3835
  }));
3818
3836
  return jobsWithNames;
3819
3837
  };
@@ -4414,13 +4432,14 @@ exports.getFullDbName = getFullDbName;
4414
4432
 
4415
4433
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4416
4434
  exports.createCustomDeployJobs = void 0;
4435
+ const getAllCacheConfigsFromConfig_1 = __nccwpck_require__(673);
4417
4436
  const yarn_1 = __nccwpck_require__(5043);
4418
4437
  const runner_1 = __nccwpck_require__(4058);
4419
4438
  const base_1 = __nccwpck_require__(2024);
4420
4439
  const sbom_1 = __nccwpck_require__(4986);
4421
4440
  const types_1 = __nccwpck_require__(5781);
4422
4441
  const createCustomDeployJobs = (context) => {
4423
- var _a, _b, _c, _d;
4442
+ var _a, _b, _c;
4424
4443
  const deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
4425
4444
  if (!(0, types_1.isOfDeployType)(deployConfig, "custom")) {
4426
4445
  // should not happen
@@ -4430,10 +4449,10 @@ const createCustomDeployJobs = (context) => {
4430
4449
  const yarnInstall = (0, yarn_1.getYarnInstall)(context, {
4431
4450
  noCustomPostInstall: true,
4432
4451
  });
4433
- return (0, base_1.createDeployementJobs)(context, {
4452
+ const result = (0, base_1.createDeployementJobs)(context, {
4434
4453
  deploy: {
4435
4454
  image: (_b = deployConfig.jobImage) !== null && _b !== void 0 ? _b : (0, runner_1.getRunnerImage)("jobs-default"),
4436
- cache: (_c = deployConfig.jobCache) !== null && _c !== void 0 ? _c : [],
4455
+ cache: (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, deployConfig),
4437
4456
  script: [
4438
4457
  `cd ${context.build.dir}`,
4439
4458
  ...(deployConfig.requiresYarnInstall ? yarnInstall : []),
@@ -4444,7 +4463,7 @@ const createCustomDeployJobs = (context) => {
4444
4463
  },
4445
4464
  stop: deployConfig.stopScript
4446
4465
  ? {
4447
- image: (_d = deployConfig.jobImage) !== null && _d !== void 0 ? _d : (0, runner_1.getRunnerImage)("jobs-default"),
4466
+ image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
4448
4467
  script: [
4449
4468
  ...deployConfig.stopScript,
4450
4469
  ...(0, sbom_1.getDependencyTrackDeleteScript)(context),
@@ -4453,6 +4472,7 @@ const createCustomDeployJobs = (context) => {
4453
4472
  }
4454
4473
  : undefined,
4455
4474
  });
4475
+ return result;
4456
4476
  };
4457
4477
  exports.createCustomDeployJobs = createCustomDeployJobs;
4458
4478
  //# sourceMappingURL=deployJob.js.map
@@ -42628,7 +42648,7 @@ var Scalar = __nccwpck_require__(9387);
42628
42648
  var YAMLMap = __nccwpck_require__(1030);
42629
42649
  var YAMLSeq = __nccwpck_require__(1936);
42630
42650
  var cst = __nccwpck_require__(8164);
42631
- var lexer = __nccwpck_require__(340);
42651
+ var lexer = __nccwpck_require__(2269);
42632
42652
  var lineCounter = __nccwpck_require__(4211);
42633
42653
  var parser = __nccwpck_require__(4639);
42634
42654
  var publicApi = __nccwpck_require__(3019);
@@ -44121,7 +44141,7 @@ exports.tokenType = tokenType;
44121
44141
 
44122
44142
  /***/ }),
44123
44143
 
44124
- /***/ 340:
44144
+ /***/ 2269:
44125
44145
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
44126
44146
 
44127
44147
  "use strict";
@@ -44908,7 +44928,7 @@ exports.LineCounter = LineCounter;
44908
44928
 
44909
44929
 
44910
44930
  var cst = __nccwpck_require__(8164);
44911
- var lexer = __nccwpck_require__(340);
44931
+ var lexer = __nccwpck_require__(2269);
44912
44932
 
44913
44933
  function includesToken(list, type) {
44914
44934
  for (let i = 0; i < list.length; ++i)