@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.
- package/dist/bundles/catenv/index.js +102 -82
- package/dist/bundles/cli/index.js +88 -70
- package/dist/cli/src/apps/catenv/printVariables.js +4 -2
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js.map +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +1 -2
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/createBuildJobDefinition.d.ts +3 -4
- package/dist/pipeline/src/build/base/createBuildJobDefinition.js.map +1 -1
- package/dist/pipeline/src/build/base/index.d.ts +1 -2
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +2 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/cache/createJobCache.d.ts +3 -2
- package/dist/pipeline/src/build/cache/createJobCache.js +2 -2
- package/dist/pipeline/src/build/cache/createJobCache.js.map +1 -1
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.d.ts +2 -2
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +4 -7
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +2 -3
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.d.ts +1 -2
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +6 -0
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/deploy.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +4 -1
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/base/index.d.ts +1 -3
- package/dist/pipeline/src/deploy/base/index.js.map +1 -1
- package/dist/pipeline/src/deploy/base/rollback.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
- package/dist/pipeline/src/deploy/base/stop.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +70 -55
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/deployJob.js +6 -4
- package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/types/custom.d.ts +2 -6
- package/dist/pipeline/src/deploy/types/index.d.ts +3 -3
- package/dist/pipeline/src/types/config.d.ts +6 -4
- package/dist/pipeline/src/types/jobDefinition.d.ts +7 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/catenv/printVariables.ts +2 -2
- package/src/apps/catenv/writeDotEnvFiles.ts +1 -1
- 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__(
|
|
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
|
-
|
|
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
|
-
/***/
|
|
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,
|
|
1355
|
-
return (0, exports.createJobCacheFromCacheConfigs)(context, (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context,
|
|
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,
|
|
1374
|
+
const getAllCacheConfigsFromConfig = (context, configWithCache) => {
|
|
1372
1375
|
return [
|
|
1373
|
-
...("jobCache" in
|
|
1374
|
-
? (0, transformLegacyJobCache_1.transformLegacyJobCache)(
|
|
1376
|
+
...("jobCache" in configWithCache
|
|
1377
|
+
? (0, transformLegacyJobCache_1.transformLegacyJobCache)(configWithCache.jobCache)
|
|
1375
1378
|
: []),
|
|
1376
|
-
...(0, index_1.ensureArray)(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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
|
|
3736
|
-
|
|
3737
|
-
.
|
|
3738
|
-
|
|
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:
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
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
|
-
|
|
3765
|
-
|
|
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
|
-
|
|
3768
|
-
|
|
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
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
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
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
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
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
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(([
|
|
3815
|
-
jobName: getFullJobName(
|
|
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
|
|
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
|
-
|
|
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: (
|
|
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: (
|
|
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__(
|
|
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
|
-
/***/
|
|
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__(
|
|
44931
|
+
var lexer = __nccwpck_require__(2269);
|
|
44912
44932
|
|
|
44913
44933
|
function includesToken(list, type) {
|
|
44914
44934
|
for (let i = 0; i < list.length; ++i)
|