@catladder/cli 0.0.0-refactor-deploy-278d68f1 → 0.0.0-refactor-image-ca767657

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 = "refactor-deploy-278d68f1" || 0;
40848
+ exports.PIPELINE_IMAGE_TAG = "refactor-image-ca767657" || 0;
40834
40849
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
40835
40850
 
40836
40851
  /***/ }),
@@ -41390,6 +41405,7 @@ var getLabels = function (context) {
41390
41405
  var _a, _b, _c;
41391
41406
  var labels = __assign({
41392
41407
  "customer-name": sanitize(context.fullConfig.customerName),
41408
+ "component-name": sanitize(context.componentName),
41393
41409
  "app-name": sanitize(context.fullConfig.appName),
41394
41410
  "env-type": sanitize(context.environment.envType),
41395
41411
  "env-name": sanitize(context.environment.shortName),
@@ -42132,7 +42148,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42132
42148
  return to.concat(ar || Array.prototype.slice.call(from));
42133
42149
  };
42134
42150
  exports.__esModule = true;
42135
- exports.getBaseDeploymentJob = exports.DEPLOY_JOB_NAME = void 0;
42151
+ exports.createDeployJob = exports.DEPLOY_JOB_NAME = void 0;
42136
42152
  var docker_1 = __nccwpck_require__(3219);
42137
42153
  var sbom_1 = __nccwpck_require__(9927);
42138
42154
  var sbom_2 = __nccwpck_require__(5928);
@@ -42140,7 +42156,7 @@ var utils_1 = __nccwpck_require__(2757);
42140
42156
  var stop_1 = __nccwpck_require__(8297);
42141
42157
  var variables_1 = __nccwpck_require__(7040);
42142
42158
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
42143
- var getBaseDeploymentJob = function (context) {
42159
+ var createDeployJob = function (context, jobDefinition) {
42144
42160
  var _a, _b, _c, _d;
42145
42161
  var hasDocker = (0, docker_1.requiresDockerBuild)(context);
42146
42162
  var isStoppable = (0, utils_1.contextIsStoppable)(context);
@@ -42154,6 +42170,11 @@ var getBaseDeploymentJob = function (context) {
42154
42170
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
42155
42171
  return {
42156
42172
  name: exports.DEPLOY_JOB_NAME,
42173
+ script: jobDefinition.script,
42174
+ image: jobDefinition.image,
42175
+ cache: jobDefinition.cache,
42176
+ artifacts: jobDefinition.artifacts,
42177
+ services: jobDefinition.services,
42157
42178
  envMode: "stagePerEnv",
42158
42179
  needs: __spreadArray(__spreadArray([], __read((0, sbom_2.sbomDeactivated)(context) ? [] : [{
42159
42180
  job: sbom_1.SBOM_BUILD_JOB_NAME,
@@ -42180,7 +42201,7 @@ var getBaseDeploymentJob = function (context) {
42180
42201
  }],
42181
42202
  allow_failure: whenDeploy === "manual" ? true : false,
42182
42203
  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 : {} : {}),
42204
+ 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
42205
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
42185
42206
  on_stop: stop_1.STOP_JOB_NAME,
42186
42207
  auto_stop_in: autoStop
@@ -42188,7 +42209,7 @@ var getBaseDeploymentJob = function (context) {
42188
42209
  jobTags: context.componentConfig.deploy ? context.componentConfig.deploy.jobTags : undefined
42189
42210
  };
42190
42211
  };
42191
- exports.getBaseDeploymentJob = getBaseDeploymentJob;
42212
+ exports.createDeployJob = createDeployJob;
42192
42213
 
42193
42214
  /***/ }),
42194
42215
 
@@ -42198,25 +42219,46 @@ exports.getBaseDeploymentJob = getBaseDeploymentJob;
42198
42219
  "use strict";
42199
42220
 
42200
42221
 
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];
42222
+ var __read = this && this.__read || function (o, n) {
42223
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
42224
+ if (!m) return o;
42225
+ var i = m.call(o),
42226
+ r,
42227
+ ar = [],
42228
+ e;
42229
+ try {
42230
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
42231
+ } catch (error) {
42232
+ e = {
42233
+ error: error
42234
+ };
42235
+ } finally {
42236
+ try {
42237
+ if (r && !r.done && (m = i["return"])) m.call(i);
42238
+ } finally {
42239
+ if (e) throw e.error;
42207
42240
  }
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);
42241
+ }
42242
+ return ar;
42243
+ };
42244
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42245
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
42246
+ if (ar || !(i in from)) {
42247
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42248
+ ar[i] = from[i];
42249
+ }
42250
+ }
42251
+ return to.concat(ar || Array.prototype.slice.call(from));
42215
42252
  };
42216
42253
  exports.__esModule = true;
42217
- __exportStar(__nccwpck_require__(6166), exports);
42218
- __exportStar(__nccwpck_require__(9567), exports);
42219
- __exportStar(__nccwpck_require__(8297), exports);
42254
+ exports.createDeployementJobs = void 0;
42255
+ var deploy_1 = __nccwpck_require__(6166);
42256
+ var rollback_1 = __nccwpck_require__(9567);
42257
+ var stop_1 = __nccwpck_require__(8297);
42258
+ var createDeployementJobs = function (context, definitions) {
42259
+ 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);
42260
+ };
42261
+ exports.createDeployementJobs = createDeployementJobs;
42220
42262
 
42221
42263
  /***/ }),
42222
42264
 
@@ -42237,28 +42279,30 @@ var __assign = this && this.__assign || function () {
42237
42279
  return __assign.apply(this, arguments);
42238
42280
  };
42239
42281
  exports.__esModule = true;
42240
- exports.getBaseRollbackJob = exports.ROLLBACK_JOB_NAME = void 0;
42282
+ exports.createRollbackJob = exports.ROLLBACK_JOB_NAME = void 0;
42241
42283
  var variables_1 = __nccwpck_require__(7040);
42242
42284
  exports.ROLLBACK_JOB_NAME = "↩️ Rollback ⚠️";
42243
- var getBaseRollbackJob = function (context) {
42285
+ var createRollbackJob = function (context, jobDefinition) {
42244
42286
  return {
42245
42287
  name: exports.ROLLBACK_JOB_NAME,
42288
+ image: jobDefinition.image,
42246
42289
  envMode: "stagePerEnv",
42247
42290
  needs: [],
42248
42291
  rules: [{
42249
42292
  when: "manual",
42250
42293
  allow_failure: true
42251
42294
  }],
42252
- variables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42295
+ variables: __assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42253
42296
  GIT_STRATEGY: "none"
42254
- }),
42297
+ }), jobDefinition.variables),
42255
42298
  stage: "rollback",
42256
42299
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
42257
42300
  action: "access"
42258
- })
42301
+ }),
42302
+ script: jobDefinition.script
42259
42303
  };
42260
42304
  };
42261
- exports.getBaseRollbackJob = getBaseRollbackJob;
42305
+ exports.createRollbackJob = createRollbackJob;
42262
42306
 
42263
42307
  /***/ }),
42264
42308
 
@@ -42279,12 +42323,13 @@ var __assign = this && this.__assign || function () {
42279
42323
  return __assign.apply(this, arguments);
42280
42324
  };
42281
42325
  exports.__esModule = true;
42282
- exports.getBaseDeploymentStopJob = exports.STOP_JOB_NAME = void 0;
42326
+ exports.createStopJob = exports.STOP_JOB_NAME = void 0;
42283
42327
  var variables_1 = __nccwpck_require__(7040);
42284
42328
  exports.STOP_JOB_NAME = "🛑 Stop ⚠️";
42285
- var getBaseDeploymentStopJob = function (context) {
42329
+ var createStopJob = function (context, jobDefinition) {
42286
42330
  return {
42287
42331
  name: exports.STOP_JOB_NAME,
42332
+ image: jobDefinition.image,
42288
42333
  envMode: "stagePerEnv",
42289
42334
  needs: [],
42290
42335
  rules: [{
@@ -42295,16 +42340,17 @@ var getBaseDeploymentStopJob = function (context) {
42295
42340
  when: "manual",
42296
42341
  allow_failure: true
42297
42342
  }],
42298
- variables: __assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42343
+ variables: __assign(__assign(__assign(__assign({}, variables_1.DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
42299
42344
  GIT_STRATEGY: "none"
42300
- }),
42345
+ }), jobDefinition.variables),
42301
42346
  stage: "stop",
42302
42347
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), {
42303
42348
  action: "stop"
42304
- })
42349
+ }),
42350
+ script: jobDefinition.script
42305
42351
  };
42306
42352
  };
42307
- exports.getBaseDeploymentStopJob = getBaseDeploymentStopJob;
42353
+ exports.createStopJob = createStopJob;
42308
42354
 
42309
42355
  /***/ }),
42310
42356
 
@@ -42380,14 +42426,14 @@ var _1 = __nccwpck_require__(1344);
42380
42426
  var docker_1 = __nccwpck_require__(3219);
42381
42427
  var getLabels_1 = __nccwpck_require__(486);
42382
42428
  var runner_1 = __nccwpck_require__(5071);
42429
+ var gitlab_1 = __nccwpck_require__(4997);
42383
42430
  var base_1 = __nccwpck_require__(2866);
42431
+ var sbom_1 = __nccwpck_require__(5928);
42384
42432
  var types_1 = __nccwpck_require__(3109);
42385
- var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
42433
+ var createArgsString_1 = __nccwpck_require__(8686);
42386
42434
  var database_1 = __nccwpck_require__(1384);
42387
- var gitlab_1 = __nccwpck_require__(4997);
42435
+ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
42388
42436
  var jobName_1 = __nccwpck_require__(7311);
42389
- var createArgsString_1 = __nccwpck_require__(8686);
42390
- var sbom_1 = __nccwpck_require__(5928);
42391
42437
  var setExtraVarsScripts = function (deployConfig) {
42392
42438
  return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
42393
42439
  };
@@ -42401,10 +42447,9 @@ var createGoogleCloudRunDeployJobs = function (context) {
42401
42447
  // should not happen
42402
42448
  throw new Error("deploy config is wrong");
42403
42449
  }
42404
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
42405
42450
  var fullAppName = "".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName);
42406
42451
  var dockerUrl = "".concat(deployConfig.region, "-docker.pkg.dev/").concat(deployConfig.projectId, "/catladder-deploy/").concat(fullAppName);
42407
- var gcloudImageName = "".concat(dockerUrl, "/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG");
42452
+ var gcloudImageName = "".concat(dockerUrl, "/").concat(context.environment.shortName, "/").concat(context.componentName, ":$DOCKER_IMAGE_TAG");
42408
42453
  var pushImageToArtifactsRegistry = [docker_1.gitlabDockerLogin, "gcloud auth configure-docker ".concat(deployConfig.region, "-docker.pkg.dev"), "docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG ".concat(gcloudImageName), "docker push ".concat(gcloudImageName)];
42409
42454
  var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, _1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
42410
42455
  var labelsString = Object.entries((0, getLabels_1.getLabels)(context)).map(function (_a) {
@@ -42551,27 +42596,30 @@ var createGoogleCloudRunDeployJobs = function (context) {
42551
42596
  name = _b[0];
42552
42597
  return "gcloud run services delete ".concat(serviceName, "-").concat(name, " ").concat(commonArgsString);
42553
42598
  })), 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
- })];
42599
+ return (0, base_1.createDeployementJobs)(context, {
42600
+ deploy: (0, lodash_1.merge)((0, docker_1.getDockerJobBaseProps)(context), {
42601
+ artifacts: {
42602
+ paths: ["____envvars.yaml"]
42603
+ },
42604
+ variables: {
42605
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1",
42606
+ ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
42607
+ lineWidth: -1,
42608
+ quotingType: "'",
42609
+ forceQuotes: true
42610
+ })
42611
+ },
42612
+ image: (0, runner_1.getRunnerImage)("gcloud"),
42613
+ script: deployScripts
42614
+ }),
42615
+ stop: {
42616
+ image: (0, runner_1.getRunnerImage)("gcloud"),
42617
+ variables: {
42618
+ CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
42619
+ },
42620
+ script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
42621
+ }
42622
+ });
42575
42623
  };
42576
42624
  exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
42577
42625
 
@@ -42925,12 +42973,11 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
42925
42973
  };
42926
42974
  exports.__esModule = true;
42927
42975
  exports.createCustomDeployJobs = void 0;
42928
- var lodash_1 = __nccwpck_require__(3255);
42929
42976
  var yarn_1 = __nccwpck_require__(464);
42930
42977
  var runner_1 = __nccwpck_require__(5071);
42931
42978
  var base_1 = __nccwpck_require__(2866);
42932
- var types_1 = __nccwpck_require__(3109);
42933
42979
  var sbom_1 = __nccwpck_require__(5928);
42980
+ var types_1 = __nccwpck_require__(3109);
42934
42981
  var createCustomDeployJobs = function (context) {
42935
42982
  var _a, _b, _c;
42936
42983
  var deployConfig = context.componentConfig.deploy;
@@ -42941,19 +42988,23 @@ var createCustomDeployJobs = function (context) {
42941
42988
  // should not happen
42942
42989
  throw new Error("deploy config is not custom");
42943
42990
  }
42944
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
42945
42991
  // FIXME: custom deploy currently assumes yarn-based project
42946
42992
  var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
42947
42993
  noCustomPostInstall: true
42948
42994
  });
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);
42995
+ return (0, base_1.createDeployementJobs)(context, {
42996
+ deploy: {
42997
+ image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
42998
+ cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
42999
+ 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),
43000
+ variables: {}
43001
+ },
43002
+ stop: deployConfig.stopScript ? {
43003
+ image: (_c = deployConfig.jobImage) !== null && _c !== void 0 ? _c : (0, runner_1.getRunnerImage)("jobs-default"),
43004
+ script: __spreadArray(__spreadArray([], __read(deployConfig.stopScript), false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
43005
+ variables: {}
43006
+ } : undefined
43007
+ });
42957
43008
  };
42958
43009
  exports.createCustomDeployJobs = createCustomDeployJobs;
42959
43010
 
@@ -42984,14 +43035,23 @@ exports.CUSTOM_DEPLOY_TYPE = {
42984
43035
  /***/ }),
42985
43036
 
42986
43037
  /***/ 7790:
42987
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
43038
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
42988
43039
 
42989
43040
  "use strict";
42990
43041
 
42991
43042
 
43043
+ var __assign = this && this.__assign || function () {
43044
+ __assign = Object.assign || function (t) {
43045
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
43046
+ s = arguments[i];
43047
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
43048
+ }
43049
+ return t;
43050
+ };
43051
+ return __assign.apply(this, arguments);
43052
+ };
42992
43053
  exports.__esModule = true;
42993
43054
  exports.createDockerTagDeployJobs = void 0;
42994
- var lodash_1 = __nccwpck_require__(3255);
42995
43055
  var docker_1 = __nccwpck_require__(3219);
42996
43056
  var base_1 = __nccwpck_require__(2866);
42997
43057
  var types_1 = __nccwpck_require__(3109);
@@ -43004,11 +43064,12 @@ var createDockerTagDeployJobs = function (context) {
43004
43064
  // should not happen
43005
43065
  throw new Error("deploy config is not dockerTag");
43006
43066
  }
43007
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
43008
43067
  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
- })];
43068
+ return (0, base_1.createDeployementJobs)(context, {
43069
+ deploy: __assign(__assign({}, (0, docker_1.getDockerJobBaseProps)(context)), {
43070
+ 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, "\"")]
43071
+ })
43072
+ });
43012
43073
  };
43013
43074
  exports.createDockerTagDeployJobs = createDockerTagDeployJobs;
43014
43075
 
@@ -43221,13 +43282,12 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
43221
43282
  exports.__esModule = true;
43222
43283
  exports.createKubernetesDeployJobs = void 0;
43223
43284
  var js_yaml_1 = __nccwpck_require__(3618);
43224
- var lodash_1 = __nccwpck_require__(3255);
43225
- 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);
43290
+ var getEnvironmentVariables_1 = __nccwpck_require__(6602);
43231
43291
  var createKubernetesDeployJobs = function (context) {
43232
43292
  var _a, _b, _c;
43233
43293
  var deployConfig = context.componentConfig.deploy;
@@ -43239,9 +43299,6 @@ var createKubernetesDeployJobs = function (context) {
43239
43299
  throw new Error("deploy config is not kubernetes");
43240
43300
  }
43241
43301
  var kubeValues = (0, kubeValues_1.createKubeValues)(context);
43242
- var kubernetesEnvironment = {
43243
- namespace: context.environment.envVars.KUBE_NAMESPACE
43244
- };
43245
43302
  var shared = {
43246
43303
  image: (0, runner_1.getRunnerImage)("kubernetes"),
43247
43304
  variables: __assign(__assign({}, context.environment.envVars), {
@@ -43259,27 +43316,19 @@ var createKubernetesDeployJobs = function (context) {
43259
43316
  BUILD_ID: (_c = context.commitInfo) === null || _c === void 0 ? void 0 : _c.buildId
43260
43317
  })
43261
43318
  };
43262
- var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
43263
- var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
43264
- var baseRollbackJob = (0, base_1.getBaseRollbackJob)(context);
43265
43319
  var clusterName = "kube-".concat(context.environment.fullName);
43266
- 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, "\"")];
43267
- return [(0, lodash_1.merge)({}, baseDeploymentJob, shared, {
43268
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesCreateSecret", "kubernetesDeploy"], false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false), ["echo deployment successful 😻"], false),
43269
- environment: {
43270
- kubernetes: kubernetesEnvironment
43271
- }
43272
- }), (0, lodash_1.merge)({}, baseStopJob, shared, {
43273
- script: __spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesDelete"], false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false),
43274
- environment: {
43275
- kubernetes: kubernetesEnvironment
43276
- }
43277
- }), (0, lodash_1.merge)({}, baseRollbackJob, shared, {
43278
- script: __spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesRollback"], false),
43279
- environment: {
43280
- kubernetes: kubernetesEnvironment
43281
- }
43282
- })];
43320
+ var connectContext = ["kubectl config set-cluster \"".concat(clusterName, "\" --server=\"$").concat((0, getEnvironmentVariables_1.getSecretVarNameForContext)(context, "KUBE_URL"), "\" --certificate-authority <(echo $").concat((0, getEnvironmentVariables_1.getSecretVarNameForContext)(context, "KUBE_CA_PEM"), " | base64 -d) --embed-certs=true"), "kubectl config set-credentials \"".concat(clusterName, "\" --token=\"$").concat((0, getEnvironmentVariables_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, "\"")];
43321
+ return (0, base_1.createDeployementJobs)(context, {
43322
+ deploy: __assign(__assign({}, shared), {
43323
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesCreateSecret", "kubernetesDeploy"], false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false), ["echo deployment successful 😻"], false)
43324
+ }),
43325
+ stop: __assign(__assign({}, shared), {
43326
+ script: __spreadArray(__spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesDelete"], false), __read((0, sbom_1.getDependencyTrackDeleteScript)(context)), false)
43327
+ }),
43328
+ rollback: __assign(__assign({}, shared), {
43329
+ script: __spreadArray(__spreadArray([], __read(connectContext), false), ["kubernetesRollback"], false)
43330
+ })
43331
+ });
43283
43332
  };
43284
43333
  exports.createKubernetesDeployJobs = createKubernetesDeployJobs;
43285
43334
 
@@ -43581,9 +43630,10 @@ var __assign = this && this.__assign || function () {
43581
43630
  exports.__esModule = true;
43582
43631
  exports.createMongodbBaseConfig = void 0;
43583
43632
  var lodash_1 = __nccwpck_require__(3255);
43584
- var __1 = __nccwpck_require__(5355);
43633
+ var getEnvironmentVariables_1 = __nccwpck_require__(6602);
43634
+ var types_1 = __nccwpck_require__(3109);
43585
43635
  var getCredentialString = function (context) {
43586
- return "root:$".concat((0, __1.getSecretVarNameForContext)(context, "MONGODB_ROOT_PASSWORD"), "@");
43636
+ return "root:$".concat((0, getEnvironmentVariables_1.getSecretVarNameForContext)(context, "MONGODB_ROOT_PASSWORD"), "@");
43587
43637
  };
43588
43638
  var getMongodbHost = function (context, name) {
43589
43639
  var namespace = context.environment.envVars.KUBE_NAMESPACE;
@@ -43599,7 +43649,7 @@ var getMongodbReplicasetHost = function (context, index) {
43599
43649
  };
43600
43650
  var createMongodbUrl = function (context, dbName) {
43601
43651
  var _a, _b;
43602
- if (!(0, __1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
43652
+ if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
43603
43653
  throw new Error("can only createMongodbUrl on supported deploys");
43604
43654
  }
43605
43655
  var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
@@ -43618,7 +43668,7 @@ var createMongodbUrl = function (context, dbName) {
43618
43668
  };
43619
43669
  var createMongoBackupDefaultConfig = function (context) {
43620
43670
  var _a;
43621
- if (!(0, __1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
43671
+ if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
43622
43672
  throw new Error("can only create mongodb base config on supported deploys");
43623
43673
  }
43624
43674
  var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
@@ -43647,7 +43697,7 @@ var createMongoBackupDefaultConfig = function (context) {
43647
43697
  };
43648
43698
  var createMongodbBaseConfig = function (context) {
43649
43699
  var _a, _b;
43650
- if (!(0, __1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
43700
+ if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
43651
43701
  throw new Error("can only create mongodb base config on supported deploys");
43652
43702
  }
43653
43703
  var mongodbConfig = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.mongodb;
@@ -43656,8 +43706,8 @@ var createMongodbBaseConfig = function (context) {
43656
43706
  enabled: true,
43657
43707
  auth: {
43658
43708
  enabled: true,
43659
- rootPassword: "$" + (0, __1.getSecretVarNameForContext)(context, "MONGODB_ROOT_PASSWORD"),
43660
- replicaSetKey: "$" + (0, __1.getSecretVarNameForContext)(context, "MONGODB_REPLICASET_KEY")
43709
+ rootPassword: "$" + (0, getEnvironmentVariables_1.getSecretVarNameForContext)(context, "MONGODB_ROOT_PASSWORD"),
43710
+ replicaSetKey: "$" + (0, getEnvironmentVariables_1.getSecretVarNameForContext)(context, "MONGODB_REPLICASET_KEY")
43661
43711
  },
43662
43712
  persistence: {
43663
43713
  storageClass: "standard-rwo"
@@ -44973,6 +45023,7 @@ exports.__esModule = true;
44973
45023
  exports.createGitlabJobs = exports.makeGitlabJob = void 0;
44974
45024
  var lodash_1 = __nccwpck_require__(3255);
44975
45025
  var defaults_1 = __nccwpck_require__(7383);
45026
+ var utils_1 = __nccwpck_require__(7461);
44976
45027
  var removeUndefined = function (obj) {
44977
45028
  return Object.fromEntries(Object.entries(obj).filter(function (_a) {
44978
45029
  var _b = __read(_a, 2),
@@ -45008,7 +45059,8 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
45008
45059
  name = _a.name,
45009
45060
  needs = _a.needs,
45010
45061
  jobTags = _a.jobTags,
45011
- job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags"]);
45062
+ script = _a.script,
45063
+ job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs", "jobTags", "script"]);
45012
45064
  var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
45013
45065
  var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
45014
45066
  var _a, _b, _c, _d;
@@ -45042,6 +45094,7 @@ var makeGitlabJob = function (componentName, env, _a, allJobs) {
45042
45094
  })).values()), false);
45043
45095
  var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
45044
45096
  var gitlabJob = removeUndefined(__assign(__assign({}, job), {
45097
+ script: script === null || script === void 0 ? void 0 : script.filter(utils_1.notNil),
45045
45098
  tags: jobTags,
45046
45099
  stage: stage,
45047
45100
  environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {