@catladder/cli 0.0.0-main-0009a81d → 0.0.0-main-a4e913e3

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.
@@ -39882,17 +39882,312 @@ exports.readConfigSync = readConfigSync;
39882
39882
 
39883
39883
  exports.__esModule = true;
39884
39884
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
39885
- exports.PIPELINE_IMAGE_TAG = "main-0009a81d" || 0;
39885
+ exports.PIPELINE_IMAGE_TAG = "main-a4e913e3" || 0;
39886
39886
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
39887
39887
 
39888
39888
  /***/ }),
39889
39889
 
39890
+ /***/ 5706:
39891
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
39892
+
39893
+ "use strict";
39894
+
39895
+
39896
+ exports.__esModule = true;
39897
+ exports.getEnvConfig = void 0;
39898
+
39899
+ var utils_1 = __nccwpck_require__(7461);
39900
+
39901
+ var getEnvConfig = function (config, componentName, env) {
39902
+ var _a, _b;
39903
+
39904
+ var defaultConfig = config.components[componentName];
39905
+
39906
+ if (!defaultConfig) {
39907
+ throw new Error("unknown component " + componentName);
39908
+ }
39909
+
39910
+ var envCustomizations = (_b = (_a = defaultConfig.env) === null || _a === void 0 ? void 0 : _a[env]) !== null && _b !== void 0 ? _b : {};
39911
+
39912
+ if (envCustomizations === false) {
39913
+ throw new Error("env is disabled: " + env);
39914
+ }
39915
+
39916
+ return (0, utils_1.mergeWithMergingArrays)(defaultConfig, envCustomizations);
39917
+ };
39918
+
39919
+ exports.getEnvConfig = getEnvConfig;
39920
+
39921
+ /***/ }),
39922
+
39923
+ /***/ 4811:
39924
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
39925
+
39926
+ "use strict";
39927
+
39928
+
39929
+ exports.__esModule = true;
39930
+ exports.getEnvType = void 0;
39931
+
39932
+ var types_1 = __nccwpck_require__(1753);
39933
+
39934
+ var getEnvType = function (env, envConfig) {
39935
+ if (envConfig.type) return envConfig.type;
39936
+
39937
+ if ((0, types_1.isKnowEnvType)(env)) {
39938
+ return env;
39939
+ }
39940
+
39941
+ throw new Error("unknown env type: " + env);
39942
+ };
39943
+
39944
+ exports.getEnvType = getEnvType;
39945
+
39946
+ /***/ }),
39947
+
39890
39948
  /***/ 740:
39891
39949
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
39892
39950
 
39893
39951
  "use strict";
39894
39952
 
39895
39953
 
39954
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
39955
+ function adopt(value) {
39956
+ return value instanceof P ? value : new P(function (resolve) {
39957
+ resolve(value);
39958
+ });
39959
+ }
39960
+
39961
+ return new (P || (P = Promise))(function (resolve, reject) {
39962
+ function fulfilled(value) {
39963
+ try {
39964
+ step(generator.next(value));
39965
+ } catch (e) {
39966
+ reject(e);
39967
+ }
39968
+ }
39969
+
39970
+ function rejected(value) {
39971
+ try {
39972
+ step(generator["throw"](value));
39973
+ } catch (e) {
39974
+ reject(e);
39975
+ }
39976
+ }
39977
+
39978
+ function step(result) {
39979
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
39980
+ }
39981
+
39982
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
39983
+ });
39984
+ };
39985
+
39986
+ var __generator = this && this.__generator || function (thisArg, body) {
39987
+ var _ = {
39988
+ label: 0,
39989
+ sent: function () {
39990
+ if (t[0] & 1) throw t[1];
39991
+ return t[1];
39992
+ },
39993
+ trys: [],
39994
+ ops: []
39995
+ },
39996
+ f,
39997
+ y,
39998
+ t,
39999
+ g;
40000
+ return g = {
40001
+ next: verb(0),
40002
+ "throw": verb(1),
40003
+ "return": verb(2)
40004
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
40005
+ return this;
40006
+ }), g;
40007
+
40008
+ function verb(n) {
40009
+ return function (v) {
40010
+ return step([n, v]);
40011
+ };
40012
+ }
40013
+
40014
+ function step(op) {
40015
+ if (f) throw new TypeError("Generator is already executing.");
40016
+
40017
+ while (_) try {
40018
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40019
+ if (y = 0, t) op = [op[0] & 2, t.value];
40020
+
40021
+ switch (op[0]) {
40022
+ case 0:
40023
+ case 1:
40024
+ t = op;
40025
+ break;
40026
+
40027
+ case 4:
40028
+ _.label++;
40029
+ return {
40030
+ value: op[1],
40031
+ done: false
40032
+ };
40033
+
40034
+ case 5:
40035
+ _.label++;
40036
+ y = op[1];
40037
+ op = [0];
40038
+ continue;
40039
+
40040
+ case 7:
40041
+ op = _.ops.pop();
40042
+
40043
+ _.trys.pop();
40044
+
40045
+ continue;
40046
+
40047
+ default:
40048
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
40049
+ _ = 0;
40050
+ continue;
40051
+ }
40052
+
40053
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
40054
+ _.label = op[1];
40055
+ break;
40056
+ }
40057
+
40058
+ if (op[0] === 6 && _.label < t[1]) {
40059
+ _.label = t[1];
40060
+ t = op;
40061
+ break;
40062
+ }
40063
+
40064
+ if (t && _.label < t[2]) {
40065
+ _.label = t[2];
40066
+
40067
+ _.ops.push(op);
40068
+
40069
+ break;
40070
+ }
40071
+
40072
+ if (t[2]) _.ops.pop();
40073
+
40074
+ _.trys.pop();
40075
+
40076
+ continue;
40077
+ }
40078
+
40079
+ op = body.call(thisArg, _);
40080
+ } catch (e) {
40081
+ op = [6, e];
40082
+ y = 0;
40083
+ } finally {
40084
+ f = t = 0;
40085
+ }
40086
+
40087
+ if (op[0] & 5) throw op[1];
40088
+ return {
40089
+ value: op[0] ? op[1] : void 0,
40090
+ done: true
40091
+ };
40092
+ }
40093
+ };
40094
+
40095
+ exports.__esModule = true;
40096
+ exports.getEnvironment = void 0;
40097
+
40098
+ var getEnvironmentContext_1 = __nccwpck_require__(4650);
40099
+
40100
+ var getEnvironmentVariables_1 = __nccwpck_require__(6602);
40101
+
40102
+ var getEnvironment = function (config, componentName, env, commitInfo) {
40103
+ return __awaiter(void 0, void 0, void 0, function () {
40104
+ var _a, envVars, secretEnvVarKeys, host, url, envContext, envType;
40105
+
40106
+ return __generator(this, function (_b) {
40107
+ switch (_b.label) {
40108
+ case 0:
40109
+ return [4
40110
+ /*yield*/
40111
+ , (0, getEnvironmentVariables_1.getEnvironmentVariables)(config, componentName, env, commitInfo)];
40112
+
40113
+ case 1:
40114
+ _a = _b.sent(), envVars = _a.envVars, secretEnvVarKeys = _a.secretEnvVarKeys, host = _a.host, url = _a.url;
40115
+ envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
40116
+ envType = envContext.envType;
40117
+ return [2
40118
+ /*return*/
40119
+ , {
40120
+ envType: envType,
40121
+ host: host,
40122
+ url: url,
40123
+ gitlabEnvironment: {
40124
+ name: envContext.gitlabEnvironmentName,
40125
+ url: url
40126
+ },
40127
+ fullName: envContext.fullName,
40128
+ slug: envContext.environmentSlug,
40129
+ shortName: env,
40130
+ envVars: envVars,
40131
+ secretEnvVarKeys: secretEnvVarKeys
40132
+ }];
40133
+ }
40134
+ });
40135
+ });
40136
+ };
40137
+
40138
+ exports.getEnvironment = getEnvironment;
40139
+
40140
+ /***/ }),
40141
+
40142
+ /***/ 4650:
40143
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
40144
+
40145
+ "use strict";
40146
+
40147
+
40148
+ exports.__esModule = true;
40149
+ exports.getEnvironmentContext = void 0;
40150
+
40151
+ var getEnvConfig_1 = __nccwpck_require__(5706);
40152
+
40153
+ var getEnvType_1 = __nccwpck_require__(4811);
40154
+
40155
+ var getEnvironmentSlug = function (envConfig, env, componentName, commitInfo) {
40156
+ var envType = (0, getEnvType_1.getEnvType)(env, envConfig);
40157
+ return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug, "-").concat(componentName) : "".concat(env, "-").concat(componentName);
40158
+ };
40159
+
40160
+ var getEnvironmentContext = function (config, env, componentName, commitInfo) {
40161
+ var envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
40162
+ var envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw);
40163
+ var environmentSlug = getEnvironmentSlug(envConfigRaw, env, componentName, commitInfo);
40164
+ var gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
40165
+ var fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
40166
+ return {
40167
+ envConfigRaw: envConfigRaw,
40168
+ deployConfigRaw: envConfigRaw.deploy,
40169
+ buildConfigRaw: envConfigRaw.build,
40170
+ environmentSlug: environmentSlug,
40171
+ gitlabEnvironmentName: gitlabEnvironmentName,
40172
+ fullName: fullName,
40173
+ envType: envType,
40174
+ commitInfo: commitInfo,
40175
+ componentName: componentName,
40176
+ env: env,
40177
+ fullConfig: config
40178
+ };
40179
+ };
40180
+
40181
+ exports.getEnvironmentContext = getEnvironmentContext;
40182
+
40183
+ /***/ }),
40184
+
40185
+ /***/ 6602:
40186
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
40187
+
40188
+ "use strict";
40189
+
40190
+
39896
40191
  var __assign = this && this.__assign || function () {
39897
40192
  __assign = Object.assign || function (t) {
39898
40193
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -40084,60 +40379,41 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
40084
40379
  };
40085
40380
 
40086
40381
  exports.__esModule = true;
40087
- exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironment = void 0;
40382
+ exports.getSecretVarNameForContext = exports.getSecretVarName = exports.getEnvironmentVariables = void 0;
40088
40383
 
40089
40384
  var lodash_1 = __nccwpck_require__(3255);
40090
40385
 
40091
40386
  var deploy_1 = __nccwpck_require__(223);
40092
40387
 
40093
- var config_1 = __nccwpck_require__(9997);
40094
-
40095
- var utils_1 = __nccwpck_require__(7461);
40388
+ var getEnvironmentContext_1 = __nccwpck_require__(4650);
40096
40389
 
40097
40390
  var resolveReferences_1 = __nccwpck_require__(928);
40098
40391
 
40099
- var getEnvironment = function (config, componentName, env, commitInfo, alreadyVisited // to prevent endless loop
40392
+ var getEnvironmentVariables = function (config, componentName, env, commitInfo, alreadyVisited // to prevent endless loop
40100
40393
  ) {
40101
40394
  if (alreadyVisited === void 0) {
40102
40395
  alreadyVisited = {};
40103
40396
  }
40104
40397
 
40105
40398
  return __awaiter(void 0, void 0, void 0, function () {
40106
- var envConfig, envType, basePredefinedVariables, gitlabEnvironmentName, environmentSlug, predefinedVariables, host, url, fullName, envVarContext, devLocalConfig, port, additionalEnvVars, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegasyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
40399
+ var environmentContext, envConfigRaw, deployConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegasyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
40107
40400
 
40108
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
40401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40109
40402
 
40110
- return __generator(this, function (_l) {
40111
- switch (_l.label) {
40403
+ return __generator(this, function (_k) {
40404
+ switch (_k.label) {
40112
40405
  case 0:
40113
- envConfig = getEnvConfig(config, componentName, env);
40114
- envType = (_a = envConfig === null || envConfig === void 0 ? void 0 : envConfig.type) !== null && _a !== void 0 ? _a : (0, config_1.isKnowEnvType)(env) ? env : null;
40115
-
40116
- if (!envType) {
40117
- throw new Error("Missing type in environment " + env + " in component " + componentName);
40118
- }
40119
-
40406
+ environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
40407
+ envConfigRaw = environmentContext.envConfigRaw, deployConfigRaw = environmentContext.deployConfigRaw, envType = environmentContext.envType;
40120
40408
  basePredefinedVariables = {
40121
40409
  ENV_SHORT: env,
40122
- APP_DIR: envConfig.dir,
40410
+ APP_DIR: envConfigRaw.dir,
40123
40411
  ENV_TYPE: envType
40124
40412
  };
40125
- gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
40126
- environmentSlug = envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug, "-").concat(componentName) : "".concat(env, "-").concat(componentName);
40127
- fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
40128
- envVarContext = {
40129
- deployConfig: envConfig.deploy,
40130
- fullName: fullName,
40131
- envType: envType,
40132
- commitInfo: commitInfo,
40133
- componentName: componentName,
40134
- env: env,
40135
- fullConfig: config
40136
- };
40137
40413
 
40138
40414
  if (envType === "local") {
40139
- devLocalConfig = envConfig;
40140
- port = (_b = devLocalConfig.port) !== null && _b !== void 0 ? _b : 3000;
40415
+ devLocalConfig = envConfigRaw;
40416
+ port = (_a = devLocalConfig.port) !== null && _a !== void 0 ? _a : 3000;
40141
40417
  host = "localhost:" + port;
40142
40418
  url = "http://" + host;
40143
40419
  predefinedVariables = {
@@ -40146,8 +40422,8 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
40146
40422
  PORT: port.toString()
40147
40423
  };
40148
40424
  } else {
40149
- additionalEnvVars = envConfig.deploy ? deploy_1.DEPLOY_TYPES[envConfig.deploy.type].getAdditionalEnvVars(envVarContext) : {};
40150
- host = (_d = (_c = envConfig === null || envConfig === void 0 ? void 0 : envConfig.host) !== null && _c !== void 0 ? _c : additionalEnvVars.HOST_CANONICAL) !== null && _d !== void 0 ? _d : "unknown-host.example.com";
40425
+ additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
40426
+ host = (_c = (_b = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _b !== void 0 ? _b : additionalEnvVars.HOST_CANONICAL) !== null && _c !== void 0 ? _c : "unknown-host.example.com";
40151
40427
  url = "https://".concat(host);
40152
40428
  predefinedVariables = __assign(__assign(__assign({}, basePredefinedVariables), {
40153
40429
  HOST: host,
@@ -40155,13 +40431,13 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
40155
40431
  }), additionalEnvVars);
40156
40432
  }
40157
40433
 
40158
- publicEnvVarsRaw = (_f = (_e = envConfig.vars) === null || _e === void 0 ? void 0 : _e.public) !== null && _f !== void 0 ? _f : {};
40159
- additionalSecretKeys = envConfig.deploy ? deploy_1.DEPLOY_TYPES[envConfig.deploy.type].additionalSecretKeys(envVarContext) : [];
40160
- secretEnvVarKeys = __spreadArray(__spreadArray([], __read((_h = (_g = envConfig.vars) === null || _g === void 0 ? void 0 : _g.secret) !== null && _h !== void 0 ? _h : []), false), __read(additionalSecretKeys), false);
40434
+ publicEnvVarsRaw = (_e = (_d = envConfigRaw.vars) === null || _d === void 0 ? void 0 : _d.public) !== null && _e !== void 0 ? _e : {};
40435
+ additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
40436
+ secretEnvVarKeys = __spreadArray(__spreadArray([], __read((_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.secret) !== null && _g !== void 0 ? _g : []), false), __read(additionalSecretKeys), false);
40161
40437
  secretEnvVars = Object.fromEntries(secretEnvVarKeys.map(function (key) {
40162
40438
  return [key, "$".concat((0, exports.getSecretVarName)(env, componentName, key))];
40163
40439
  }));
40164
- legacyFromComponents = (_k = (_j = envConfig.vars) === null || _j === void 0 ? void 0 : _j.fromComponents) !== null && _k !== void 0 ? _k : {};
40440
+ legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
40165
40441
  publicEnvVarsRawWithLegasyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
40166
40442
  publicEnvVarsRawSanitized = Object.fromEntries(Object.entries(publicEnvVarsRawWithLegasyFromComponents).map(function (_a) {
40167
40443
  var _b = __read(_a, 2),
@@ -40173,50 +40449,42 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
40173
40449
  envVarsRaw = addIndexVar(__assign(__assign(__assign({}, predefinedVariables), secretEnvVars), publicEnvVarsRawSanitized));
40174
40450
  return [4
40175
40451
  /*yield*/
40176
- , (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (componentName, variableName, alreadyVisited) {
40452
+ , (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, variableName, alreadyVisited) {
40177
40453
  return __awaiter(void 0, void 0, void 0, function () {
40178
- var envVars;
40454
+ var otherEnvVars;
40179
40455
  return __generator(this, function (_a) {
40180
40456
  switch (_a.label) {
40181
40457
  case 0:
40182
40458
  return [4
40183
40459
  /*yield*/
40184
- , (0, exports.getEnvironment)(config, componentName, env, commitInfo, alreadyVisited)];
40460
+ , (0, exports.getEnvironmentVariables)(config, otherComponentName, env, commitInfo, alreadyVisited)];
40185
40461
 
40186
40462
  case 1:
40187
- envVars = _a.sent().envVars;
40463
+ otherEnvVars = _a.sent().envVars;
40188
40464
  return [2
40189
40465
  /*return*/
40190
- , envVars[variableName]];
40466
+ , otherEnvVars[variableName]];
40191
40467
  }
40192
40468
  });
40193
40469
  });
40194
40470
  }, alreadyVisited)];
40195
40471
 
40196
40472
  case 1:
40197
- envVars = _l.sent();
40473
+ envVars = _k.sent();
40198
40474
  return [2
40199
40475
  /*return*/
40200
40476
  , {
40201
- envType: envType,
40202
- host: host,
40203
- url: url,
40204
- gitlabEnvironment: {
40205
- name: gitlabEnvironmentName,
40206
- url: url
40207
- },
40208
- fullName: fullName,
40209
- slug: environmentSlug,
40210
- shortName: env,
40211
40477
  envVars: envVars,
40212
- secretEnvVarKeys: secretEnvVarKeys
40478
+ secretEnvVarKeys: secretEnvVarKeys,
40479
+ host: host,
40480
+ url: url
40213
40481
  }];
40214
40482
  }
40215
40483
  });
40216
40484
  });
40217
40485
  };
40218
40486
 
40219
- exports.getEnvironment = getEnvironment;
40487
+ exports.getEnvironmentVariables = getEnvironmentVariables;
40220
40488
 
40221
40489
  var sanitizeForEnVar = function (s) {
40222
40490
  return s.replace(/-/g, "_");
@@ -40241,24 +40509,6 @@ var getSecretVarNameForContext = function (context, key) {
40241
40509
 
40242
40510
  exports.getSecretVarNameForContext = getSecretVarNameForContext;
40243
40511
 
40244
- var getEnvConfig = function (config, componentName, env) {
40245
- var _a, _b;
40246
-
40247
- var defaultConfig = config.components[componentName];
40248
-
40249
- if (!defaultConfig) {
40250
- throw new Error("unknown component " + componentName);
40251
- }
40252
-
40253
- var envCustomizations = (_b = (_a = defaultConfig.env) === null || _a === void 0 ? void 0 : _a[env]) !== null && _b !== void 0 ? _b : {};
40254
-
40255
- if (envCustomizations === false) {
40256
- throw new Error("env is disabled: " + env);
40257
- }
40258
-
40259
- return (0, utils_1.mergeWithMergingArrays)(defaultConfig, envCustomizations);
40260
- };
40261
-
40262
40512
  /***/ }),
40263
40513
 
40264
40514
  /***/ 486:
@@ -40492,34 +40742,30 @@ var utils_1 = __nccwpck_require__(7461);
40492
40742
 
40493
40743
  var getEnvironment_1 = __nccwpck_require__(740);
40494
40744
 
40745
+ var getEnvironmentContext_1 = __nccwpck_require__(4650);
40746
+
40495
40747
  __exportStar(__nccwpck_require__(740), exports);
40496
40748
 
40749
+ __exportStar(__nccwpck_require__(6602), exports);
40750
+
40497
40751
  var createContext = function (config, componentName, env, commitInfo, packageManagerInfo) {
40498
40752
  return __awaiter(void 0, void 0, void 0, function () {
40499
- var rawConfig, envConfig, componentConfigWithoutDefaults, defaults, componentConfig;
40753
+ var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
40500
40754
 
40501
40755
  var _a;
40502
40756
 
40503
- var _b, _c;
40504
-
40505
- return __generator(this, function (_d) {
40506
- switch (_d.label) {
40757
+ return __generator(this, function (_b) {
40758
+ switch (_b.label) {
40507
40759
  case 0:
40508
40760
  if (!/^[a-z0-9-]+$/.test(componentName)) {
40509
40761
  throw new Error("componentName may only contain lower case letters, numbers and -");
40510
40762
  }
40511
40763
 
40512
- rawConfig = config.components[componentName];
40513
-
40514
- if (!rawConfig) {
40515
- throw new Error("unknown component " + componentName);
40516
- }
40517
-
40518
- envConfig = (_c = (_b = rawConfig.env) === null || _b === void 0 ? void 0 : _b[env]) !== null && _c !== void 0 ? _c : {};
40519
- componentConfigWithoutDefaults = (0, utils_1.mergeWithMergingArrays)(rawConfig, envConfig);
40764
+ envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
40765
+ componentConfigWithoutDefaults = envContext.envConfigRaw;
40520
40766
  defaults = componentConfigWithoutDefaults.deploy ? {
40521
- build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(),
40522
- deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults()
40767
+ build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(envContext),
40768
+ deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext)
40523
40769
  } : {
40524
40770
  build: {},
40525
40771
  deploy: {}
@@ -40537,7 +40783,7 @@ var createContext = function (config, componentName, env, commitInfo, packageMan
40537
40783
  case 1:
40538
40784
  return [2
40539
40785
  /*return*/
40540
- , (_a.environment = _d.sent(), _a.commitInfo = commitInfo, _a.packageManagerInfo = packageManagerInfo, _a)];
40786
+ , (_a.environment = _b.sent(), _a.commitInfo = commitInfo, _a.packageManagerInfo = packageManagerInfo, _a)];
40541
40787
  }
40542
40788
  });
40543
40789
  });
@@ -41294,14 +41540,14 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
41294
41540
  var fullName = _a.fullName,
41295
41541
  env = _a.env,
41296
41542
  componentName = _a.componentName,
41297
- deployConfig = _a.deployConfig;
41543
+ deployConfigRaw = _a.deployConfigRaw;
41298
41544
  var HOST_CANONICAL = fullName.toLowerCase() + "-" + process.env[(0, context_1.getSecretVarName)(env, componentName, exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)];
41299
- var jobTriggers = deployConfig && deployConfig.jobs ? Object.fromEntries(Object.entries(deployConfig.jobs).map(function (_a) {
41545
+ var jobTriggers = deployConfigRaw && deployConfigRaw.jobs ? Object.fromEntries(Object.entries(deployConfigRaw.jobs).map(function (_a) {
41300
41546
  var _b = __read(_a, 2),
41301
41547
  name = _b[0],
41302
41548
  job = _b[1];
41303
41549
 
41304
- return ["CLOUD_RUN_JOB_TRIGGER_URL_" + name, "https://".concat(deployConfig.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfig.projectId, "/jobs/").concat(name, ":run")];
41550
+ return ["CLOUD_RUN_JOB_TRIGGER_URL_" + name, "https://".concat(deployConfigRaw.region, "-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(deployConfigRaw.projectId, "/jobs/").concat(name, ":run")];
41305
41551
  })) : {};
41306
41552
  return __assign({
41307
41553
  HOST_CANONICAL: HOST_CANONICAL
@@ -41570,16 +41816,16 @@ var dockerTag_1 = __nccwpck_require__(8990);
41570
41816
 
41571
41817
  var kubernetes_1 = __nccwpck_require__(5682);
41572
41818
 
41819
+ __exportStar(__nccwpck_require__(1344), exports);
41820
+
41821
+ __exportStar(__nccwpck_require__(3539), exports);
41822
+
41573
41823
  __exportStar(__nccwpck_require__(5682), exports);
41574
41824
 
41575
41825
  __exportStar(__nccwpck_require__(3109), exports);
41576
41826
 
41577
41827
  __exportStar(__nccwpck_require__(2757), exports);
41578
41828
 
41579
- __exportStar(__nccwpck_require__(3539), exports);
41580
-
41581
- __exportStar(__nccwpck_require__(1344), exports);
41582
-
41583
41829
  exports.DEPLOY_TYPES = {
41584
41830
  kubernetes: kubernetes_1.KUBERNETES_DEPLOY_TYPE,
41585
41831
  custom: custom_1.CUSTOM_DEPLOY_TYPE,
@@ -41601,23 +41847,23 @@ exports.additionalKubernetesSecretKeys = void 0;
41601
41847
  var additionalKubernetesSecretKeys = function (_a) {
41602
41848
  var _b, _c, _d, _e;
41603
41849
 
41604
- var deployConfig = _a.deployConfig;
41850
+ var deployConfigRaw = _a.deployConfigRaw;
41605
41851
 
41606
- if (!deployConfig) {
41852
+ if (!deployConfigRaw) {
41607
41853
  return [];
41608
41854
  }
41609
41855
 
41610
41856
  var keys = [];
41611
41857
 
41612
- if ((_c = (_b = deployConfig.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled) {
41858
+ if ((_c = (_b = deployConfigRaw.values) === null || _b === void 0 ? void 0 : _b.mongodb) === null || _c === void 0 ? void 0 : _c.enabled) {
41613
41859
  keys.push("MONGODB_ROOT_PASSWORD");
41614
41860
 
41615
- if (deployConfig.values.mongodb.architecture === "replicaset") {
41861
+ if (deployConfigRaw.values.mongodb.architecture === "replicaset") {
41616
41862
  keys.push("MONGODB_REPLICASET_KEY");
41617
41863
  }
41618
41864
  }
41619
41865
 
41620
- if ((_e = (_d = deployConfig.values) === null || _d === void 0 ? void 0 : _d.cloudsql) === null || _e === void 0 ? void 0 : _e.enabled) {
41866
+ if ((_e = (_d = deployConfigRaw.values) === null || _d === void 0 ? void 0 : _d.cloudsql) === null || _e === void 0 ? void 0 : _e.enabled) {
41621
41867
  keys.push("POSTGRESQL_PASSWORD");
41622
41868
  keys.push("cloudsqlProxyCredentials");
41623
41869
  }
@@ -41820,7 +42066,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
41820
42066
 
41821
42067
  var componentName = _a.componentName,
41822
42068
  fullConfig = _a.fullConfig,
41823
- deployConfig = _a.deployConfig,
42069
+ deployConfigRaw = _a.deployConfigRaw,
41824
42070
  env = _a.env,
41825
42071
  envType = _a.envType,
41826
42072
  commitInfo = _a.commitInfo;
@@ -41829,7 +42075,7 @@ exports.KUBERNETES_DEPLOY_TYPE = {
41829
42075
  var KUBE_NAMESPACE = (0, __1.getKubernetesNamespace)(fullConfig, env);
41830
42076
  var componentSlug = (0, slugify_1["default"])(componentName);
41831
42077
  var envInUrl = envType === "review" && commitInfo ? "".concat(commitInfo.reviewSlug, ".").concat(env) : env;
41832
- var domainCanonical = deployConfig && ((_b = deployConfig.cluster) === null || _b === void 0 ? void 0 : _b.domainCanonical) || // for convenience, we allow clusters to define a canonical domain, because a cluster has a fixed ip and you will usually have a domain pointing to that cluster
42078
+ var domainCanonical = deployConfigRaw && ((_b = deployConfigRaw.cluster) === null || _b === void 0 ? void 0 : _b.domainCanonical) || // for convenience, we allow clusters to define a canonical domain, because a cluster has a fixed ip and you will usually have a domain pointing to that cluster
41833
42079
  fullConfig.domainCanonical || "panter.cloud";
41834
42080
  var HOST_CANONICAL = "".concat(componentSlug, ".").concat(envInUrl, ".").concat(fullConfig.appName, ".").concat(fullConfig.customerName, ".").concat(domainCanonical); // default for kubernetes and rest
41835
42081