@catladder/cli 0.0.0-main-d05b00fd → 0.0.0-main-9e468869
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 +232 -88
- package/dist/bundles/cli/index.js +230 -86
- package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +3 -2
- package/dist/pipeline/src/build/base/createAppBuildJob.js +5 -4
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/createBuildJobDefinition.d.ts +7 -0
- package/dist/pipeline/src/build/base/createBuildJobDefinition.js +30 -0
- package/dist/pipeline/src/build/base/createBuildJobDefinition.js.map +1 -0
- package/dist/pipeline/src/build/cache/createJobCache.d.ts +6 -0
- package/dist/pipeline/src/build/cache/createJobCache.js +57 -0
- package/dist/pipeline/src/build/cache/createJobCache.js.map +1 -0
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.d.ts +3 -0
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +28 -0
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js.map +1 -0
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.d.ts +3 -0
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.js +17 -0
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.js.map +1 -0
- package/dist/pipeline/src/build/custom/buildJob.js +2 -14
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.d.ts +1 -1
- package/dist/pipeline/src/build/custom/testJob.js +12 -11
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +3 -3
- package/dist/pipeline/src/build/docker.js +3 -1
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.js +5 -22
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.d.ts +6 -6
- package/dist/pipeline/src/build/node/cache.js +12 -15
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/meteor.js +5 -6
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +6 -5
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.js +1 -2
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.js +3 -3
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/sbom.js +1 -1
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +43 -4
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/types/gitlab-types.d.ts +2 -2
- package/dist/pipeline/src/types/index.d.ts +1 -0
- package/dist/pipeline/src/types/index.js +1 -0
- package/dist/pipeline/src/types/index.js.map +1 -1
- package/dist/pipeline/src/types/jobDefinition.d.ts +5 -0
- package/dist/pipeline/src/types/jobDefinition.js +3 -0
- package/dist/pipeline/src/types/jobDefinition.js.map +1 -0
- package/dist/pipeline/src/types/jobs.d.ts +3 -2
- package/dist/pipeline/src/types/jobs.js.map +1 -1
- package/dist/pipeline/src/utils/index.d.ts +2 -1
- package/dist/pipeline/src/utils/index.js +4 -2
- package/dist/pipeline/src/utils/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4225,19 +4225,20 @@ const lodash_1 = __nccwpck_require__(23255);
|
|
|
4225
4225
|
const __1 = __nccwpck_require__(10603);
|
|
4226
4226
|
const utils_1 = __nccwpck_require__(32497);
|
|
4227
4227
|
const createBuildJobArtifact_1 = __nccwpck_require__(43397);
|
|
4228
|
+
const createJobCache_1 = __nccwpck_require__(10340);
|
|
4228
4229
|
const yarn_1 = __nccwpck_require__(45043);
|
|
4229
4230
|
const constants_1 = __nccwpck_require__(82786);
|
|
4230
4231
|
const writeBuildInfo_1 = __nccwpck_require__(99578);
|
|
4231
4232
|
const writeDotEnv_1 = __nccwpck_require__(48052);
|
|
4232
|
-
const createAppBuildJob = (context, { script, variables, runnerVariables, ...def }) => {
|
|
4233
|
-
var _a, _b
|
|
4233
|
+
const createAppBuildJob = (context, { script, variables, runnerVariables, cache, ...def }) => {
|
|
4234
|
+
var _a, _b;
|
|
4234
4235
|
return (0, lodash_1.merge)({
|
|
4235
4236
|
name: constants_1.APP_BUILD_JOB_NAME,
|
|
4236
4237
|
envMode: "jobPerEnv",
|
|
4237
4238
|
stage: "build",
|
|
4238
4239
|
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
4239
4240
|
needs: [],
|
|
4240
|
-
cache:
|
|
4241
|
+
cache: cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, cache) : undefined,
|
|
4241
4242
|
variables: {
|
|
4242
4243
|
...(variables !== null && variables !== void 0 ? variables : {}),
|
|
4243
4244
|
...(context.type === "component"
|
|
@@ -4266,7 +4267,7 @@ const createAppBuildJob = (context, { script, variables, runnerVariables, ...def
|
|
|
4266
4267
|
...(context.type === "component" ? (0, writeBuildInfo_1.writeBuildInfo)(context) : []),
|
|
4267
4268
|
...(0, yarn_1.ensureNodeVersion)(context), // in pure node repos, we might want to have the nvmrc file in top-level
|
|
4268
4269
|
`cd ${context.build.dir}`,
|
|
4269
|
-
...(
|
|
4270
|
+
...(0, utils_1.ensureArray)(script),
|
|
4270
4271
|
],
|
|
4271
4272
|
artifacts: (0, createBuildJobArtifact_1.createBuildJobArtifacts)(context),
|
|
4272
4273
|
}, def);
|
|
@@ -4313,6 +4314,43 @@ exports.createArtifactsConfig = createArtifactsConfig;
|
|
|
4313
4314
|
|
|
4314
4315
|
/***/ }),
|
|
4315
4316
|
|
|
4317
|
+
/***/ 56354:
|
|
4318
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4319
|
+
|
|
4320
|
+
"use strict";
|
|
4321
|
+
|
|
4322
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4323
|
+
exports.createBuildJobDefinition = void 0;
|
|
4324
|
+
const runner_1 = __nccwpck_require__(4058);
|
|
4325
|
+
const utils_1 = __nccwpck_require__(32497);
|
|
4326
|
+
const getAllCacheConfigsFromConfig_1 = __nccwpck_require__(30673);
|
|
4327
|
+
const constants_1 = __nccwpck_require__(31765);
|
|
4328
|
+
const createBuildJobDefinition = (context, buildConfig, customize = {}) => {
|
|
4329
|
+
var _a, _b, _c, _d;
|
|
4330
|
+
if (buildConfig.buildCommand === null)
|
|
4331
|
+
return undefined;
|
|
4332
|
+
const defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
|
|
4333
|
+
return {
|
|
4334
|
+
image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
|
|
4335
|
+
runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
|
|
4336
|
+
cache: [
|
|
4337
|
+
...((_b = customize.cache) !== null && _b !== void 0 ? _b : []),
|
|
4338
|
+
...(0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, buildConfig),
|
|
4339
|
+
],
|
|
4340
|
+
services: "jobServices" in buildConfig ? buildConfig.jobServices : undefined,
|
|
4341
|
+
script: [
|
|
4342
|
+
...((_c = customize.prescript) !== null && _c !== void 0 ? _c : []),
|
|
4343
|
+
...(0, utils_1.ensureArray)(buildConfig.buildCommand),
|
|
4344
|
+
...((_d = customize.postscript) !== null && _d !== void 0 ? _d : []),
|
|
4345
|
+
],
|
|
4346
|
+
jobTags: buildConfig.jobTags,
|
|
4347
|
+
};
|
|
4348
|
+
};
|
|
4349
|
+
exports.createBuildJobDefinition = createBuildJobDefinition;
|
|
4350
|
+
//# sourceMappingURL=createBuildJobDefinition.js.map
|
|
4351
|
+
|
|
4352
|
+
/***/ }),
|
|
4353
|
+
|
|
4316
4354
|
/***/ 9366:
|
|
4317
4355
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4318
4356
|
|
|
@@ -4426,6 +4464,129 @@ exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDot
|
|
|
4426
4464
|
|
|
4427
4465
|
/***/ }),
|
|
4428
4466
|
|
|
4467
|
+
/***/ 10340:
|
|
4468
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4469
|
+
|
|
4470
|
+
"use strict";
|
|
4471
|
+
|
|
4472
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4473
|
+
exports.createJobCacheFromConfig = exports.createJobCacheFromCacheConfigs = void 0;
|
|
4474
|
+
const path_1 = __nccwpck_require__(71017);
|
|
4475
|
+
const getAllCacheConfigsFromConfig_1 = __nccwpck_require__(30673);
|
|
4476
|
+
const createJobCacheFromCacheConfigs = (context, caches) => {
|
|
4477
|
+
if (caches.length === 0)
|
|
4478
|
+
return undefined;
|
|
4479
|
+
const simpleCacheDefs = caches.filter((c) => !("key" in c));
|
|
4480
|
+
const advancedCacheDefs = caches.filter((c) => "key" in c);
|
|
4481
|
+
// simple caches are merged together into one. This is because e.g. gitlab has a limit of 4 caches, see https://gitlab.com/gitlab-org/gitlab/-/issues/421962
|
|
4482
|
+
const simpleCaches = simpleCacheDefs.length > 0
|
|
4483
|
+
? [
|
|
4484
|
+
{
|
|
4485
|
+
key: context.name + "-default",
|
|
4486
|
+
policy: "pull-push",
|
|
4487
|
+
paths: simpleCacheDefs.flatMap((c) => c.paths.map((p) => {
|
|
4488
|
+
var _a;
|
|
4489
|
+
const baseDir = c.pathMode === "absolute"
|
|
4490
|
+
? ""
|
|
4491
|
+
: (_a = c.baseDir) !== null && _a !== void 0 ? _a : context.build.dir;
|
|
4492
|
+
return (0, path_1.join)(baseDir, p);
|
|
4493
|
+
})),
|
|
4494
|
+
},
|
|
4495
|
+
]
|
|
4496
|
+
: [];
|
|
4497
|
+
const advancedCaches = advancedCacheDefs.map(({ key, paths, policy, scope, pathMode, buildDir, ...rest }) => {
|
|
4498
|
+
var _a;
|
|
4499
|
+
const baseDir = pathMode === "absolute" ? "" : buildDir !== null && buildDir !== void 0 ? buildDir : context.build.dir;
|
|
4500
|
+
const transformedKey = scope === "global"
|
|
4501
|
+
? key
|
|
4502
|
+
: typeof key === "string"
|
|
4503
|
+
? (scope === "buildDir" // really edge case...
|
|
4504
|
+
? baseDir
|
|
4505
|
+
: context.name) +
|
|
4506
|
+
"-" +
|
|
4507
|
+
key
|
|
4508
|
+
: {
|
|
4509
|
+
...key,
|
|
4510
|
+
files: (_a = key.files) === null || _a === void 0 ? void 0 : _a.map((f) => pathMode === "absolute" ? f : (0, path_1.join)(baseDir, f)),
|
|
4511
|
+
};
|
|
4512
|
+
return {
|
|
4513
|
+
key: transformedKey,
|
|
4514
|
+
policy: policy !== null && policy !== void 0 ? policy : "pull-push",
|
|
4515
|
+
paths: pathMode === "absolute" ? paths : paths === null || paths === void 0 ? void 0 : paths.map((p) => (0, path_1.join)(baseDir, p)),
|
|
4516
|
+
...rest,
|
|
4517
|
+
};
|
|
4518
|
+
});
|
|
4519
|
+
return [...advancedCaches, ...simpleCaches];
|
|
4520
|
+
};
|
|
4521
|
+
exports.createJobCacheFromCacheConfigs = createJobCacheFromCacheConfigs;
|
|
4522
|
+
/** shortcut, used in some build types */
|
|
4523
|
+
const createJobCacheFromConfig = (context, buildConfig) => {
|
|
4524
|
+
return (0, exports.createJobCacheFromCacheConfigs)(context, (0, getAllCacheConfigsFromConfig_1.getAllCacheConfigsFromConfig)(context, buildConfig));
|
|
4525
|
+
};
|
|
4526
|
+
exports.createJobCacheFromConfig = createJobCacheFromConfig;
|
|
4527
|
+
//# sourceMappingURL=createJobCache.js.map
|
|
4528
|
+
|
|
4529
|
+
/***/ }),
|
|
4530
|
+
|
|
4531
|
+
/***/ 30673:
|
|
4532
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4533
|
+
|
|
4534
|
+
"use strict";
|
|
4535
|
+
|
|
4536
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4537
|
+
exports.getAllCacheConfigsFromConfig = void 0;
|
|
4538
|
+
const index_1 = __nccwpck_require__(32497);
|
|
4539
|
+
const transformLegacyJobCache_1 = __nccwpck_require__(96673);
|
|
4540
|
+
const getAllCacheConfigsFromConfig = (context, buildConfig) => {
|
|
4541
|
+
return [
|
|
4542
|
+
...("jobCache" in buildConfig
|
|
4543
|
+
? (0, transformLegacyJobCache_1.transformLegacyJobCache)(buildConfig.jobCache)
|
|
4544
|
+
: []),
|
|
4545
|
+
...(0, index_1.ensureArray)(buildConfig.cache).map((c) => ({
|
|
4546
|
+
...c,
|
|
4547
|
+
context,
|
|
4548
|
+
})),
|
|
4549
|
+
...(context.type === "workspace"
|
|
4550
|
+
? // also add cache configs of the components of that workspace
|
|
4551
|
+
context.components.flatMap((componentContext) => {
|
|
4552
|
+
var _a;
|
|
4553
|
+
return (_a = (0, index_1.ensureArray)(componentContext.build.config.cache).map((c) => ({
|
|
4554
|
+
...c,
|
|
4555
|
+
baseDir: componentContext.build.dir,
|
|
4556
|
+
}))) !== null && _a !== void 0 ? _a : [];
|
|
4557
|
+
})
|
|
4558
|
+
: []),
|
|
4559
|
+
];
|
|
4560
|
+
};
|
|
4561
|
+
exports.getAllCacheConfigsFromConfig = getAllCacheConfigsFromConfig;
|
|
4562
|
+
//# sourceMappingURL=getAllCacheConfigsFromConfig.js.map
|
|
4563
|
+
|
|
4564
|
+
/***/ }),
|
|
4565
|
+
|
|
4566
|
+
/***/ 96673:
|
|
4567
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4568
|
+
|
|
4569
|
+
"use strict";
|
|
4570
|
+
|
|
4571
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4572
|
+
exports.transformLegacyJobCache = void 0;
|
|
4573
|
+
const utils_1 = __nccwpck_require__(32497);
|
|
4574
|
+
function transformLegacyJobCache(jobCache) {
|
|
4575
|
+
return (0, utils_1.ensureArray)(jobCache).map((cache) => {
|
|
4576
|
+
var _a, _b;
|
|
4577
|
+
return ({
|
|
4578
|
+
pathMode: "absolute",
|
|
4579
|
+
...cache,
|
|
4580
|
+
key: (_a = cache.key) !== null && _a !== void 0 ? _a : "default",
|
|
4581
|
+
paths: (_b = cache.paths) !== null && _b !== void 0 ? _b : [],
|
|
4582
|
+
});
|
|
4583
|
+
});
|
|
4584
|
+
}
|
|
4585
|
+
exports.transformLegacyJobCache = transformLegacyJobCache;
|
|
4586
|
+
//# sourceMappingURL=transformLegacyJobCache.js.map
|
|
4587
|
+
|
|
4588
|
+
/***/ }),
|
|
4589
|
+
|
|
4429
4590
|
/***/ 31637:
|
|
4430
4591
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4431
4592
|
|
|
@@ -4433,30 +4594,18 @@ exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDot
|
|
|
4433
4594
|
|
|
4434
4595
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4435
4596
|
exports.createCustomBuildJobs = void 0;
|
|
4436
|
-
const utils_1 = __nccwpck_require__(32497);
|
|
4437
4597
|
const docker_1 = __nccwpck_require__(9641);
|
|
4438
4598
|
const types_1 = __nccwpck_require__(84466);
|
|
4439
4599
|
const base_1 = __nccwpck_require__(9366);
|
|
4440
|
-
const
|
|
4441
|
-
KUBERNETES_CPU_REQUEST: "0.45",
|
|
4442
|
-
KUBERNETES_MEMORY_REQUEST: "1Gi",
|
|
4443
|
-
KUBERNETES_MEMORY_LIMIT: "4Gi",
|
|
4444
|
-
};
|
|
4600
|
+
const createBuildJobDefinition_1 = __nccwpck_require__(56354);
|
|
4445
4601
|
const createCustomBuildJobs = (context) => {
|
|
4446
|
-
var _a;
|
|
4447
4602
|
const buildConfig = context.build.config;
|
|
4448
4603
|
if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
|
|
4449
4604
|
throw new Error("deploy config is not custom");
|
|
4450
4605
|
}
|
|
4451
4606
|
return (0, base_1.createComponentBuildJobs)(context, {
|
|
4452
4607
|
appBuild: buildConfig.buildCommand !== null
|
|
4453
|
-
?
|
|
4454
|
-
image: buildConfig.jobImage,
|
|
4455
|
-
runnerVariables: RUNNER_BUILD_VARIABLES,
|
|
4456
|
-
cache: buildConfig.jobCache,
|
|
4457
|
-
services: buildConfig.jobServices,
|
|
4458
|
-
script: [...((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : [])],
|
|
4459
|
-
}
|
|
4608
|
+
? (0, createBuildJobDefinition_1.createBuildJobDefinition)(context, buildConfig)
|
|
4460
4609
|
: undefined,
|
|
4461
4610
|
dockerBuild: {
|
|
4462
4611
|
script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context),
|
|
@@ -4494,15 +4643,16 @@ exports.createCustomJobs = createCustomJobs;
|
|
|
4494
4643
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4495
4644
|
exports.createCustomTestJobs = void 0;
|
|
4496
4645
|
const utils_1 = __nccwpck_require__(32497);
|
|
4497
|
-
const types_1 = __nccwpck_require__(84466);
|
|
4498
4646
|
const createArtifactsConfig_1 = __nccwpck_require__(12820);
|
|
4647
|
+
const createJobCache_1 = __nccwpck_require__(10340);
|
|
4648
|
+
const types_1 = __nccwpck_require__(84466);
|
|
4499
4649
|
const RUNNER_CUSTOM_TEST_VARIABLES = {
|
|
4500
4650
|
KUBERNETES_CPU_REQUEST: "0.45",
|
|
4501
4651
|
KUBERNETES_MEMORY_REQUEST: "1Gi",
|
|
4502
4652
|
KUBERNETES_MEMORY_LIMIT: "4Gi",
|
|
4503
4653
|
};
|
|
4504
4654
|
const createCustomTestJobs = (context) => {
|
|
4505
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
4655
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
4506
4656
|
// don't run tests after release
|
|
4507
4657
|
// TODO: this will be replaced by using rules
|
|
4508
4658
|
if (context.trigger === "taggedRelease") {
|
|
@@ -4520,7 +4670,7 @@ const createCustomTestJobs = (context) => {
|
|
|
4520
4670
|
},
|
|
4521
4671
|
runnerVariables: RUNNER_CUSTOM_TEST_VARIABLES,
|
|
4522
4672
|
services: buildConfig.jobServices,
|
|
4523
|
-
cache:
|
|
4673
|
+
cache: (0, createJobCache_1.createJobCacheFromConfig)(context, buildConfig),
|
|
4524
4674
|
stage: "test",
|
|
4525
4675
|
needs: [],
|
|
4526
4676
|
envMode: "none",
|
|
@@ -4531,27 +4681,27 @@ const createCustomTestJobs = (context) => {
|
|
|
4531
4681
|
...base,
|
|
4532
4682
|
image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage,
|
|
4533
4683
|
cache: undefined,
|
|
4534
|
-
script: [...(
|
|
4684
|
+
script: [...(0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)],
|
|
4535
4685
|
allow_failure: true,
|
|
4536
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
4686
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.artifactsReports, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifacts),
|
|
4537
4687
|
}
|
|
4538
4688
|
: null;
|
|
4539
4689
|
const lintJob = buildConfig.lint
|
|
4540
4690
|
? {
|
|
4541
4691
|
name: "👮 lint",
|
|
4542
4692
|
...base,
|
|
4543
|
-
image: (
|
|
4544
|
-
script: [...(
|
|
4545
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
4693
|
+
image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage,
|
|
4694
|
+
script: [...(0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)],
|
|
4695
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.artifactsReports, (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.artifacts),
|
|
4546
4696
|
}
|
|
4547
4697
|
: null;
|
|
4548
4698
|
const testJob = buildConfig.test
|
|
4549
4699
|
? {
|
|
4550
4700
|
name: "🧪 test",
|
|
4551
4701
|
...base,
|
|
4552
|
-
image: (
|
|
4553
|
-
script: [...(
|
|
4554
|
-
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
4702
|
+
image: (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage,
|
|
4703
|
+
script: [...(0, utils_1.ensureArray)((_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.command)],
|
|
4704
|
+
...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.artifactsReports, (_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.artifacts),
|
|
4555
4705
|
}
|
|
4556
4706
|
: null;
|
|
4557
4707
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -4579,6 +4729,7 @@ const artifactsRegistry_1 = __nccwpck_require__(44963);
|
|
|
4579
4729
|
const gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(46320);
|
|
4580
4730
|
const runner_1 = __nccwpck_require__(4058);
|
|
4581
4731
|
const gitlab_1 = __nccwpck_require__(38490);
|
|
4732
|
+
const createJobCache_1 = __nccwpck_require__(10340);
|
|
4582
4733
|
const DOCKER_BUILD_RUNNER_REQUESTS = {
|
|
4583
4734
|
KUBERNETES_CPU_REQUEST: "0.45",
|
|
4584
4735
|
KUBERNETES_MEMORY_REQUEST: "1Gi",
|
|
@@ -4668,11 +4819,12 @@ const getDockerJobBaseProps = () => {
|
|
|
4668
4819
|
};
|
|
4669
4820
|
};
|
|
4670
4821
|
exports.getDockerJobBaseProps = getDockerJobBaseProps;
|
|
4671
|
-
const createDockerBuildJobBase = (context, { script, ...def }) => {
|
|
4822
|
+
const createDockerBuildJobBase = (context, { script, cache, ...def }) => {
|
|
4672
4823
|
return (0, lodash_1.merge)({
|
|
4673
4824
|
name: exports.DOCKER_BUILD_JOB_NAME,
|
|
4674
4825
|
envMode: "jobPerEnv",
|
|
4675
4826
|
stage: "build",
|
|
4827
|
+
cache: cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, cache) : undefined,
|
|
4676
4828
|
...(0, exports.getDockerJobBaseProps)(),
|
|
4677
4829
|
script: script || [],
|
|
4678
4830
|
}, {
|
|
@@ -4826,14 +4978,11 @@ exports.WORKSPACE_BUILD_TYPES = {
|
|
|
4826
4978
|
|
|
4827
4979
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4828
4980
|
exports.createNodeDockerJobDefinition = exports.createNodeBuildJobDefinition = exports.createNodeBuildJobs = void 0;
|
|
4829
|
-
const runner_1 = __nccwpck_require__(4058);
|
|
4830
4981
|
const context_1 = __nccwpck_require__(61724);
|
|
4831
|
-
const utils_1 = __nccwpck_require__(32497);
|
|
4832
4982
|
const base_1 = __nccwpck_require__(9366);
|
|
4983
|
+
const createBuildJobDefinition_1 = __nccwpck_require__(56354);
|
|
4833
4984
|
const docker_1 = __nccwpck_require__(9641);
|
|
4834
|
-
const types_1 = __nccwpck_require__(84466);
|
|
4835
4985
|
const cache_1 = __nccwpck_require__(72026);
|
|
4836
|
-
const constants_1 = __nccwpck_require__(31765);
|
|
4837
4986
|
const yarn_1 = __nccwpck_require__(45043);
|
|
4838
4987
|
const createNodeBuildJobs = (context) => {
|
|
4839
4988
|
if (context.type === "workspace") {
|
|
@@ -4850,26 +4999,12 @@ const createNodeBuildJobs = (context) => {
|
|
|
4850
4999
|
};
|
|
4851
5000
|
exports.createNodeBuildJobs = createNodeBuildJobs;
|
|
4852
5001
|
const createNodeBuildJobDefinition = (context) => {
|
|
4853
|
-
var _a, _b, _c;
|
|
4854
5002
|
const buildConfig = context.build.config;
|
|
4855
|
-
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
4856
|
-
throw new Error("deploy config is not node, node-static or storybook");
|
|
4857
|
-
}
|
|
4858
|
-
if (buildConfig.buildCommand === null)
|
|
4859
|
-
return undefined;
|
|
4860
|
-
const defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
|
|
4861
5003
|
const yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
4862
|
-
return {
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
...((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []),
|
|
4867
|
-
...(0, cache_1.getNodeCache)(context),
|
|
4868
|
-
...(0, cache_1.getNextCache)(context),
|
|
4869
|
-
],
|
|
4870
|
-
script: [...yarnInstall, ...((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : [])],
|
|
4871
|
-
jobTags: buildConfig.jobTags,
|
|
4872
|
-
};
|
|
5004
|
+
return (0, createBuildJobDefinition_1.createBuildJobDefinition)(context, buildConfig, {
|
|
5005
|
+
prescript: yarnInstall,
|
|
5006
|
+
cache: [...(0, cache_1.getNodeCache)(context), ...(0, cache_1.getNextCache)(context)],
|
|
5007
|
+
});
|
|
4873
5008
|
};
|
|
4874
5009
|
exports.createNodeBuildJobDefinition = createNodeBuildJobDefinition;
|
|
4875
5010
|
const createNodeDockerJobDefinition = (context) => {
|
|
@@ -4911,17 +5046,12 @@ const getYarnCache = (context, policy = "pull-push") => {
|
|
|
4911
5046
|
const componentIsInWorkspace = context.type === "component" &&
|
|
4912
5047
|
context.packageManagerInfo.componentIsInWorkspace;
|
|
4913
5048
|
return [
|
|
4914
|
-
|
|
4915
|
-
?
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
: {
|
|
4921
|
-
key: (0, slugify_1.default)(context.build.dir) + "-yarn",
|
|
4922
|
-
policy,
|
|
4923
|
-
paths: [(0, path_1.join)(context.build.dir, ".yarn")],
|
|
4924
|
-
},
|
|
5049
|
+
{
|
|
5050
|
+
scope: componentIsInWorkspace ? "global" : "buildDir",
|
|
5051
|
+
key: "yarn",
|
|
5052
|
+
policy,
|
|
5053
|
+
paths: [".yarn"],
|
|
5054
|
+
},
|
|
4925
5055
|
];
|
|
4926
5056
|
};
|
|
4927
5057
|
exports.getYarnCache = getYarnCache;
|
|
@@ -4933,6 +5063,8 @@ const getNodeModulesCache = (context, policy = "pull-push") => {
|
|
|
4933
5063
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
4934
5064
|
return [
|
|
4935
5065
|
{
|
|
5066
|
+
scope: "global",
|
|
5067
|
+
pathMode: "absolute",
|
|
4936
5068
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
4937
5069
|
key: componentIsInWorkspace
|
|
4938
5070
|
? "node-modules-workspace"
|
|
@@ -4959,13 +5091,13 @@ const getNodeCache = (context, policy = "pull-push") => {
|
|
|
4959
5091
|
};
|
|
4960
5092
|
exports.getNodeCache = getNodeCache;
|
|
4961
5093
|
const getNextCache = (context) => {
|
|
4962
|
-
const key = context.name + "-next-cache";
|
|
4963
5094
|
const paths = context.build
|
|
4964
5095
|
.getComponentDirs("direct")
|
|
4965
5096
|
.map((c) => (0, path_1.join)(c, ".next/cache"));
|
|
4966
5097
|
return [
|
|
4967
5098
|
{
|
|
4968
|
-
|
|
5099
|
+
pathMode: "absolute",
|
|
5100
|
+
key: "next-cache",
|
|
4969
5101
|
policy: "pull-push",
|
|
4970
5102
|
paths,
|
|
4971
5103
|
},
|
|
@@ -4976,9 +5108,9 @@ const getWorkspaceDefaultCaches = (context) => {
|
|
|
4976
5108
|
return [
|
|
4977
5109
|
{
|
|
4978
5110
|
// turbo repo
|
|
4979
|
-
key:
|
|
5111
|
+
key: "turbo",
|
|
4980
5112
|
policy: "pull-push",
|
|
4981
|
-
paths: [
|
|
5113
|
+
paths: [".turbo"],
|
|
4982
5114
|
},
|
|
4983
5115
|
];
|
|
4984
5116
|
};
|
|
@@ -5036,7 +5168,6 @@ exports.createMeteorJobs = createMeteorJobs;
|
|
|
5036
5168
|
|
|
5037
5169
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5038
5170
|
exports.createMeteorBuildJobs = void 0;
|
|
5039
|
-
const path_1 = __nccwpck_require__(71017);
|
|
5040
5171
|
const runner_1 = __nccwpck_require__(4058);
|
|
5041
5172
|
const base_1 = __nccwpck_require__(9366);
|
|
5042
5173
|
const docker_1 = __nccwpck_require__(9641);
|
|
@@ -5045,13 +5176,13 @@ const cache_1 = __nccwpck_require__(72026);
|
|
|
5045
5176
|
const yarn_1 = __nccwpck_require__(45043);
|
|
5046
5177
|
const getMeteorCache = (context) => [
|
|
5047
5178
|
{
|
|
5048
|
-
key:
|
|
5179
|
+
key: "meteor-build-cache",
|
|
5049
5180
|
policy: "pull-push",
|
|
5050
5181
|
paths: [
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5182
|
+
".meteor/local/resolver-result-cache.json",
|
|
5183
|
+
".meteor/local/plugin-cache",
|
|
5184
|
+
".meteor/local/isopacks",
|
|
5185
|
+
".meteor/local/bundler-cache/scanner",
|
|
5055
5186
|
],
|
|
5056
5187
|
},
|
|
5057
5188
|
];
|
|
@@ -5106,6 +5237,7 @@ const createArtifactsConfig_1 = __nccwpck_require__(12820);
|
|
|
5106
5237
|
const cache_1 = __nccwpck_require__(72026);
|
|
5107
5238
|
const constants_1 = __nccwpck_require__(31765);
|
|
5108
5239
|
const yarn_1 = __nccwpck_require__(45043);
|
|
5240
|
+
const createJobCache_1 = __nccwpck_require__(10340);
|
|
5109
5241
|
const createNodeTestJobs = (context) => {
|
|
5110
5242
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
5111
5243
|
// don't run tests after release
|
|
@@ -5144,7 +5276,7 @@ const createNodeTestJobs = (context) => {
|
|
|
5144
5276
|
cache: undefined, // audit does not need yarn install and no cache
|
|
5145
5277
|
script: [
|
|
5146
5278
|
`cd ${context.build.dir}`,
|
|
5147
|
-
...((_e = (0, utils_1.
|
|
5279
|
+
...((_e = (0, utils_1.ensureArrayOrNull)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
5148
5280
|
context.packageManagerInfo.isClassic
|
|
5149
5281
|
? "yarn audit"
|
|
5150
5282
|
: "yarn npm audit --environment production", // yarn 2
|
|
@@ -5159,12 +5291,12 @@ const createNodeTestJobs = (context) => {
|
|
|
5159
5291
|
name: "👮 lint",
|
|
5160
5292
|
...base,
|
|
5161
5293
|
image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
5162
|
-
cache: (0, cache_1.getNodeCache)(context),
|
|
5294
|
+
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
5163
5295
|
script: [
|
|
5164
5296
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
5165
5297
|
`cd ${context.build.dir}`,
|
|
5166
5298
|
...yarnInstall,
|
|
5167
|
-
...((_l = (0, utils_1.
|
|
5299
|
+
...((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"]),
|
|
5168
5300
|
],
|
|
5169
5301
|
...(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),
|
|
5170
5302
|
}
|
|
@@ -5174,12 +5306,12 @@ const createNodeTestJobs = (context) => {
|
|
|
5174
5306
|
name: "🧪 test",
|
|
5175
5307
|
...base,
|
|
5176
5308
|
image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
5177
|
-
cache: (0, cache_1.getNodeCache)(context),
|
|
5309
|
+
cache: (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, (0, cache_1.getNodeCache)(context)),
|
|
5178
5310
|
script: [
|
|
5179
5311
|
...(0, yarn_1.ensureNodeVersion)(context),
|
|
5180
5312
|
`cd ${context.build.dir}`,
|
|
5181
5313
|
...yarnInstall,
|
|
5182
|
-
...((_s = (0, utils_1.
|
|
5314
|
+
...((_s = (0, utils_1.ensureArrayOrNull)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"]),
|
|
5183
5315
|
],
|
|
5184
5316
|
...(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),
|
|
5185
5317
|
}
|
|
@@ -5216,7 +5348,6 @@ const ensureNodeVersion = (context) => (0, gitlab_1.collapseableSection)("nodein
|
|
|
5216
5348
|
]);
|
|
5217
5349
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
5218
5350
|
const getYarnInstall = (context, options) => {
|
|
5219
|
-
var _a;
|
|
5220
5351
|
const postInstall = context.type !== "workspace" && "postInstall" in context.build.config
|
|
5221
5352
|
? context.build.config.postInstall
|
|
5222
5353
|
: null;
|
|
@@ -5224,7 +5355,7 @@ const getYarnInstall = (context, options) => {
|
|
|
5224
5355
|
...(0, exports.ensureNodeVersion)(context),
|
|
5225
5356
|
...(0, gitlab_1.collapseableSection)("yarninstall", "Yarn install")([getYarnInstallCommand(context)]),
|
|
5226
5357
|
...(postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall)
|
|
5227
|
-
? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((
|
|
5358
|
+
? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((0, utils_1.ensureArray)(postInstall))
|
|
5228
5359
|
: []),
|
|
5229
5360
|
];
|
|
5230
5361
|
};
|
|
@@ -5387,7 +5518,7 @@ const createRailsTestJobs = (context) => {
|
|
|
5387
5518
|
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,
|
|
5388
5519
|
script: [
|
|
5389
5520
|
`cd ${context.build.dir}`,
|
|
5390
|
-
...((_f = (0, utils_1.
|
|
5521
|
+
...((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [
|
|
5391
5522
|
"gem install bundler-audit",
|
|
5392
5523
|
"bundle audit check",
|
|
5393
5524
|
]),
|
|
@@ -5404,7 +5535,7 @@ const createRailsTestJobs = (context) => {
|
|
|
5404
5535
|
script: [
|
|
5405
5536
|
`cd ${context.build.dir}`,
|
|
5406
5537
|
...bundlerInstall,
|
|
5407
|
-
...((_l = (0, utils_1.
|
|
5538
|
+
...((_l = (0, utils_1.ensureArrayOrNull)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : [
|
|
5408
5539
|
"bundle exec rubocop",
|
|
5409
5540
|
]),
|
|
5410
5541
|
],
|
|
@@ -5419,7 +5550,7 @@ const createRailsTestJobs = (context) => {
|
|
|
5419
5550
|
script: [
|
|
5420
5551
|
`cd ${context.build.dir}`,
|
|
5421
5552
|
...bundlerInstall,
|
|
5422
|
-
...((_r = (0, utils_1.
|
|
5553
|
+
...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : [
|
|
5423
5554
|
"bundle exec rspec",
|
|
5424
5555
|
]),
|
|
5425
5556
|
],
|
|
@@ -5460,7 +5591,7 @@ const createSbomBuildJob = (context) => {
|
|
|
5460
5591
|
const script = (0, _1.isStandaloneBuildConfig)(buildConfig) &&
|
|
5461
5592
|
buildConfig.type === "custom" &&
|
|
5462
5593
|
buildConfig.sbom !== false
|
|
5463
|
-
? (_d = (0, utils_1.
|
|
5594
|
+
? (_d = (0, utils_1.ensureArrayOrNull)((_c = buildConfig.sbom) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : defaultScript
|
|
5464
5595
|
: defaultScript;
|
|
5465
5596
|
return {
|
|
5466
5597
|
name: exports.SBOM_BUILD_JOB_NAME,
|
|
@@ -9473,11 +9604,22 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
9473
9604
|
__exportStar(__nccwpck_require__(47770), exports);
|
|
9474
9605
|
__exportStar(__nccwpck_require__(30688), exports);
|
|
9475
9606
|
__exportStar(__nccwpck_require__(61724), exports);
|
|
9607
|
+
__exportStar(__nccwpck_require__(28207), exports);
|
|
9476
9608
|
__exportStar(__nccwpck_require__(32074), exports);
|
|
9477
9609
|
//# sourceMappingURL=index.js.map
|
|
9478
9610
|
|
|
9479
9611
|
/***/ }),
|
|
9480
9612
|
|
|
9613
|
+
/***/ 28207:
|
|
9614
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
9615
|
+
|
|
9616
|
+
"use strict";
|
|
9617
|
+
|
|
9618
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9619
|
+
//# sourceMappingURL=jobDefinition.js.map
|
|
9620
|
+
|
|
9621
|
+
/***/ }),
|
|
9622
|
+
|
|
9481
9623
|
/***/ 17432:
|
|
9482
9624
|
/***/ ((__unused_webpack_module, exports) => {
|
|
9483
9625
|
|
|
@@ -9551,13 +9693,15 @@ exports.collapseableSection = collapseableSection;
|
|
|
9551
9693
|
"use strict";
|
|
9552
9694
|
|
|
9553
9695
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9554
|
-
exports.mergeWithMergingArrays = exports.ensureArray = exports.notNil = void 0;
|
|
9696
|
+
exports.mergeWithMergingArrays = exports.ensureArray = exports.ensureArrayOrNull = exports.notNil = void 0;
|
|
9555
9697
|
const lodash_1 = __nccwpck_require__(23255);
|
|
9556
9698
|
function notNil(value) {
|
|
9557
9699
|
return value !== null && value !== undefined;
|
|
9558
9700
|
}
|
|
9559
9701
|
exports.notNil = notNil;
|
|
9560
|
-
const
|
|
9702
|
+
const ensureArrayOrNull = (s) => (0, lodash_1.isNil)(s) ? null : Array.isArray(s) ? s : [s];
|
|
9703
|
+
exports.ensureArrayOrNull = ensureArrayOrNull;
|
|
9704
|
+
const ensureArray = (s) => { var _a; return (_a = (0, exports.ensureArrayOrNull)(s)) !== null && _a !== void 0 ? _a : []; };
|
|
9561
9705
|
exports.ensureArray = ensureArray;
|
|
9562
9706
|
// see https://github.com/lodash/lodash/issues/5384
|
|
9563
9707
|
const mergeWithMergingArrays = (obj1, obj2) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BuildContextStandalone, ComponentContext, WorkspaceContext } from "../..";
|
|
2
|
+
import type { JobDefintion } from "../../types/jobDefinition";
|
|
2
3
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export type AppBuildJobDefinition =
|
|
4
|
-
export declare const createAppBuildJob: (context: ComponentContext<BuildContextStandalone> | WorkspaceContext, { script, variables, runnerVariables, ...def }: AppBuildJobDefinition) => CatladderJob;
|
|
4
|
+
export type AppBuildJobDefinition = JobDefintion;
|
|
5
|
+
export declare const createAppBuildJob: (context: ComponentContext<BuildContextStandalone> | WorkspaceContext, { script, variables, runnerVariables, cache, ...def }: AppBuildJobDefinition) => CatladderJob;
|
|
@@ -5,19 +5,20 @@ const lodash_1 = require("lodash");
|
|
|
5
5
|
const __1 = require("../..");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const createBuildJobArtifact_1 = require("../artifacts/createBuildJobArtifact");
|
|
8
|
+
const createJobCache_1 = require("../cache/createJobCache");
|
|
8
9
|
const yarn_1 = require("../node/yarn");
|
|
9
10
|
const constants_1 = require("./constants");
|
|
10
11
|
const writeBuildInfo_1 = require("./writeBuildInfo");
|
|
11
12
|
const writeDotEnv_1 = require("./writeDotEnv");
|
|
12
|
-
const createAppBuildJob = (context, { script, variables, runnerVariables, ...def }) => {
|
|
13
|
-
var _a, _b
|
|
13
|
+
const createAppBuildJob = (context, { script, variables, runnerVariables, cache, ...def }) => {
|
|
14
|
+
var _a, _b;
|
|
14
15
|
return (0, lodash_1.merge)({
|
|
15
16
|
name: constants_1.APP_BUILD_JOB_NAME,
|
|
16
17
|
envMode: "jobPerEnv",
|
|
17
18
|
stage: "build",
|
|
18
19
|
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
19
20
|
needs: [],
|
|
20
|
-
cache:
|
|
21
|
+
cache: cache ? (0, createJobCache_1.createJobCacheFromCacheConfigs)(context, cache) : undefined,
|
|
21
22
|
variables: {
|
|
22
23
|
...(variables !== null && variables !== void 0 ? variables : {}),
|
|
23
24
|
...(context.type === "component"
|
|
@@ -46,7 +47,7 @@ const createAppBuildJob = (context, { script, variables, runnerVariables, ...def
|
|
|
46
47
|
...(context.type === "component" ? (0, writeBuildInfo_1.writeBuildInfo)(context) : []),
|
|
47
48
|
...(0, yarn_1.ensureNodeVersion)(context), // in pure node repos, we might want to have the nvmrc file in top-level
|
|
48
49
|
`cd ${context.build.dir}`,
|
|
49
|
-
...(
|
|
50
|
+
...(0, utils_1.ensureArray)(script),
|
|
50
51
|
],
|
|
51
52
|
artifacts: (0, createBuildJobArtifact_1.createBuildJobArtifacts)(context),
|
|
52
53
|
}, def);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAppBuildJob.js","sourceRoot":"","sources":["../../../../../../pipeline/src/build/base/createAppBuildJob.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAM/B,6BAAuC;
|
|
1
|
+
{"version":3,"file":"createAppBuildJob.js","sourceRoot":"","sources":["../../../../../../pipeline/src/build/base/createAppBuildJob.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAM/B,6BAAuC;AAGvC,uCAA0C;AAC1C,gFAA8E;AAC9E,4DAAyE;AACzE,uCAAiD;AACjD,2CAGqB;AACrB,qDAAkD;AAClD,+CAGuB;AAGhB,MAAM,iBAAiB,GAAG,CAC/B,OAAoE,EACpE,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,GAAG,EAAyB,EAC9D,EAAE;;IAChB,OAAO,IAAA,cAAK,EACV;QACE,IAAI,EAAE,8BAAkB;QACxB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,IAAA,kBAAc,EAAC,cAAc,CAAC;QACrC,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAA,+CAA8B,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACzE,SAAS,EAAE;YACT,GAAG,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC;YACpB,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW;gBAC9B,CAAC,CAAC;oBACE,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO;oBAC9B,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO;oBAChD,GAAG,CAAC,MAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,mCAAI,EAAE,CAAC;iBAC1C;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QACD,eAAe,EAAE;YACf,GAAG,2CAA+B;YAClC,GAAG,CAAC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE,CAAC;YAC1B,GAAG,CAAC,MAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,mCAAI,EAAE,CAAC;SAChD;QAED,MAAM,EAAE;YACN,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW;gBAC9B,CAAC,CAAC,IAAA,kDAAoC,EAAC,OAAO,CAAC;oBAC7C,CAAC,CAAC,IAAA,yBAAW,EAAC,OAAO,CAAC;oBACtB,CAAC,CAAC,EAAE;gBACN,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW;oBAC5B,CAAC,CAAC,OAAO,CAAC,UAAU;yBACf,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kDAAoC,EAAC,CAAC,CAAC,CAAC;yBACtD,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,yBAAW,EAAC,CAAC,CAAC,CAAC;oBACnC,CAAC,CAAC,EAAE,CAAC;YACT,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAA,+BAAc,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,EAAE,wEAAwE;YACvG,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;YACzB,GAAG,IAAA,mBAAW,EAAC,MAAM,CAAC;SACvB;QACD,SAAS,EAAE,IAAA,gDAAuB,EAAC,OAAO,CAAC;KAC5C,EACD,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,iBAAiB,qBA+C5B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BuildConfigStandalone, WorkspaceBuildConfig } from "..";
|
|
2
|
+
import type { Context } from "../../types";
|
|
3
|
+
import type { JobDefintion } from "../../types/jobDefinition";
|
|
4
|
+
export declare const createBuildJobDefinition: (context: Context, buildConfig: BuildConfigStandalone | WorkspaceBuildConfig, customize?: Pick<JobDefintion, "cache"> & {
|
|
5
|
+
prescript?: string[];
|
|
6
|
+
postscript?: string[];
|
|
7
|
+
}) => JobDefintion | undefined;
|