@catladder/cli 0.0.0-main-e5cd9fd4 → 0.0.0-main-93b724a8

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.
@@ -39138,6 +39138,99 @@ exports.RUNNER_BUILD_RESOURCE_VARIABLES = {
39138
39138
 
39139
39139
  /***/ }),
39140
39140
 
39141
+ /***/ 7267:
39142
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
39143
+
39144
+ "use strict";
39145
+
39146
+
39147
+ var __assign = this && this.__assign || function () {
39148
+ __assign = Object.assign || function (t) {
39149
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
39150
+ s = arguments[i];
39151
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
39152
+ }
39153
+ return t;
39154
+ };
39155
+ return __assign.apply(this, arguments);
39156
+ };
39157
+ var __rest = this && this.__rest || function (s, e) {
39158
+ var t = {};
39159
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
39160
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
39161
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
39162
+ }
39163
+ return t;
39164
+ };
39165
+ var __read = this && this.__read || function (o, n) {
39166
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
39167
+ if (!m) return o;
39168
+ var i = m.call(o),
39169
+ r,
39170
+ ar = [],
39171
+ e;
39172
+ try {
39173
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
39174
+ } catch (error) {
39175
+ e = {
39176
+ error: error
39177
+ };
39178
+ } finally {
39179
+ try {
39180
+ if (r && !r.done && (m = i["return"])) m.call(i);
39181
+ } finally {
39182
+ if (e) throw e.error;
39183
+ }
39184
+ }
39185
+ return ar;
39186
+ };
39187
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
39188
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39189
+ if (ar || !(i in from)) {
39190
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
39191
+ ar[i] = from[i];
39192
+ }
39193
+ }
39194
+ return to.concat(ar || Array.prototype.slice.call(from));
39195
+ };
39196
+ exports.__esModule = true;
39197
+ exports.createAppBuildJob = void 0;
39198
+ var lodash_1 = __nccwpck_require__(3255);
39199
+ var path_1 = __nccwpck_require__(1017);
39200
+ var __1 = __nccwpck_require__(5355);
39201
+ var utils_1 = __nccwpck_require__(7461);
39202
+ var yarn_1 = __nccwpck_require__(464);
39203
+ var constants_1 = __nccwpck_require__(1542);
39204
+ var writeBuildInfo_1 = __nccwpck_require__(1754);
39205
+ var writeDotEnv_1 = __nccwpck_require__(1298);
39206
+ var createAppBuildJob = function (context, _a) {
39207
+ var _b, _c, _d, _e;
39208
+ var script = _a.script,
39209
+ variables = _a.variables,
39210
+ def = __rest(_a, ["script", "variables"]);
39211
+ return (0, lodash_1.merge)({
39212
+ name: constants_1.APP_BUILD_JOB_NAME,
39213
+ envMode: "jobPerEnv",
39214
+ stage: "build",
39215
+ image: (0, __1.getRunnerImage)("jobs-default"),
39216
+ needs: [],
39217
+ cache: [],
39218
+ 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 : {}),
39219
+ 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),
39220
+ artifacts: {
39221
+ paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
39222
+ reports: {
39223
+ 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) {
39224
+ return (0, path_1.join)(context.componentConfig.dir, p);
39225
+ })
39226
+ }
39227
+ }
39228
+ }, def);
39229
+ };
39230
+ exports.createAppBuildJob = createAppBuildJob;
39231
+
39232
+ /***/ }),
39233
+
39141
39234
  /***/ 5669:
39142
39235
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
39143
39236
 
@@ -39208,7 +39301,7 @@ exports.createArtifactsConfig = createArtifactsConfig;
39208
39301
 
39209
39302
  /***/ }),
39210
39303
 
39211
- /***/ 8063:
39304
+ /***/ 8035:
39212
39305
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
39213
39306
 
39214
39307
  "use strict";
@@ -39224,14 +39317,6 @@ var __assign = this && this.__assign || function () {
39224
39317
  };
39225
39318
  return __assign.apply(this, arguments);
39226
39319
  };
39227
- var __rest = this && this.__rest || function (s, e) {
39228
- var t = {};
39229
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
39230
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
39231
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
39232
- }
39233
- return t;
39234
- };
39235
39320
  var __read = this && this.__read || function (o, n) {
39236
39321
  var m = typeof Symbol === "function" && o[Symbol.iterator];
39237
39322
  if (!m) return o;
@@ -39264,40 +39349,19 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
39264
39349
  return to.concat(ar || Array.prototype.slice.call(from));
39265
39350
  };
39266
39351
  exports.__esModule = true;
39267
- exports.createBuildJob = void 0;
39268
- var lodash_1 = __nccwpck_require__(3255);
39269
- var path_1 = __nccwpck_require__(1017);
39270
- var __1 = __nccwpck_require__(5355);
39271
- var utils_1 = __nccwpck_require__(7461);
39272
- var yarn_1 = __nccwpck_require__(464);
39352
+ exports.createBuildJobs = void 0;
39353
+ var sbom_1 = __nccwpck_require__(5928);
39354
+ var docker_1 = __nccwpck_require__(3219);
39355
+ var sbom_2 = __nccwpck_require__(9927);
39273
39356
  var constants_1 = __nccwpck_require__(1542);
39274
- var writeBuildInfo_1 = __nccwpck_require__(1754);
39275
- var writeDotEnv_1 = __nccwpck_require__(1298);
39276
- var createBuildJob = function (context, _a) {
39277
- var _b, _c, _d, _e;
39278
- var script = _a.script,
39279
- variables = _a.variables,
39280
- def = __rest(_a, ["script", "variables"]);
39281
- return (0, lodash_1.merge)({
39282
- name: constants_1.APP_BUILD_JOB_NAME,
39283
- envMode: "jobPerEnv",
39284
- stage: "build",
39285
- image: (0, __1.getRunnerImage)("jobs-default"),
39286
- needs: [],
39287
- cache: [],
39288
- 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 : {}),
39289
- 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),
39290
- artifacts: {
39291
- paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
39292
- reports: {
39293
- 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) {
39294
- return (0, path_1.join)(context.componentConfig.dir, p);
39295
- })
39296
- }
39297
- }
39298
- }, def);
39357
+ var createAppBuildJob_1 = __nccwpck_require__(7267);
39358
+ var createBuildJobs = function (context, definitions) {
39359
+ var _a;
39360
+ 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), {
39361
+ needs: __spreadArray(__spreadArray([], __read((_a = definitions.dockerBuild.needs) !== null && _a !== void 0 ? _a : []), false), __read(definitions.appBuild ? [constants_1.APP_BUILD_JOB_NAME] : []), false)
39362
+ }))] : []), false), __read((0, sbom_1.sbomDeactivated)(context) ? [] : [(0, sbom_2.createSbomBuildJob)(context)]), false);
39299
39363
  };
39300
- exports.createBuildJob = createBuildJob;
39364
+ exports.createBuildJobs = createBuildJobs;
39301
39365
 
39302
39366
  /***/ }),
39303
39367
 
@@ -39418,12 +39482,9 @@ exports.__esModule = true;
39418
39482
  exports.createCustomBuildJobs = void 0;
39419
39483
  var path_1 = __nccwpck_require__(1017);
39420
39484
  var utils_1 = __nccwpck_require__(7461);
39421
- var constants_1 = __nccwpck_require__(1542);
39422
- var createBuildJob_1 = __nccwpck_require__(8063);
39423
39485
  var docker_1 = __nccwpck_require__(3219);
39424
39486
  var types_1 = __nccwpck_require__(1197);
39425
- var sbom_1 = __nccwpck_require__(9927);
39426
- var sbom_2 = __nccwpck_require__(5928);
39487
+ var base_1 = __nccwpck_require__(8035);
39427
39488
  var RUNNER_BUILD_VARIABLES = {
39428
39489
  KUBERNETES_CPU_REQUEST: "0.5",
39429
39490
  KUBERNETES_CPU_LIMIT: "2",
@@ -39436,25 +39497,25 @@ var createCustomBuildJobs = function (context) {
39436
39497
  if (!(0, types_1.isOfBuildType)(buildConfig, "custom")) {
39437
39498
  throw new Error("deploy config is not custom");
39438
39499
  }
39439
- var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
39440
- image: buildConfig.jobImage,
39441
- variables: __assign({}, RUNNER_BUILD_VARIABLES),
39442
- cache: buildConfig.jobCache,
39443
- services: buildConfig.jobServices,
39444
- script: __spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
39445
- artifacts: {
39446
- 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) {
39447
- return (0, path_1.join)(context.componentConfig.dir, path);
39448
- })) !== null && _c !== void 0 ? _c : []), false),
39449
- expire_in: "1 day"
39500
+ return (0, base_1.createBuildJobs)(context, {
39501
+ appBuild: buildConfig.buildCommand !== null ? {
39502
+ image: buildConfig.jobImage,
39503
+ variables: __assign({}, RUNNER_BUILD_VARIABLES),
39504
+ cache: buildConfig.jobCache,
39505
+ services: buildConfig.jobServices,
39506
+ script: __spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
39507
+ artifacts: {
39508
+ 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) {
39509
+ return (0, path_1.join)(context.componentConfig.dir, path);
39510
+ })) !== null && _c !== void 0 ? _c : []), false),
39511
+ expire_in: "1 day"
39512
+ }
39513
+ } : undefined,
39514
+ dockerBuild: {
39515
+ script: (0, docker_1.getDockerBuildDefaultScript)(((_d = buildConfig.docker) === null || _d === void 0 ? void 0 : _d.type) === "nginx" ? "ensureNginxDockerfile" : ""),
39516
+ variables: {}
39450
39517
  }
39451
- }) : null;
39452
- return __spreadArray(__spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
39453
- script: [((_d = buildConfig.docker) === null || _d === void 0 ? void 0 : _d.type) === "nginx" ? "ensureNginxDockerfile" : "" // e.g. custom,
39454
- ].filter(Boolean),
39455
- variables: {},
39456
- needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
39457
- })] : []), false), __read((0, sbom_2.sbomDeactivated)(context) ? [] : [(0, sbom_1.createSbomBuildJob)(context)]), false);
39518
+ });
39458
39519
  };
39459
39520
  exports.createCustomBuildJobs = createCustomBuildJobs;
39460
39521
 
@@ -39636,39 +39697,8 @@ var __rest = this && this.__rest || function (s, e) {
39636
39697
  }
39637
39698
  return t;
39638
39699
  };
39639
- var __read = this && this.__read || function (o, n) {
39640
- var m = typeof Symbol === "function" && o[Symbol.iterator];
39641
- if (!m) return o;
39642
- var i = m.call(o),
39643
- r,
39644
- ar = [],
39645
- e;
39646
- try {
39647
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
39648
- } catch (error) {
39649
- e = {
39650
- error: error
39651
- };
39652
- } finally {
39653
- try {
39654
- if (r && !r.done && (m = i["return"])) m.call(i);
39655
- } finally {
39656
- if (e) throw e.error;
39657
- }
39658
- }
39659
- return ar;
39660
- };
39661
- var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
39662
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
39663
- if (ar || !(i in from)) {
39664
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
39665
- ar[i] = from[i];
39666
- }
39667
- }
39668
- return to.concat(ar || Array.prototype.slice.call(from));
39669
- };
39670
39700
  exports.__esModule = true;
39671
- exports.createDockerBuildJobDefault = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
39701
+ exports.getDockerBuildDefaultScript = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
39672
39702
  var lodash_1 = __nccwpck_require__(3255);
39673
39703
  var deploy_1 = __nccwpck_require__(223);
39674
39704
  var runner_1 = __nccwpck_require__(5071);
@@ -39742,14 +39772,10 @@ var createDockerBuildJobBase = function (context, _a) {
39742
39772
  };
39743
39773
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
39744
39774
  exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
39745
- var createDockerBuildJobDefault = function (context, _a) {
39746
- var script = _a.script,
39747
- def = __rest(_a, ["script"]);
39748
- return (0, exports.createDockerBuildJobBase)(context, __assign({
39749
- 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)
39750
- }, def));
39775
+ var getDockerBuildDefaultScript = function (ensureDockerFileScript) {
39776
+ 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);
39751
39777
  };
39752
- exports.createDockerBuildJobDefault = createDockerBuildJobDefault;
39778
+ exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
39753
39779
 
39754
39780
  /***/ }),
39755
39781
 
@@ -39886,18 +39912,15 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
39886
39912
  };
39887
39913
  exports.__esModule = true;
39888
39914
  exports.createNodeBuildJobs = void 0;
39915
+ var path_1 = __nccwpck_require__(1017);
39916
+ var runner_1 = __nccwpck_require__(5071);
39889
39917
  var utils_1 = __nccwpck_require__(7461);
39890
- var constants_1 = __nccwpck_require__(1542);
39891
- var createBuildJob_1 = __nccwpck_require__(8063);
39918
+ var base_1 = __nccwpck_require__(8035);
39892
39919
  var docker_1 = __nccwpck_require__(3219);
39893
- var path_1 = __nccwpck_require__(1017);
39894
39920
  var types_1 = __nccwpck_require__(1197);
39895
39921
  var cache_1 = __nccwpck_require__(4303);
39896
- var constants_2 = __nccwpck_require__(9284);
39922
+ var constants_1 = __nccwpck_require__(9284);
39897
39923
  var yarn_1 = __nccwpck_require__(464);
39898
- var runner_1 = __nccwpck_require__(5071);
39899
- var sbom_1 = __nccwpck_require__(9927);
39900
- var sbom_2 = __nccwpck_require__(5928);
39901
39924
  var createNodeBuildJobs = function (context) {
39902
39925
  var _a, _b, _c, _d, _e, _f, _g;
39903
39926
  var buildConfig = context.componentConfig.build;
@@ -39906,31 +39929,32 @@ var createNodeBuildJobs = function (context) {
39906
39929
  }
39907
39930
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
39908
39931
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
39909
- var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
39910
- image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
39911
- variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
39912
- 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),
39913
- script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
39914
- artifacts: {
39915
- 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) {
39916
- return (0, path_1.join)(context.componentConfig.dir, path);
39917
- })) !== null && _e !== void 0 ? _e : []), false),
39918
- expire_in: "1 day"
39919
- },
39920
- jobTags: buildConfig.jobTags
39921
- }) : null;
39922
- return __spreadArray(__spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
39923
- script: [buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"],
39924
- cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
39925
- variables: {
39926
- // only required for non static
39927
- DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
39928
- DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
39929
- return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
39930
- })) === null || _g === void 0 ? void 0 : _g.join("\n")
39931
- },
39932
- needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
39933
- })] : []), false), __read((0, sbom_2.sbomDeactivated)(context) ? [] : [(0, sbom_1.createSbomBuildJob)(context)]), false);
39932
+ return (0, base_1.createBuildJobs)(context, {
39933
+ appBuild: buildConfig.buildCommand !== null ? {
39934
+ image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
39935
+ variables: __assign({}, constants_1.NODE_RUNNER_BUILD_VARIABLES),
39936
+ 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),
39937
+ script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
39938
+ artifacts: {
39939
+ 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) {
39940
+ return (0, path_1.join)(context.componentConfig.dir, path);
39941
+ })) !== null && _e !== void 0 ? _e : []), false),
39942
+ expire_in: "1 day"
39943
+ },
39944
+ jobTags: buildConfig.jobTags
39945
+ } : undefined,
39946
+ dockerBuild: {
39947
+ script: (0, docker_1.getDockerBuildDefaultScript)(buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"),
39948
+ cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
39949
+ variables: {
39950
+ // only required for non static
39951
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
39952
+ DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
39953
+ return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
39954
+ })) === null || _g === void 0 ? void 0 : _g.join("\n")
39955
+ }
39956
+ }
39957
+ });
39934
39958
  };
39935
39959
  exports.createNodeBuildJobs = createNodeBuildJobs;
39936
39960
 
@@ -40150,14 +40174,11 @@ exports.__esModule = true;
40150
40174
  exports.createMeteorBuildJobs = void 0;
40151
40175
  var path_1 = __nccwpck_require__(1017);
40152
40176
  var runner_1 = __nccwpck_require__(5071);
40153
- var constants_1 = __nccwpck_require__(1542);
40154
- var createBuildJob_1 = __nccwpck_require__(8063);
40177
+ var base_1 = __nccwpck_require__(8035);
40155
40178
  var docker_1 = __nccwpck_require__(3219);
40156
40179
  var types_1 = __nccwpck_require__(1197);
40157
40180
  var cache_1 = __nccwpck_require__(4303);
40158
40181
  var yarn_1 = __nccwpck_require__(464);
40159
- var sbom_1 = __nccwpck_require__(5928);
40160
- var sbom_2 = __nccwpck_require__(9927);
40161
40182
  var getMeteorCache = function (context) {
40162
40183
  return [{
40163
40184
  key: context.componentName + "meteor-build-cache",
@@ -40171,24 +40192,25 @@ var createMeteorBuildJobs = function (context) {
40171
40192
  throw new Error("deploy config is not meteor");
40172
40193
  }
40173
40194
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
40174
- var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
40175
- cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
40176
- image: (0, runner_1.getRunnerImage)("jobs-meteor"),
40177
- variables: {
40178
- METEOR_DISABLE_OPTIMISTIC_CACHING: "1"
40179
- },
40180
- 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),
40181
- artifacts: {
40182
- paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
40195
+ return (0, base_1.createBuildJobs)(context, {
40196
+ appBuild: buildConfig.buildCommand !== null ? {
40197
+ cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
40198
+ image: (0, runner_1.getRunnerImage)("jobs-meteor"),
40199
+ variables: {
40200
+ METEOR_DISABLE_OPTIMISTIC_CACHING: "1"
40201
+ },
40202
+ 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),
40203
+ artifacts: {
40204
+ paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
40205
+ }
40206
+ } : undefined,
40207
+ dockerBuild: {
40208
+ script: (0, docker_1.getDockerBuildDefaultScript)("ensureMeteorDockerfile"),
40209
+ variables: {
40210
+ METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : ""
40211
+ }
40183
40212
  }
40184
- }) : null;
40185
- return __spreadArray(__spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [(0, docker_1.createDockerBuildJobDefault)(context, {
40186
- script: ["ensureMeteorDockerfile"],
40187
- variables: {
40188
- METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : ""
40189
- },
40190
- needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
40191
- })], false), __read((0, sbom_1.sbomDeactivated)(context) ? [] : [(0, sbom_2.createSbomBuildJob)(context)]), false);
40213
+ });
40192
40214
  };
40193
40215
  exports.createMeteorBuildJobs = createMeteorBuildJobs;
40194
40216
 
@@ -40414,21 +40436,11 @@ var __read = this && this.__read || function (o, n) {
40414
40436
  }
40415
40437
  return ar;
40416
40438
  };
40417
- var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
40418
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40419
- if (ar || !(i in from)) {
40420
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
40421
- ar[i] = from[i];
40422
- }
40423
- }
40424
- return to.concat(ar || Array.prototype.slice.call(from));
40425
- };
40426
40439
  exports.__esModule = true;
40427
40440
  exports.createRailsBuildJobs = void 0;
40428
- var types_1 = __nccwpck_require__(1197);
40441
+ var base_1 = __nccwpck_require__(8035);
40429
40442
  var docker_1 = __nccwpck_require__(3219);
40430
- var sbom_1 = __nccwpck_require__(5928);
40431
- var sbom_2 = __nccwpck_require__(9927);
40443
+ var types_1 = __nccwpck_require__(1197);
40432
40444
  var createRailsBuildJobs = function (context) {
40433
40445
  var _a, _b, _c;
40434
40446
  var buildConfig = context.componentConfig.build;
@@ -40443,13 +40455,16 @@ var createRailsBuildJobs = function (context) {
40443
40455
  v = _b[1];
40444
40456
  return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
40445
40457
  }).join(" ");
40446
- return __spreadArray([(0, docker_1.createDockerBuildJobBase)(context, {
40447
- variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
40448
- // custom script
40449
- 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",
40450
- // replace private git ssh gem sources with https to make bundler with credentials via env var work
40451
- "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 : "")]
40452
- })], __read((0, sbom_1.sbomDeactivated)(context) ? [] : [(0, sbom_2.createSbomBuildJob)(context)]), false);
40458
+ return (0, base_1.createBuildJobs)(context, {
40459
+ appBuild: undefined,
40460
+ dockerBuild: {
40461
+ variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
40462
+ // custom script
40463
+ 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",
40464
+ // replace private git ssh gem sources with https to make bundler with credentials via env var work
40465
+ "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 : "")]
40466
+ }
40467
+ });
40453
40468
  };
40454
40469
  exports.createRailsBuildJobs = createRailsBuildJobs;
40455
40470
 
@@ -40830,7 +40845,7 @@ exports.readConfigSync = readConfigSync;
40830
40845
 
40831
40846
  exports.__esModule = true;
40832
40847
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
40833
- exports.PIPELINE_IMAGE_TAG = "main-e5cd9fd4" || 0;
40848
+ exports.PIPELINE_IMAGE_TAG = "main-93b724a8" || 0;
40834
40849
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
40835
40850
 
40836
40851
  /***/ }),
@@ -42132,7 +42147,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42132
42147
  return to.concat(ar || Array.prototype.slice.call(from));
42133
42148
  };
42134
42149
  exports.__esModule = true;
42135
- exports.getBaseDeploymentJob = exports.DEPLOY_JOB_NAME = void 0;
42150
+ exports.createDeployJob = exports.DEPLOY_JOB_NAME = void 0;
42136
42151
  var docker_1 = __nccwpck_require__(3219);
42137
42152
  var sbom_1 = __nccwpck_require__(9927);
42138
42153
  var sbom_2 = __nccwpck_require__(5928);
@@ -42140,7 +42155,7 @@ var utils_1 = __nccwpck_require__(2757);
42140
42155
  var stop_1 = __nccwpck_require__(8297);
42141
42156
  var variables_1 = __nccwpck_require__(7040);
42142
42157
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
42143
- var getBaseDeploymentJob = function (context) {
42158
+ var createDeployJob = function (context, jobDefinition) {
42144
42159
  var _a, _b, _c, _d;
42145
42160
  var hasDocker = (0, docker_1.requiresDockerBuild)(context);
42146
42161
  var isStoppable = (0, utils_1.contextIsStoppable)(context);
@@ -42154,6 +42169,11 @@ var getBaseDeploymentJob = function (context) {
42154
42169
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
42155
42170
  return {
42156
42171
  name: exports.DEPLOY_JOB_NAME,
42172
+ script: jobDefinition.script,
42173
+ image: jobDefinition.image,
42174
+ cache: jobDefinition.cache,
42175
+ artifacts: jobDefinition.artifacts,
42176
+ services: jobDefinition.services,
42157
42177
  envMode: "stagePerEnv",
42158
42178
  needs: __spreadArray(__spreadArray([], __read((0, sbom_2.sbomDeactivated)(context) ? [] : [{
42159
42179
  job: sbom_1.SBOM_BUILD_JOB_NAME,
@@ -42180,7 +42200,7 @@ var getBaseDeploymentJob = function (context) {
42180
42200
  }],
42181
42201
  allow_failure: whenDeploy === "manual" ? true : false,
42182
42202
  stage: "deploy",
42183
- 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 : {} : {}),
42203
+ 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),
42184
42204
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
42185
42205
  on_stop: stop_1.STOP_JOB_NAME,
42186
42206
  auto_stop_in: autoStop
@@ -42188,7 +42208,7 @@ var getBaseDeploymentJob = function (context) {
42188
42208
  jobTags: context.componentConfig.deploy ? context.componentConfig.deploy.jobTags : undefined
42189
42209
  };
42190
42210
  };
42191
- exports.getBaseDeploymentJob = getBaseDeploymentJob;
42211
+ exports.createDeployJob = createDeployJob;
42192
42212
 
42193
42213
  /***/ }),
42194
42214
 
@@ -42198,25 +42218,46 @@ exports.getBaseDeploymentJob = getBaseDeploymentJob;
42198
42218
  "use strict";
42199
42219
 
42200
42220
 
42201
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
42202
- if (k2 === undefined) k2 = k;
42203
- Object.defineProperty(o, k2, {
42204
- enumerable: true,
42205
- get: function () {
42206
- return m[k];
42221
+ var __read = this && this.__read || function (o, n) {
42222
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
42223
+ if (!m) return o;
42224
+ var i = m.call(o),
42225
+ r,
42226
+ ar = [],
42227
+ e;
42228
+ try {
42229
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
42230
+ } catch (error) {
42231
+ e = {
42232
+ error: error
42233
+ };
42234
+ } finally {
42235
+ try {
42236
+ if (r && !r.done && (m = i["return"])) m.call(i);
42237
+ } finally {
42238
+ if (e) throw e.error;
42207
42239
  }
42208
- });
42209
- } : function (o, m, k, k2) {
42210
- if (k2 === undefined) k2 = k;
42211
- o[k2] = m[k];
42212
- });
42213
- var __exportStar = this && this.__exportStar || function (m, exports) {
42214
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
42240
+ }
42241
+ return ar;
42242
+ };
42243
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42244
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
42245
+ if (ar || !(i in from)) {
42246
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42247
+ ar[i] = from[i];
42248
+ }
42249
+ }
42250
+ return to.concat(ar || Array.prototype.slice.call(from));
42215
42251
  };
42216
42252
  exports.__esModule = true;
42217
- __exportStar(__nccwpck_require__(6166), exports);
42218
- __exportStar(__nccwpck_require__(9567), exports);
42219
- __exportStar(__nccwpck_require__(8297), exports);
42253
+ exports.createDeployementJobs = void 0;
42254
+ var deploy_1 = __nccwpck_require__(6166);
42255
+ var rollback_1 = __nccwpck_require__(9567);
42256
+ var stop_1 = __nccwpck_require__(8297);
42257
+ var createDeployementJobs = function (context, definitions) {
42258
+ 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);
42259
+ };
42260
+ exports.createDeployementJobs = createDeployementJobs;
42220
42261
 
42221
42262
  /***/ }),
42222
42263
 
@@ -42237,28 +42278,30 @@ var __assign = this && this.__assign || function () {
42237
42278
  return __assign.apply(this, arguments);
42238
42279
  };
42239
42280
  exports.__esModule = true;
42240
- exports.getBaseRollbackJob = exports.ROLLBACK_JOB_NAME = void 0;
42281
+ exports.createRollbackJob = exports.ROLLBACK_JOB_NAME = void 0;
42241
42282
  var variables_1 = __nccwpck_require__(7040);
42242
42283
  exports.ROLLBACK_JOB_NAME = "↩️ Rollback ⚠️";
42243
- var getBaseRollbackJob = function (context) {
42284
+ var createRollbackJob = function (context, jobDefinition) {
42244
42285
  return {
42245
42286
  name: exports.ROLLBACK_JOB_NAME,
42287
+ image: jobDefinition.image,
42246
42288
  envMode: "stagePerEnv",
42247
42289
  needs: [],
42248
42290
  rules: [{
42249
42291
  when: "manual",
42250
42292
  allow_failure: true
42251
42293
  }],
42252
- variables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42294
+ variables: __assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42253
42295
  GIT_STRATEGY: "none"
42254
- }),
42296
+ }), jobDefinition.variables),
42255
42297
  stage: "rollback",
42256
42298
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
42257
42299
  action: "access"
42258
- })
42300
+ }),
42301
+ script: jobDefinition.script
42259
42302
  };
42260
42303
  };
42261
- exports.getBaseRollbackJob = getBaseRollbackJob;
42304
+ exports.createRollbackJob = createRollbackJob;
42262
42305
 
42263
42306
  /***/ }),
42264
42307
 
@@ -42279,12 +42322,13 @@ var __assign = this && this.__assign || function () {
42279
42322
  return __assign.apply(this, arguments);
42280
42323
  };
42281
42324
  exports.__esModule = true;
42282
- exports.getBaseDeploymentStopJob = exports.STOP_JOB_NAME = void 0;
42325
+ exports.createStopJob = exports.STOP_JOB_NAME = void 0;
42283
42326
  var variables_1 = __nccwpck_require__(7040);
42284
42327
  exports.STOP_JOB_NAME = "🛑 Stop ⚠️";
42285
- var getBaseDeploymentStopJob = function (context) {
42328
+ var createStopJob = function (context, jobDefinition) {
42286
42329
  return {
42287
42330
  name: exports.STOP_JOB_NAME,
42331
+ image: jobDefinition.image,
42288
42332
  envMode: "stagePerEnv",
42289
42333
  needs: [],
42290
42334
  rules: [{
@@ -42295,16 +42339,17 @@ var getBaseDeploymentStopJob = function (context) {
42295
42339
  when: "manual",
42296
42340
  allow_failure: true
42297
42341
  }],
42298
- variables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42342
+ variables: __assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42299
42343
  GIT_STRATEGY: "none"
42300
- }),
42344
+ }), jobDefinition.variables),
42301
42345
  stage: "stop",
42302
42346
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
42303
42347
  action: "stop"
42304
- })
42348
+ }),
42349
+ script: jobDefinition.script
42305
42350
  };
42306
42351
  };
42307
- exports.getBaseDeploymentStopJob = getBaseDeploymentStopJob;
42352
+ exports.createStopJob = createStopJob;
42308
42353
 
42309
42354
  /***/ }),
42310
42355
 
@@ -42380,14 +42425,14 @@ var _1 = __nccwpck_require__(1344);
42380
42425
  var docker_1 = __nccwpck_require__(3219);
42381
42426
  var getLabels_1 = __nccwpck_require__(486);
42382
42427
  var runner_1 = __nccwpck_require__(5071);
42428
+ var gitlab_1 = __nccwpck_require__(4997);
42383
42429
  var base_1 = __nccwpck_require__(2866);
42430
+ var sbom_1 = __nccwpck_require__(5928);
42384
42431
  var types_1 = __nccwpck_require__(3109);
42385
- var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
42432
+ var createArgsString_1 = __nccwpck_require__(8686);
42386
42433
  var database_1 = __nccwpck_require__(1384);
42387
- var gitlab_1 = __nccwpck_require__(4997);
42434
+ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
42388
42435
  var jobName_1 = __nccwpck_require__(7311);
42389
- var createArgsString_1 = __nccwpck_require__(8686);
42390
- var sbom_1 = __nccwpck_require__(5928);
42391
42436
  var setExtraVarsScripts = function (deployConfig) {
42392
42437
  return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
42393
42438
  };
@@ -42401,7 +42446,6 @@ var createGoogleCloudRunDeployJobs = function (context) {
42401
42446
  // should not happen
42402
42447
  throw new Error("deploy config is wrong");
42403
42448
  }
42404
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
42405
42449
  var fullAppName = "".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName);
42406
42450
  var dockerUrl = "".concat(deployConfig.region, "-docker.pkg.dev/").concat(deployConfig.projectId, "/catladder-deploy/").concat(fullAppName);
42407
42451
  var gcloudImageName = "".concat(dockerUrl, "/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG");
@@ -42551,27 +42595,30 @@ var createGoogleCloudRunDeployJobs = function (context) {
42551
42595
  name = _b[0];
42552
42596
  return "gcloud run services delete ".concat(serviceName, "-").concat(name, " ").concat(commonArgsString);
42553
42597
  })), 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);
42554
- return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
42555
- artifacts: {
42556
- paths: ["____envvars.yaml"]
42557
- },
42558
- variables: {
42559
- CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
42560
- ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
42561
- lineWidth: -1,
42562
- quotingType: "'",
42563
- forceQuotes: true
42564
- })
42565
- },
42566
- image: (0, runner_1.getRunnerImage)("gcloud"),
42567
- script: deployScripts
42568
- }), (0, lodash_1.merge)({}, (0, base_1.getBaseDeploymentStopJob)(context), {
42569
- image: (0, runner_1.getRunnerImage)("gcloud"),
42570
- variables: {
42571
- CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
42572
- },
42573
- script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
42574
- })];
42598
+ return (0, base_1.createDeployementJobs)(context, {
42599
+ deploy: (0, lodash_1.merge)((0, docker_1.getDockerJobBaseProps)(context), {
42600
+ artifacts: {
42601
+ paths: ["____envvars.yaml"]
42602
+ },
42603
+ variables: {
42604
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
42605
+ ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
42606
+ lineWidth: -1,
42607
+ quotingType: "'",
42608
+ forceQuotes: true
42609
+ })
42610
+ },
42611
+ image: (0, runner_1.getRunnerImage)("gcloud"),
42612
+ script: deployScripts
42613
+ }),
42614
+ stop: {
42615
+ image: (0, runner_1.getRunnerImage)("gcloud"),
42616
+ variables: {
42617
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
42618
+ },
42619
+ script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
42620
+ }
42621
+ });
42575
42622
  };
42576
42623
  exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
42577
42624
 
@@ -42925,12 +42972,11 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42925
42972
  };
42926
42973
  exports.__esModule = true;
42927
42974
  exports.createCustomDeployJobs = void 0;
42928
- var lodash_1 = __nccwpck_require__(3255);
42929
42975
  var yarn_1 = __nccwpck_require__(464);
42930
42976
  var runner_1 = __nccwpck_require__(5071);
42931
42977
  var base_1 = __nccwpck_require__(2866);
42932
- var types_1 = __nccwpck_require__(3109);
42933
42978
  var sbom_1 = __nccwpck_require__(5928);
42979
+ var types_1 = __nccwpck_require__(3109);
42934
42980
  var createCustomDeployJobs = function (context) {
42935
42981
  var _a, _b, _c;
42936
42982
  var deployConfig = context.componentConfig.deploy;
@@ -42941,19 +42987,23 @@ var createCustomDeployJobs = function (context) {
42941
42987
  // should not happen
42942
42988
  throw new Error("deploy config is not custom");
42943
42989
  }
42944
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
42945
42990
  // FIXME: custom deploy currently assumes yarn-based project
42946
42991
  var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
42947
42992
  noCustomPostInstall: true
42948
42993
  });
42949
- return __spreadArray([(0, lodash_1.merge)({}, baseDeploymentJob, {
42950
- image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
42951
- cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
42952
- 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)
42953
- })], __read(deployConfig.stopScript ? [(0, lodash_1.merge)({}, (0, base_1.getBaseDeploymentStopJob)(context), {
42954
- image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
42955
- script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
42956
- })] : []), false);
42994
+ return (0, base_1.createDeployementJobs)(context, {
42995
+ deploy: {
42996
+ image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
42997
+ cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
42998
+ 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),
42999
+ variables: {}
43000
+ },
43001
+ stop: deployConfig.stopScript ? {
43002
+ image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
43003
+ script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
43004
+ variables: {}
43005
+ } : undefined
43006
+ });
42957
43007
  };
42958
43008
  exports.createCustomDeployJobs = createCustomDeployJobs;
42959
43009
 
@@ -42984,14 +43034,23 @@ exports.CUSTOM_DEPLOY_TYPE = {
42984
43034
  /***/ }),
42985
43035
 
42986
43036
  /***/ 7790:
42987
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
43037
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
42988
43038
 
42989
43039
  "use strict";
42990
43040
 
42991
43041
 
43042
+ var __assign = this && this.__assign || function () {
43043
+ __assign = Object.assign || function (t) {
43044
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
43045
+ s = arguments[i];
43046
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
43047
+ }
43048
+ return t;
43049
+ };
43050
+ return __assign.apply(this, arguments);
43051
+ };
42992
43052
  exports.__esModule = true;
42993
43053
  exports.createDockerTagDeployJobs = void 0;
42994
- var lodash_1 = __nccwpck_require__(3255);
42995
43054
  var docker_1 = __nccwpck_require__(3219);
42996
43055
  var base_1 = __nccwpck_require__(2866);
42997
43056
  var types_1 = __nccwpck_require__(3109);
@@ -43004,11 +43063,12 @@ var createDockerTagDeployJobs = function (context) {
43004
43063
  // should not happen
43005
43064
  throw new Error("deploy config is not dockerTag");
43006
43065
  }
43007
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
43008
43066
  var tag = deployConfig.tag;
43009
- return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
43010
- 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, "\"")]
43011
- })];
43067
+ return (0, base_1.createDeployementJobs)(context, {
43068
+ deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)(context)), {
43069
+ 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, "\"")]
43070
+ })
43071
+ });
43012
43072
  };
43013
43073
  exports.createDockerTagDeployJobs = createDockerTagDeployJobs;
43014
43074
 
@@ -43221,13 +43281,12 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
43221
43281
  exports.__esModule = true;
43222
43282
  exports.createKubernetesDeployJobs = void 0;
43223
43283
  var js_yaml_1 = __nccwpck_require__(3618);
43224
- var lodash_1 = __nccwpck_require__(3255);
43225
43284
  var __1 = __nccwpck_require__(5355);
43226
43285
  var runner_1 = __nccwpck_require__(5071);
43227
43286
  var base_1 = __nccwpck_require__(2866);
43287
+ var sbom_1 = __nccwpck_require__(5928);
43228
43288
  var types_1 = __nccwpck_require__(3109);
43229
43289
  var kubeValues_1 = __nccwpck_require__(1061);
43230
- var sbom_1 = __nccwpck_require__(5928);
43231
43290
  var createKubernetesDeployJobs = function (context) {
43232
43291
  var _a, _b, _c;
43233
43292
  var deployConfig = context.componentConfig.deploy;
@@ -43256,18 +43315,19 @@ var createKubernetesDeployJobs = function (context) {
43256
43315
  BUILD_ID: (_c = context.commitInfo) === null || _c === void 0 ? void 0 : _c.buildId
43257
43316
  })
43258
43317
  };
43259
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
43260
- var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
43261
- var baseRollbackJob = (0, base_1.getBaseRollbackJob)(context);
43262
43318
  var clusterName = "kube-".concat(context.environment.fullName);
43263
43319
  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, "\"")];
43264
- return [(0, lodash_1.merge)({}, baseDeploymentJob, shared, {
43265
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesCreateSecret", "kubernetesDeploy"], false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false), ["echo deployment successful 😻"], false)
43266
- }), (0, lodash_1.merge)({}, baseStopJob, shared, {
43267
- script: __spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesDelete"], false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
43268
- }), (0, lodash_1.merge)({}, baseRollbackJob, shared, {
43269
- script: __spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesRollback"], false)
43270
- })];
43320
+ return (0, base_1.createDeployementJobs)(context, {
43321
+ deploy: __assign(__assign({}, shared), {
43322
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesCreateSecret", "kubernetesDeploy"], false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false), ["echo deployment successful 😻"], false)
43323
+ }),
43324
+ stop: __assign(__assign({}, shared), {
43325
+ script: __spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesDelete"], false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
43326
+ }),
43327
+ rollback: __assign(__assign({}, shared), {
43328
+ script: __spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesRollback"], false)
43329
+ })
43330
+ });
43271
43331
  };
43272
43332
  exports.createKubernetesDeployJobs = createKubernetesDeployJobs;
43273
43333
 
@@ -44961,6 +45021,7 @@ exports.__esModule = true;
44961
45021
  exports.createGitlabJobs = exports.makeGitlabJob = void 0;
44962
45022
  var lodash_1 = __nccwpck_require__(3255);
44963
45023
  var defaults_1 = __nccwpck_require__(7383);
45024
+ var utils_1 = __nccwpck_require__(7461);
44964
45025
  var removeUndefined = function (obj) {
44965
45026
  return Object.fromEntries(Object.entries(obj).filter(function (_a) {
44966
45027
  var _b = __read(_a, 2),
@@ -44996,7 +45057,8 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
44996
45057
  name = _a.name,
44997
45058
  needs = _a.needs,
44998
45059
  jobTags = _a.jobTags,
44999
- job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags"]);
45060
+ script = _a.script,
45061
+ job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags", "script"]);
45000
45062
  var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
45001
45063
  var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
45002
45064
  var _a, _b, _c, _d;
@@ -45030,6 +45092,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
45030
45092
  })).values()), false);
45031
45093
  var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
45032
45094
  var gitlabJob = removeUndefined(__assign(__assign({}, job), {
45095
+ script: script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil),
45033
45096
  tags: jobTags,
45034
45097
  stage: stage,
45035
45098
  environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {