@catladder/cli 0.0.0-main-e5cd9fd4 → 0.0.0-main-79fbaf60

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.
@@ -350203,6 +350203,99 @@ exports.RUNNER_BUILD_RESOURCE_VARIABLES = {
350203
350203
 
350204
350204
  /***/ }),
350205
350205
 
350206
+ /***/ 57267:
350207
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
350208
+
350209
+ "use strict";
350210
+
350211
+
350212
+ var __assign = this && this.__assign || function () {
350213
+ __assign = Object.assign || function (t) {
350214
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
350215
+ s = arguments[i];
350216
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
350217
+ }
350218
+ return t;
350219
+ };
350220
+ return __assign.apply(this, arguments);
350221
+ };
350222
+ var __rest = this && this.__rest || function (s, e) {
350223
+ var t = {};
350224
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
350225
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
350226
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
350227
+ }
350228
+ return t;
350229
+ };
350230
+ var __read = this && this.__read || function (o, n) {
350231
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
350232
+ if (!m) return o;
350233
+ var i = m.call(o),
350234
+ r,
350235
+ ar = [],
350236
+ e;
350237
+ try {
350238
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
350239
+ } catch (error) {
350240
+ e = {
350241
+ error: error
350242
+ };
350243
+ } finally {
350244
+ try {
350245
+ if (r && !r.done && (m = i["return"])) m.call(i);
350246
+ } finally {
350247
+ if (e) throw e.error;
350248
+ }
350249
+ }
350250
+ return ar;
350251
+ };
350252
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
350253
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
350254
+ if (ar || !(i in from)) {
350255
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
350256
+ ar[i] = from[i];
350257
+ }
350258
+ }
350259
+ return to.concat(ar || Array.prototype.slice.call(from));
350260
+ };
350261
+ exports.__esModule = true;
350262
+ exports.createAppBuildJob = void 0;
350263
+ var lodash_1 = __nccwpck_require__(23255);
350264
+ var path_1 = __nccwpck_require__(71017);
350265
+ var __1 = __nccwpck_require__(25355);
350266
+ var utils_1 = __nccwpck_require__(37461);
350267
+ var yarn_1 = __nccwpck_require__(10464);
350268
+ var constants_1 = __nccwpck_require__(11542);
350269
+ var writeBuildInfo_1 = __nccwpck_require__(51754);
350270
+ var writeDotEnv_1 = __nccwpck_require__(71298);
350271
+ var createAppBuildJob = function (context, _a) {
350272
+ var _b, _c, _d, _e;
350273
+ var script = _a.script,
350274
+ variables = _a.variables,
350275
+ def = __rest(_a, ["script", "variables"]);
350276
+ return (0, lodash_1.merge)({
350277
+ name: constants_1.APP_BUILD_JOB_NAME,
350278
+ envMode: "jobPerEnv",
350279
+ stage: "build",
350280
+ image: (0, __1.getRunnerImage)("jobs-default"),
350281
+ needs: [],
350282
+ cache: [],
350283
+ variables: __assign(__assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
350284
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.componentConfig.dotEnv ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_c = (0, utils_1.ensureArray)(script)) !== null && _c !== void 0 ? _c : []), false),
350285
+ artifacts: {
350286
+ paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
350287
+ reports: {
350288
+ junit: (_e = (_d = context.componentConfig.build.artifactsReports) === null || _d === void 0 ? void 0 : _d.junit) === null || _e === void 0 ? void 0 : _e.map(function (p) {
350289
+ return (0, path_1.join)(context.componentConfig.dir, p);
350290
+ })
350291
+ }
350292
+ }
350293
+ }, def);
350294
+ };
350295
+ exports.createAppBuildJob = createAppBuildJob;
350296
+
350297
+ /***/ }),
350298
+
350206
350299
  /***/ 5669:
350207
350300
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
350208
350301
 
@@ -350273,7 +350366,7 @@ exports.createArtifactsConfig = createArtifactsConfig;
350273
350366
 
350274
350367
  /***/ }),
350275
350368
 
350276
- /***/ 58063:
350369
+ /***/ 18035:
350277
350370
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
350278
350371
 
350279
350372
  "use strict";
@@ -350289,14 +350382,6 @@ var __assign = this && this.__assign || function () {
350289
350382
  };
350290
350383
  return __assign.apply(this, arguments);
350291
350384
  };
350292
- var __rest = this && this.__rest || function (s, e) {
350293
- var t = {};
350294
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
350295
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
350296
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
350297
- }
350298
- return t;
350299
- };
350300
350385
  var __read = this && this.__read || function (o, n) {
350301
350386
  var m = typeof Symbol === "function" && o[Symbol.iterator];
350302
350387
  if (!m) return o;
@@ -350329,40 +350414,19 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
350329
350414
  return to.concat(ar || Array.prototype.slice.call(from));
350330
350415
  };
350331
350416
  exports.__esModule = true;
350332
- exports.createBuildJob = void 0;
350333
- var lodash_1 = __nccwpck_require__(23255);
350334
- var path_1 = __nccwpck_require__(71017);
350335
- var __1 = __nccwpck_require__(25355);
350336
- var utils_1 = __nccwpck_require__(37461);
350337
- var yarn_1 = __nccwpck_require__(10464);
350417
+ exports.createBuildJobs = void 0;
350418
+ var sbom_1 = __nccwpck_require__(65928);
350419
+ var docker_1 = __nccwpck_require__(33219);
350420
+ var sbom_2 = __nccwpck_require__(9927);
350338
350421
  var constants_1 = __nccwpck_require__(11542);
350339
- var writeBuildInfo_1 = __nccwpck_require__(51754);
350340
- var writeDotEnv_1 = __nccwpck_require__(71298);
350341
- var createBuildJob = function (context, _a) {
350342
- var _b, _c, _d, _e;
350343
- var script = _a.script,
350344
- variables = _a.variables,
350345
- def = __rest(_a, ["script", "variables"]);
350346
- return (0, lodash_1.merge)({
350347
- name: constants_1.APP_BUILD_JOB_NAME,
350348
- envMode: "jobPerEnv",
350349
- stage: "build",
350350
- image: (0, __1.getRunnerImage)("jobs-default"),
350351
- needs: [],
350352
- cache: [],
350353
- variables: __assign(__assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
350354
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.componentConfig.dotEnv ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_c = (0, utils_1.ensureArray)(script)) !== null && _c !== void 0 ? _c : []), false),
350355
- artifacts: {
350356
- paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
350357
- reports: {
350358
- junit: (_e = (_d = context.componentConfig.build.artifactsReports) === null || _d === void 0 ? void 0 : _d.junit) === null || _e === void 0 ? void 0 : _e.map(function (p) {
350359
- return (0, path_1.join)(context.componentConfig.dir, p);
350360
- })
350361
- }
350362
- }
350363
- }, def);
350422
+ var createAppBuildJob_1 = __nccwpck_require__(57267);
350423
+ var createBuildJobs = function (context, definitions) {
350424
+ var _a;
350425
+ return __spreadArray(__spreadArray(__spreadArray([], __read(definitions.appBuild ? [(0, createAppBuildJob_1.createAppBuildJob)(context, definitions.appBuild)] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobBase)(context, __assign(__assign({}, definitions.dockerBuild), {
350426
+ needs: __spreadArray(__spreadArray([], __read((_a = definitions.dockerBuild.needs) !== null && _a !== void 0 ? _a : []), false), __read(definitions.appBuild ? [constants_1.APP_BUILD_JOB_NAME] : []), false)
350427
+ }))] : []), false), __read((0, sbom_1.sbomDeactivated)(context) ? [] : [(0, sbom_2.createSbomBuildJob)(context)]), false);
350364
350428
  };
350365
- exports.createBuildJob = createBuildJob;
350429
+ exports.createBuildJobs = createBuildJobs;
350366
350430
 
350367
350431
  /***/ }),
350368
350432
 
@@ -350483,12 +350547,9 @@ exports.__esModule = true;
350483
350547
  exports.createCustomBuildJobs = void 0;
350484
350548
  var path_1 = __nccwpck_require__(71017);
350485
350549
  var utils_1 = __nccwpck_require__(37461);
350486
- var constants_1 = __nccwpck_require__(11542);
350487
- var createBuildJob_1 = __nccwpck_require__(58063);
350488
350550
  var docker_1 = __nccwpck_require__(33219);
350489
350551
  var types_1 = __nccwpck_require__(71197);
350490
- var sbom_1 = __nccwpck_require__(9927);
350491
- var sbom_2 = __nccwpck_require__(65928);
350552
+ var base_1 = __nccwpck_require__(18035);
350492
350553
  var RUNNER_BUILD_VARIABLES = {
350493
350554
  KUBERNETES_CPU_REQUEST: "0.5",
350494
350555
  KUBERNETES_CPU_LIMIT: "2",
@@ -350501,25 +350562,25 @@ var createCustomBuildJobs = function (context) {
350501
350562
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
350502
350563
  throw new Error("deploy config is not custom");
350503
350564
  }
350504
- var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
350505
- image: buildConfig.jobImage,
350506
- variables: __assign({}, RUNNER_BUILD_VARIABLES),
350507
- cache: buildConfig.jobCache,
350508
- services: buildConfig.jobServices,
350509
- script: __spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
350510
- artifacts: {
350511
- 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) {
350512
- return (0, path_1.join)(context.componentConfig.dir, path);
350513
- })) !== null && _c !== void 0 ? _c : []), false),
350514
- expire_in: "1 day"
350565
+ return (0, base_1.createBuildJobs)(context, {
350566
+ appBuild: buildConfig.buildCommand !== null ? {
350567
+ image: buildConfig.jobImage,
350568
+ variables: __assign({}, RUNNER_BUILD_VARIABLES),
350569
+ cache: buildConfig.jobCache,
350570
+ services: buildConfig.jobServices,
350571
+ script: __spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
350572
+ artifacts: {
350573
+ 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) {
350574
+ return (0, path_1.join)(context.componentConfig.dir, path);
350575
+ })) !== null && _c !== void 0 ? _c : []), false),
350576
+ expire_in: "1 day"
350577
+ }
350578
+ } : undefined,
350579
+ dockerBuild: {
350580
+ script: (0, docker_1.getDockerBuildDefaultScript)(((_d = buildConfig.docker) === null || _d === void 0 ? void 0 : _d.type) === "nginx" ? "ensureNginxDockerfile" : ""),
350581
+ variables: {}
350515
350582
  }
350516
- }) : null;
350517
- return __spreadArray(__spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
350518
- script: [((_d = buildConfig.docker) === null || _d === void 0 ? void 0 : _d.type) === "nginx" ? "ensureNginxDockerfile" : "" // e.g. custom,
350519
- ].filter(Boolean),
350520
- variables: {},
350521
- needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
350522
- })] : []), false), __read((0, sbom_2.sbomDeactivated)(context) ? [] : [(0, sbom_1.createSbomBuildJob)(context)]), false);
350583
+ });
350523
350584
  };
350524
350585
  exports.createCustomBuildJobs = createCustomBuildJobs;
350525
350586
 
@@ -350701,39 +350762,8 @@ var __rest = this && this.__rest || function (s, e) {
350701
350762
  }
350702
350763
  return t;
350703
350764
  };
350704
- var __read = this && this.__read || function (o, n) {
350705
- var m = typeof Symbol === "function" && o[Symbol.iterator];
350706
- if (!m) return o;
350707
- var i = m.call(o),
350708
- r,
350709
- ar = [],
350710
- e;
350711
- try {
350712
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
350713
- } catch (error) {
350714
- e = {
350715
- error: error
350716
- };
350717
- } finally {
350718
- try {
350719
- if (r && !r.done && (m = i["return"])) m.call(i);
350720
- } finally {
350721
- if (e) throw e.error;
350722
- }
350723
- }
350724
- return ar;
350725
- };
350726
- var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
350727
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
350728
- if (ar || !(i in from)) {
350729
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
350730
- ar[i] = from[i];
350731
- }
350732
- }
350733
- return to.concat(ar || Array.prototype.slice.call(from));
350734
- };
350735
350765
  exports.__esModule = true;
350736
- exports.createDockerBuildJobDefault = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
350766
+ exports.getDockerBuildDefaultScript = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
350737
350767
  var lodash_1 = __nccwpck_require__(23255);
350738
350768
  var deploy_1 = __nccwpck_require__(90223);
350739
350769
  var runner_1 = __nccwpck_require__(55071);
@@ -350807,14 +350837,10 @@ var createDockerBuildJobBase = function (context, _a) {
350807
350837
  };
350808
350838
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
350809
350839
  exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
350810
- var createDockerBuildJobDefault = function (context, _a) {
350811
- var script = _a.script,
350812
- def = __rest(_a, ["script"]);
350813
- return (0, exports.createDockerBuildJobBase)(context, __assign({
350814
- script: __spreadArray(__spreadArray([], __read(script || []), false), [exports.gitlabDockerLogin, "docker version", "docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1", "docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE", "docker push $DOCKER_CACHE_IMAGE"], false)
350815
- }, def));
350840
+ var getDockerBuildDefaultScript = function (ensureDockerFileScript) {
350841
+ return [ensureDockerFileScript, exports.gitlabDockerLogin, "docker version", "docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1", "docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE", "docker push $DOCKER_CACHE_IMAGE"].filter(Boolean);
350816
350842
  };
350817
- exports.createDockerBuildJobDefault = createDockerBuildJobDefault;
350843
+ exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
350818
350844
 
350819
350845
  /***/ }),
350820
350846
 
@@ -350951,18 +350977,15 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
350951
350977
  };
350952
350978
  exports.__esModule = true;
350953
350979
  exports.createNodeBuildJobs = void 0;
350980
+ var path_1 = __nccwpck_require__(71017);
350981
+ var runner_1 = __nccwpck_require__(55071);
350954
350982
  var utils_1 = __nccwpck_require__(37461);
350955
- var constants_1 = __nccwpck_require__(11542);
350956
- var createBuildJob_1 = __nccwpck_require__(58063);
350983
+ var base_1 = __nccwpck_require__(18035);
350957
350984
  var docker_1 = __nccwpck_require__(33219);
350958
- var path_1 = __nccwpck_require__(71017);
350959
350985
  var types_1 = __nccwpck_require__(71197);
350960
350986
  var cache_1 = __nccwpck_require__(54303);
350961
- var constants_2 = __nccwpck_require__(69284);
350987
+ var constants_1 = __nccwpck_require__(69284);
350962
350988
  var yarn_1 = __nccwpck_require__(10464);
350963
- var runner_1 = __nccwpck_require__(55071);
350964
- var sbom_1 = __nccwpck_require__(9927);
350965
- var sbom_2 = __nccwpck_require__(65928);
350966
350989
  var createNodeBuildJobs = function (context) {
350967
350990
  var _a, _b, _c, _d, _e, _f, _g;
350968
350991
  var buildConfig = context.componentConfig.build;
@@ -350971,31 +350994,32 @@ var createNodeBuildJobs = function (context) {
350971
350994
  }
350972
350995
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
350973
350996
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
350974
- var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
350975
- image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
350976
- variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
350977
- cache: __spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
350978
- script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
350979
- artifacts: {
350980
- paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((_e = (_d = buildConfig.artifactsPaths) === null || _d === void 0 ? void 0 : _d.map(function (path) {
350981
- return (0, path_1.join)(context.componentConfig.dir, path);
350982
- })) !== null && _e !== void 0 ? _e : []), false),
350983
- expire_in: "1 day"
350984
- },
350985
- jobTags: buildConfig.jobTags
350986
- }) : null;
350987
- return __spreadArray(__spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
350988
- script: [buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"],
350989
- cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
350990
- variables: {
350991
- // only required for non static
350992
- DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
350993
- DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
350994
- return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
350995
- })) === null || _g === void 0 ? void 0 : _g.join("\n")
350996
- },
350997
- needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
350998
- })] : []), false), __read((0, sbom_2.sbomDeactivated)(context) ? [] : [(0, sbom_1.createSbomBuildJob)(context)]), false);
350997
+ return (0, base_1.createBuildJobs)(context, {
350998
+ appBuild: buildConfig.buildCommand !== null ? {
350999
+ image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
351000
+ variables: __assign({}, constants_1.NODE_RUNNER_BUILD_VARIABLES),
351001
+ cache: __spreadArray(__spreadArray(__spreadArray([], __read((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
351002
+ script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
351003
+ artifacts: {
351004
+ paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((_e = (_d = buildConfig.artifactsPaths) === null || _d === void 0 ? void 0 : _d.map(function (path) {
351005
+ return (0, path_1.join)(context.componentConfig.dir, path);
351006
+ })) !== null && _e !== void 0 ? _e : []), false),
351007
+ expire_in: "1 day"
351008
+ },
351009
+ jobTags: buildConfig.jobTags
351010
+ } : undefined,
351011
+ dockerBuild: {
351012
+ script: (0, docker_1.getDockerBuildDefaultScript)(buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"),
351013
+ cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
351014
+ variables: {
351015
+ // only required for non static
351016
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
351017
+ DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
351018
+ return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
351019
+ })) === null || _g === void 0 ? void 0 : _g.join("\n")
351020
+ }
351021
+ }
351022
+ });
350999
351023
  };
351000
351024
  exports.createNodeBuildJobs = createNodeBuildJobs;
351001
351025
 
@@ -351215,14 +351239,11 @@ exports.__esModule = true;
351215
351239
  exports.createMeteorBuildJobs = void 0;
351216
351240
  var path_1 = __nccwpck_require__(71017);
351217
351241
  var runner_1 = __nccwpck_require__(55071);
351218
- var constants_1 = __nccwpck_require__(11542);
351219
- var createBuildJob_1 = __nccwpck_require__(58063);
351242
+ var base_1 = __nccwpck_require__(18035);
351220
351243
  var docker_1 = __nccwpck_require__(33219);
351221
351244
  var types_1 = __nccwpck_require__(71197);
351222
351245
  var cache_1 = __nccwpck_require__(54303);
351223
351246
  var yarn_1 = __nccwpck_require__(10464);
351224
- var sbom_1 = __nccwpck_require__(65928);
351225
- var sbom_2 = __nccwpck_require__(9927);
351226
351247
  var getMeteorCache = function (context) {
351227
351248
  return [{
351228
351249
  key: context.componentName + "meteor-build-cache",
@@ -351236,24 +351257,25 @@ var createMeteorBuildJobs = function (context) {
351236
351257
  throw new Error("deploy config is not meteor");
351237
351258
  }
351238
351259
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
351239
- var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
351240
- cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
351241
- image: (0, runner_1.getRunnerImage)("jobs-meteor"),
351242
- variables: {
351243
- METEOR_DISABLE_OPTIMISTIC_CACHING: "1"
351244
- },
351245
- 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),
351246
- artifacts: {
351247
- paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
351260
+ return (0, base_1.createBuildJobs)(context, {
351261
+ appBuild: buildConfig.buildCommand !== null ? {
351262
+ cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
351263
+ image: (0, runner_1.getRunnerImage)("jobs-meteor"),
351264
+ variables: {
351265
+ METEOR_DISABLE_OPTIMISTIC_CACHING: "1"
351266
+ },
351267
+ 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),
351268
+ artifacts: {
351269
+ paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
351270
+ }
351271
+ } : undefined,
351272
+ dockerBuild: {
351273
+ script: (0, docker_1.getDockerBuildDefaultScript)("ensureMeteorDockerfile"),
351274
+ variables: {
351275
+ METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : ""
351276
+ }
351248
351277
  }
351249
- }) : null;
351250
- return __spreadArray(__spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [(0, docker_1.createDockerBuildJobDefault)(context, {
351251
- script: ["ensureMeteorDockerfile"],
351252
- variables: {
351253
- METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : ""
351254
- },
351255
- needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
351256
- })], false), __read((0, sbom_1.sbomDeactivated)(context) ? [] : [(0, sbom_2.createSbomBuildJob)(context)]), false);
351278
+ });
351257
351279
  };
351258
351280
  exports.createMeteorBuildJobs = createMeteorBuildJobs;
351259
351281
 
@@ -351479,21 +351501,11 @@ var __read = this && this.__read || function (o, n) {
351479
351501
  }
351480
351502
  return ar;
351481
351503
  };
351482
- var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
351483
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
351484
- if (ar || !(i in from)) {
351485
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
351486
- ar[i] = from[i];
351487
- }
351488
- }
351489
- return to.concat(ar || Array.prototype.slice.call(from));
351490
- };
351491
351504
  exports.__esModule = true;
351492
351505
  exports.createRailsBuildJobs = void 0;
351493
- var types_1 = __nccwpck_require__(71197);
351506
+ var base_1 = __nccwpck_require__(18035);
351494
351507
  var docker_1 = __nccwpck_require__(33219);
351495
- var sbom_1 = __nccwpck_require__(65928);
351496
- var sbom_2 = __nccwpck_require__(9927);
351508
+ var types_1 = __nccwpck_require__(71197);
351497
351509
  var createRailsBuildJobs = function (context) {
351498
351510
  var _a, _b, _c;
351499
351511
  var buildConfig = context.componentConfig.build;
@@ -351508,13 +351520,16 @@ var createRailsBuildJobs = function (context) {
351508
351520
  v = _b[1];
351509
351521
  return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
351510
351522
  }).join(" ");
351511
- return __spreadArray([(0, docker_1.createDockerBuildJobBase)(context, {
351512
- variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
351513
- // custom script
351514
- script: [docker_1.gitlabDockerLogin, "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",
351515
- // replace private git ssh gem sources with https to make bundler with credentials via env var work
351516
- "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 : "")]
351517
- })], __read((0, sbom_1.sbomDeactivated)(context) ? [] : [(0, sbom_2.createSbomBuildJob)(context)]), false);
351523
+ return (0, base_1.createBuildJobs)(context, {
351524
+ appBuild: undefined,
351525
+ dockerBuild: {
351526
+ variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
351527
+ // custom script
351528
+ script: [docker_1.gitlabDockerLogin, "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",
351529
+ // replace private git ssh gem sources with https to make bundler with credentials via env var work
351530
+ "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 : "")]
351531
+ }
351532
+ });
351518
351533
  };
351519
351534
  exports.createRailsBuildJobs = createRailsBuildJobs;
351520
351535
 
@@ -351895,7 +351910,7 @@ exports.readConfigSync = readConfigSync;
351895
351910
 
351896
351911
  exports.__esModule = true;
351897
351912
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
351898
- exports.PIPELINE_IMAGE_TAG = "main-e5cd9fd4" || 0;
351913
+ exports.PIPELINE_IMAGE_TAG = "main-79fbaf60" || 0;
351899
351914
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
351900
351915
 
351901
351916
  /***/ }),
@@ -353197,7 +353212,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
353197
353212
  return to.concat(ar || Array.prototype.slice.call(from));
353198
353213
  };
353199
353214
  exports.__esModule = true;
353200
- exports.getBaseDeploymentJob = exports.DEPLOY_JOB_NAME = void 0;
353215
+ exports.createDeployJob = exports.DEPLOY_JOB_NAME = void 0;
353201
353216
  var docker_1 = __nccwpck_require__(33219);
353202
353217
  var sbom_1 = __nccwpck_require__(9927);
353203
353218
  var sbom_2 = __nccwpck_require__(65928);
@@ -353205,7 +353220,7 @@ var utils_1 = __nccwpck_require__(92757);
353205
353220
  var stop_1 = __nccwpck_require__(58297);
353206
353221
  var variables_1 = __nccwpck_require__(67040);
353207
353222
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
353208
- var getBaseDeploymentJob = function (context) {
353223
+ var createDeployJob = function (context, jobDefinition) {
353209
353224
  var _a, _b, _c, _d;
353210
353225
  var hasDocker = (0, docker_1.requiresDockerBuild)(context);
353211
353226
  var isStoppable = (0, utils_1.contextIsStoppable)(context);
@@ -353219,6 +353234,11 @@ var getBaseDeploymentJob = function (context) {
353219
353234
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
353220
353235
  return {
353221
353236
  name: exports.DEPLOY_JOB_NAME,
353237
+ script: jobDefinition.script,
353238
+ image: jobDefinition.image,
353239
+ cache: jobDefinition.cache,
353240
+ artifacts: jobDefinition.artifacts,
353241
+ services: jobDefinition.services,
353222
353242
  envMode: "stagePerEnv",
353223
353243
  needs: __spreadArray(__spreadArray([], __read((0, sbom_2.sbomDeactivated)(context) ? [] : [{
353224
353244
  job: sbom_1.SBOM_BUILD_JOB_NAME,
@@ -353245,7 +353265,7 @@ var getBaseDeploymentJob = function (context) {
353245
353265
  }],
353246
353266
  allow_failure: whenDeploy === "manual" ? true : false,
353247
353267
  stage: "deploy",
353248
- variables: __assign(__assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), 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 : {} : {}),
353268
+ variables: __assign(__assign(__assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), 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),
353249
353269
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
353250
353270
  on_stop: stop_1.STOP_JOB_NAME,
353251
353271
  auto_stop_in: autoStop
@@ -353253,7 +353273,7 @@ var getBaseDeploymentJob = function (context) {
353253
353273
  jobTags: context.componentConfig.deploy ? context.componentConfig.deploy.jobTags : undefined
353254
353274
  };
353255
353275
  };
353256
- exports.getBaseDeploymentJob = getBaseDeploymentJob;
353276
+ exports.createDeployJob = createDeployJob;
353257
353277
 
353258
353278
  /***/ }),
353259
353279
 
@@ -353263,25 +353283,46 @@ exports.getBaseDeploymentJob = getBaseDeploymentJob;
353263
353283
  "use strict";
353264
353284
 
353265
353285
 
353266
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
353267
- if (k2 === undefined) k2 = k;
353268
- Object.defineProperty(o, k2, {
353269
- enumerable: true,
353270
- get: function () {
353271
- return m[k];
353286
+ var __read = this && this.__read || function (o, n) {
353287
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
353288
+ if (!m) return o;
353289
+ var i = m.call(o),
353290
+ r,
353291
+ ar = [],
353292
+ e;
353293
+ try {
353294
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
353295
+ } catch (error) {
353296
+ e = {
353297
+ error: error
353298
+ };
353299
+ } finally {
353300
+ try {
353301
+ if (r && !r.done && (m = i["return"])) m.call(i);
353302
+ } finally {
353303
+ if (e) throw e.error;
353272
353304
  }
353273
- });
353274
- } : function (o, m, k, k2) {
353275
- if (k2 === undefined) k2 = k;
353276
- o[k2] = m[k];
353277
- });
353278
- var __exportStar = this && this.__exportStar || function (m, exports) {
353279
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
353305
+ }
353306
+ return ar;
353307
+ };
353308
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
353309
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
353310
+ if (ar || !(i in from)) {
353311
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
353312
+ ar[i] = from[i];
353313
+ }
353314
+ }
353315
+ return to.concat(ar || Array.prototype.slice.call(from));
353280
353316
  };
353281
353317
  exports.__esModule = true;
353282
- __exportStar(__nccwpck_require__(26166), exports);
353283
- __exportStar(__nccwpck_require__(99567), exports);
353284
- __exportStar(__nccwpck_require__(58297), exports);
353318
+ exports.createDeployementJobs = void 0;
353319
+ var deploy_1 = __nccwpck_require__(26166);
353320
+ var rollback_1 = __nccwpck_require__(99567);
353321
+ var stop_1 = __nccwpck_require__(58297);
353322
+ var createDeployementJobs = function (context, definitions) {
353323
+ return __spreadArray(__spreadArray([(0, deploy_1.createDeployJob)(context, definitions.deploy)], __read(definitions.stop ? [(0, stop_1.createStopJob)(context, definitions.stop)] : []), false), __read(definitions.rollback ? [(0, rollback_1.createRollbackJob)(context, definitions.rollback)] : []), false);
353324
+ };
353325
+ exports.createDeployementJobs = createDeployementJobs;
353285
353326
 
353286
353327
  /***/ }),
353287
353328
 
@@ -353302,28 +353343,30 @@ var __assign = this && this.__assign || function () {
353302
353343
  return __assign.apply(this, arguments);
353303
353344
  };
353304
353345
  exports.__esModule = true;
353305
- exports.getBaseRollbackJob = exports.ROLLBACK_JOB_NAME = void 0;
353346
+ exports.createRollbackJob = exports.ROLLBACK_JOB_NAME = void 0;
353306
353347
  var variables_1 = __nccwpck_require__(67040);
353307
353348
  exports.ROLLBACK_JOB_NAME = "↩️ Rollback ⚠️";
353308
- var getBaseRollbackJob = function (context) {
353349
+ var createRollbackJob = function (context, jobDefinition) {
353309
353350
  return {
353310
353351
  name: exports.ROLLBACK_JOB_NAME,
353352
+ image: jobDefinition.image,
353311
353353
  envMode: "stagePerEnv",
353312
353354
  needs: [],
353313
353355
  rules: [{
353314
353356
  when: "manual",
353315
353357
  allow_failure: true
353316
353358
  }],
353317
- variables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
353359
+ variables: __assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
353318
353360
  GIT_STRATEGY: "none"
353319
- }),
353361
+ }), jobDefinition.variables),
353320
353362
  stage: "rollback",
353321
353363
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
353322
353364
  action: "access"
353323
- })
353365
+ }),
353366
+ script: jobDefinition.script
353324
353367
  };
353325
353368
  };
353326
- exports.getBaseRollbackJob = getBaseRollbackJob;
353369
+ exports.createRollbackJob = createRollbackJob;
353327
353370
 
353328
353371
  /***/ }),
353329
353372
 
@@ -353344,12 +353387,13 @@ var __assign = this && this.__assign || function () {
353344
353387
  return __assign.apply(this, arguments);
353345
353388
  };
353346
353389
  exports.__esModule = true;
353347
- exports.getBaseDeploymentStopJob = exports.STOP_JOB_NAME = void 0;
353390
+ exports.createStopJob = exports.STOP_JOB_NAME = void 0;
353348
353391
  var variables_1 = __nccwpck_require__(67040);
353349
353392
  exports.STOP_JOB_NAME = "🛑 Stop ⚠️";
353350
- var getBaseDeploymentStopJob = function (context) {
353393
+ var createStopJob = function (context, jobDefinition) {
353351
353394
  return {
353352
353395
  name: exports.STOP_JOB_NAME,
353396
+ image: jobDefinition.image,
353353
353397
  envMode: "stagePerEnv",
353354
353398
  needs: [],
353355
353399
  rules: [{
@@ -353360,16 +353404,17 @@ var getBaseDeploymentStopJob = function (context) {
353360
353404
  when: "manual",
353361
353405
  allow_failure: true
353362
353406
  }],
353363
- variables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
353407
+ variables: __assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
353364
353408
  GIT_STRATEGY: "none"
353365
- }),
353409
+ }), jobDefinition.variables),
353366
353410
  stage: "stop",
353367
353411
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
353368
353412
  action: "stop"
353369
- })
353413
+ }),
353414
+ script: jobDefinition.script
353370
353415
  };
353371
353416
  };
353372
- exports.getBaseDeploymentStopJob = getBaseDeploymentStopJob;
353417
+ exports.createStopJob = createStopJob;
353373
353418
 
353374
353419
  /***/ }),
353375
353420
 
@@ -353445,14 +353490,14 @@ var _1 = __nccwpck_require__(81344);
353445
353490
  var docker_1 = __nccwpck_require__(33219);
353446
353491
  var getLabels_1 = __nccwpck_require__(30486);
353447
353492
  var runner_1 = __nccwpck_require__(55071);
353493
+ var gitlab_1 = __nccwpck_require__(84997);
353448
353494
  var base_1 = __nccwpck_require__(82866);
353495
+ var sbom_1 = __nccwpck_require__(65928);
353449
353496
  var types_1 = __nccwpck_require__(63109);
353450
- var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
353497
+ var createArgsString_1 = __nccwpck_require__(8686);
353451
353498
  var database_1 = __nccwpck_require__(41384);
353452
- var gitlab_1 = __nccwpck_require__(84997);
353499
+ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
353453
353500
  var jobName_1 = __nccwpck_require__(77311);
353454
- var createArgsString_1 = __nccwpck_require__(8686);
353455
- var sbom_1 = __nccwpck_require__(65928);
353456
353501
  var setExtraVarsScripts = function (deployConfig) {
353457
353502
  return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
353458
353503
  };
@@ -353466,7 +353511,6 @@ var createGoogleCloudRunDeployJobs = function (context) {
353466
353511
  // should not happen
353467
353512
  throw new Error("deploy config is wrong");
353468
353513
  }
353469
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
353470
353514
  var fullAppName = "".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName);
353471
353515
  var dockerUrl = "".concat(deployConfig.region, "-docker.pkg.dev/").concat(deployConfig.projectId, "/catladder-deploy/").concat(fullAppName);
353472
353516
  var gcloudImageName = "".concat(dockerUrl, "/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG");
@@ -353616,27 +353660,30 @@ var createGoogleCloudRunDeployJobs = function (context) {
353616
353660
  name = _b[0];
353617
353661
  return "gcloud run services delete ".concat(serviceName, "-").concat(name, " ").concat(commonArgsString);
353618
353662
  })), false), __read(getDeleteSchedulesScripts()), false), __read(getDeleteJobsScripts()), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false);
353619
- return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
353620
- artifacts: {
353621
- paths: ["____envvars.yaml"]
353622
- },
353623
- variables: {
353624
- CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
353625
- ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
353626
- lineWidth: -1,
353627
- quotingType: "'",
353628
- forceQuotes: true
353629
- })
353630
- },
353631
- image: (0, runner_1.getRunnerImage)("gcloud"),
353632
- script: deployScripts
353633
- }), (0, lodash_1.merge)({}, (0, base_1.getBaseDeploymentStopJob)(context), {
353634
- image: (0, runner_1.getRunnerImage)("gcloud"),
353635
- variables: {
353636
- CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
353637
- },
353638
- script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
353639
- })];
353663
+ return (0, base_1.createDeployementJobs)(context, {
353664
+ deploy: (0, lodash_1.merge)((0, docker_1.getDockerJobBaseProps)(context), {
353665
+ artifacts: {
353666
+ paths: ["____envvars.yaml"]
353667
+ },
353668
+ variables: {
353669
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
353670
+ ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
353671
+ lineWidth: -1,
353672
+ quotingType: "'",
353673
+ forceQuotes: true
353674
+ })
353675
+ },
353676
+ image: (0, runner_1.getRunnerImage)("gcloud"),
353677
+ script: deployScripts
353678
+ }),
353679
+ stop: {
353680
+ image: (0, runner_1.getRunnerImage)("gcloud"),
353681
+ variables: {
353682
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
353683
+ },
353684
+ script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
353685
+ }
353686
+ });
353640
353687
  };
353641
353688
  exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
353642
353689
 
@@ -353990,12 +354037,11 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
353990
354037
  };
353991
354038
  exports.__esModule = true;
353992
354039
  exports.createCustomDeployJobs = void 0;
353993
- var lodash_1 = __nccwpck_require__(23255);
353994
354040
  var yarn_1 = __nccwpck_require__(10464);
353995
354041
  var runner_1 = __nccwpck_require__(55071);
353996
354042
  var base_1 = __nccwpck_require__(82866);
353997
- var types_1 = __nccwpck_require__(63109);
353998
354043
  var sbom_1 = __nccwpck_require__(65928);
354044
+ var types_1 = __nccwpck_require__(63109);
353999
354045
  var createCustomDeployJobs = function (context) {
354000
354046
  var _a, _b, _c;
354001
354047
  var deployConfig = context.componentConfig.deploy;
@@ -354006,19 +354052,23 @@ var createCustomDeployJobs = function (context) {
354006
354052
  // should not happen
354007
354053
  throw new Error("deploy config is not custom");
354008
354054
  }
354009
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
354010
354055
  // FIXME: custom deploy currently assumes yarn-based project
354011
354056
  var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
354012
354057
  noCustomPostInstall: true
354013
354058
  });
354014
- return __spreadArray([(0, lodash_1.merge)({}, baseDeploymentJob, {
354015
- image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
354016
- cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
354017
- 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)
354018
- })], __read(deployConfig.stopScript ? [(0, lodash_1.merge)({}, (0, base_1.getBaseDeploymentStopJob)(context), {
354019
- image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
354020
- script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
354021
- })] : []), false);
354059
+ return (0, base_1.createDeployementJobs)(context, {
354060
+ deploy: {
354061
+ image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
354062
+ cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
354063
+ 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),
354064
+ variables: {}
354065
+ },
354066
+ stop: deployConfig.stopScript ? {
354067
+ image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
354068
+ script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
354069
+ variables: {}
354070
+ } : undefined
354071
+ });
354022
354072
  };
354023
354073
  exports.createCustomDeployJobs = createCustomDeployJobs;
354024
354074
 
@@ -354049,14 +354099,23 @@ exports.CUSTOM_DEPLOY_TYPE = {
354049
354099
  /***/ }),
354050
354100
 
354051
354101
  /***/ 27790:
354052
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
354102
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
354053
354103
 
354054
354104
  "use strict";
354055
354105
 
354056
354106
 
354107
+ var __assign = this && this.__assign || function () {
354108
+ __assign = Object.assign || function (t) {
354109
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
354110
+ s = arguments[i];
354111
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
354112
+ }
354113
+ return t;
354114
+ };
354115
+ return __assign.apply(this, arguments);
354116
+ };
354057
354117
  exports.__esModule = true;
354058
354118
  exports.createDockerTagDeployJobs = void 0;
354059
- var lodash_1 = __nccwpck_require__(23255);
354060
354119
  var docker_1 = __nccwpck_require__(33219);
354061
354120
  var base_1 = __nccwpck_require__(82866);
354062
354121
  var types_1 = __nccwpck_require__(63109);
@@ -354069,11 +354128,12 @@ var createDockerTagDeployJobs = function (context) {
354069
354128
  // should not happen
354070
354129
  throw new Error("deploy config is not dockerTag");
354071
354130
  }
354072
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
354073
354131
  var tag = deployConfig.tag;
354074
- return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
354075
- script: [docker_1.gitlabDockerLogin, "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, "\"")]
354076
- })];
354132
+ return (0, base_1.createDeployementJobs)(context, {
354133
+ deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)(context)), {
354134
+ script: [docker_1.gitlabDockerLogin, "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, "\"")]
354135
+ })
354136
+ });
354077
354137
  };
354078
354138
  exports.createDockerTagDeployJobs = createDockerTagDeployJobs;
354079
354139
 
@@ -354286,13 +354346,12 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
354286
354346
  exports.__esModule = true;
354287
354347
  exports.createKubernetesDeployJobs = void 0;
354288
354348
  var js_yaml_1 = __nccwpck_require__(3618);
354289
- var lodash_1 = __nccwpck_require__(23255);
354290
354349
  var __1 = __nccwpck_require__(25355);
354291
354350
  var runner_1 = __nccwpck_require__(55071);
354292
354351
  var base_1 = __nccwpck_require__(82866);
354352
+ var sbom_1 = __nccwpck_require__(65928);
354293
354353
  var types_1 = __nccwpck_require__(63109);
354294
354354
  var kubeValues_1 = __nccwpck_require__(1061);
354295
- var sbom_1 = __nccwpck_require__(65928);
354296
354355
  var createKubernetesDeployJobs = function (context) {
354297
354356
  var _a, _b, _c;
354298
354357
  var deployConfig = context.componentConfig.deploy;
@@ -354321,18 +354380,19 @@ var createKubernetesDeployJobs = function (context) {
354321
354380
  BUILD_ID: (_c = context.commitInfo) === null || _c === void 0 ? void 0 : _c.buildId
354322
354381
  })
354323
354382
  };
354324
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
354325
- var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
354326
- var baseRollbackJob = (0, base_1.getBaseRollbackJob)(context);
354327
354383
  var clusterName = "kube-".concat(context.environment.fullName);
354328
354384
  var connectContext = ["kubectl config set-cluster \"".concat(clusterName, "\" --server=\"$").concat((0, __1.getSecretVarNameForContext)(context, "KUBE_URL"), "\" --certificate-authority <(echo $").concat((0, __1.getSecretVarNameForContext)(context, "KUBE_CA_PEM"), " | base64 -d) --embed-certs=true"), "kubectl config set-credentials \"".concat(clusterName, "\" --token=\"$").concat((0, __1.getSecretVarNameForContext)(context, "KUBE_TOKEN"), "\""), "kubectl config set-context \"".concat(clusterName, "\" --cluster=\"").concat(clusterName, "\" --user=\"").concat(clusterName, "\" --namespace=\"").concat(context.environment.envVars.KUBE_NAMESPACE, "\""), "kubectl config use-context \"".concat(clusterName, "\"")];
354329
- return [(0, lodash_1.merge)({}, baseDeploymentJob, shared, {
354330
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesCreateSecret", "kubernetesDeploy"], false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false), ["echo deployment successful 😻"], false)
354331
- }), (0, lodash_1.merge)({}, baseStopJob, shared, {
354332
- script: __spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesDelete"], false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
354333
- }), (0, lodash_1.merge)({}, baseRollbackJob, shared, {
354334
- script: __spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesRollback"], false)
354335
- })];
354385
+ return (0, base_1.createDeployementJobs)(context, {
354386
+ deploy: __assign(__assign({}, shared), {
354387
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesCreateSecret", "kubernetesDeploy"], false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false), ["echo deployment successful 😻"], false)
354388
+ }),
354389
+ stop: __assign(__assign({}, shared), {
354390
+ script: __spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesDelete"], false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
354391
+ }),
354392
+ rollback: __assign(__assign({}, shared), {
354393
+ script: __spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesRollback"], false)
354394
+ })
354395
+ });
354336
354396
  };
354337
354397
  exports.createKubernetesDeployJobs = createKubernetesDeployJobs;
354338
354398