@catladder/cli 0.0.0-main-414c8270 → 0.0.0-main-722844ec

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.
Files changed (44) hide show
  1. package/dist/apps/catenv/catenv.d.ts +2 -4
  2. package/dist/apps/catenv/catenv.js +8 -89
  3. package/dist/apps/catenv/catenv.js.map +1 -1
  4. package/dist/apps/catenv/printVariables.d.ts +3 -0
  5. package/dist/apps/catenv/printVariables.js +111 -0
  6. package/dist/apps/catenv/printVariables.js.map +1 -0
  7. package/dist/apps/catenv/types.d.ts +5 -0
  8. package/dist/apps/catenv/types.js +3 -0
  9. package/dist/apps/catenv/types.js.map +1 -0
  10. package/dist/apps/catenv/utils.d.ts +12 -0
  11. package/dist/apps/catenv/utils.js +108 -0
  12. package/dist/apps/catenv/utils.js.map +1 -0
  13. package/dist/apps/catenv/writeDotEnvFiles.d.ts +3 -0
  14. package/dist/apps/catenv/writeDotEnvFiles.js +93 -0
  15. package/dist/apps/catenv/writeDotEnvFiles.js.map +1 -0
  16. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +1 -1
  17. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -1
  18. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +14 -11
  19. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
  20. package/dist/apps/cli/commands/project/commandConfigSecrets.js +36 -11
  21. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
  22. package/dist/apps/cli/commands/project/commandEnvVars.js +1 -1
  23. package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -1
  24. package/dist/bundles/catenv/index.js +702 -122
  25. package/dist/bundles/cli/index.js +441 -85
  26. package/dist/config/getProjectConfig.d.ts +8 -1
  27. package/dist/config/getProjectConfig.js +45 -6
  28. package/dist/config/getProjectConfig.js.map +1 -1
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/dist/utils/gitlab.d.ts +4 -4
  31. package/dist/utils/gitlab.js.map +1 -1
  32. package/package.json +2 -2
  33. package/src/apps/catenv/catenv.ts +8 -62
  34. package/src/apps/catenv/printVariables.ts +51 -0
  35. package/src/apps/catenv/types.ts +6 -0
  36. package/src/apps/catenv/utils.ts +49 -0
  37. package/src/apps/catenv/writeDotEnvFiles.ts +45 -0
  38. package/src/apps/cli/commands/mongodb/projectMongoPortForward.ts +5 -2
  39. package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +18 -12
  40. package/src/apps/cli/commands/project/commandConfigSecrets.ts +26 -7
  41. package/src/apps/cli/commands/project/commandEnvVars.ts +5 -2
  42. package/src/config/getProjectConfig.ts +30 -6
  43. package/src/utils/gitlab.ts +4 -4
  44. package/tsconfig.json +1 -1
@@ -1201,7 +1201,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
1201
1201
  case 7:
1202
1202
  localPort = (_c.sent()).localPort;
1203
1203
  _b = (0, getProjectConfig_1.parseChoice)(envComponent), env = _b.env, componentName = _b.componentName;
1204
- return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(this, env, componentName)];
1204
+ return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(this, env, componentName)];
1205
1205
  case 8:
1206
1206
  envVars = _c.sent();
1207
1207
  MONGODB_ROOT_PASSWORD = envVars === null || envVars === void 0 ? void 0 : envVars.MONGODB_ROOT_PASSWORD;
@@ -1455,7 +1455,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
1455
1455
  };
1456
1456
  exports.__esModule = true;
1457
1457
  var pipeline_1 = __nccwpck_require__(25355);
1458
- var pipeline_2 = __nccwpck_require__(25355);
1459
1458
  var child_process_promise_1 = __nccwpck_require__(75763);
1460
1459
  var getProjectConfig_1 = __nccwpck_require__(24146);
1461
1460
  var autocompletions_1 = __nccwpck_require__(41373);
@@ -1477,20 +1476,24 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
1477
1476
  switch (_c.label) {
1478
1477
  case 0:
1479
1478
  _b = (0, getProjectConfig_1.parseChoice)(envComponent), env = _b.env, componentName = _b.componentName;
1479
+ if (!componentName) {
1480
+ this.log("need componentName");
1481
+ return [2 /*return*/];
1482
+ }
1480
1483
  return [4 /*yield*/, (0, getProjectConfig_1.getPipelineContextByChoice)(env, componentName)];
1481
1484
  case 1:
1482
1485
  context = _c.sent();
1483
1486
  if (env === "review") {
1484
1487
  vorpal.log("⚠️ connection string does not include mr information on review environments");
1485
1488
  }
1486
- if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) return [3 /*break*/, 3];
1487
- return [4 /*yield*/, getProxyInfoForKubernetes(context)];
1489
+ if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) return [3 /*break*/, 3];
1490
+ return [4 /*yield*/, getProxyInfoForKubernetes(this, context)];
1488
1491
  case 2:
1489
1492
  proxyInfo = _c.sent();
1490
1493
  return [3 /*break*/, 6];
1491
1494
  case 3:
1492
- if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")) return [3 /*break*/, 5];
1493
- return [4 /*yield*/, getProxyInfoForCloudRun(context)];
1495
+ if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")) return [3 /*break*/, 5];
1496
+ return [4 /*yield*/, getProxyInfoForCloudRun(this, context)];
1494
1497
  case 4:
1495
1498
  proxyInfo = _c.sent();
1496
1499
  return [3 /*break*/, 6];
@@ -1528,15 +1531,15 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
1528
1531
  }
1529
1532
  });
1530
1533
  }); });
1531
- var getProxyInfoForKubernetes = function (context) { return __awaiter(void 0, void 0, void 0, function () {
1534
+ var getProxyInfoForKubernetes = function (vorpal, context) { return __awaiter(void 0, void 0, void 0, function () {
1532
1535
  var envVars, cloudSqlValues, DB_PASSWORD, DB_NAME, instanceName;
1533
1536
  return __generator(this, function (_a) {
1534
1537
  switch (_a.label) {
1535
1538
  case 0:
1536
- if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
1539
+ if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
1537
1540
  throw new Error("unsupported");
1538
1541
  }
1539
- return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(this, context.environment.shortName, context.componentName)];
1542
+ return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(vorpal, context.environment.shortName, context.componentName)];
1540
1543
  case 1:
1541
1544
  envVars = _a.sent();
1542
1545
  cloudSqlValues = (0, pipeline_1.createKubernetesCloudsqlBaseValues)(context);
@@ -1552,16 +1555,16 @@ var getProxyInfoForKubernetes = function (context) { return __awaiter(void 0, vo
1552
1555
  }
1553
1556
  });
1554
1557
  }); };
1555
- var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void 0, void 0, function () {
1558
+ var getProxyInfoForCloudRun = function (vorpal, context) { return __awaiter(void 0, void 0, void 0, function () {
1556
1559
  var envVars, DB_PASSWORD, DB_USER, DB_NAME;
1557
1560
  return __generator(this, function (_a) {
1558
1561
  switch (_a.label) {
1559
1562
  case 0:
1560
- if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ||
1563
+ if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ||
1561
1564
  !context.componentConfig.deploy.cloudSql) {
1562
1565
  throw new Error("unsupported");
1563
1566
  }
1564
- return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(this, context.environment.shortName, context.componentName)];
1567
+ return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(vorpal, context.environment.shortName, context.componentName)];
1565
1568
  case 1:
1566
1569
  envVars = _a.sent();
1567
1570
  DB_PASSWORD = envVars === null || envVars === void 0 ? void 0 : envVars.DB_PASSWORD;
@@ -1589,6 +1592,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
1589
1592
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
1590
1593
  return cooked;
1591
1594
  };
1595
+ var __assign = (this && this.__assign) || function () {
1596
+ __assign = Object.assign || function(t) {
1597
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1598
+ s = arguments[i];
1599
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1600
+ t[p] = s[p];
1601
+ }
1602
+ return t;
1603
+ };
1604
+ return __assign.apply(this, arguments);
1605
+ };
1592
1606
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1593
1607
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1594
1608
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1625,6 +1639,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
1625
1639
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1626
1640
  }
1627
1641
  };
1642
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
1643
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1644
+ if (ar || !(i in from)) {
1645
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1646
+ ar[i] = from[i];
1647
+ }
1648
+ }
1649
+ return to.concat(ar || Array.prototype.slice.call(from));
1650
+ };
1628
1651
  exports.__esModule = true;
1629
1652
  exports.projectConfigSecrets = void 0;
1630
1653
  /* eslint-disable no-constant-condition */
@@ -1660,27 +1683,32 @@ var resolveJson = function (v) {
1660
1683
  ];
1661
1684
  }));
1662
1685
  };
1663
- var getNonHiddenSecretEnvVarKeys = function (env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
1664
- var secretEnvVarKeys;
1665
- return __generator(this, function (_a) {
1666
- switch (_a.label) {
1686
+ var getSecretEnvVarKeysToConfigure = function (env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
1687
+ var _a, secretEnvVarKeys, jobOnlyVars;
1688
+ return __generator(this, function (_b) {
1689
+ switch (_b.label) {
1667
1690
  case 0: return [4 /*yield*/, (0, getProjectConfig_1.getEnvironment)(env, componentName)];
1668
1691
  case 1:
1669
- secretEnvVarKeys = (_a.sent()).secretEnvVarKeys;
1670
- return [2 /*return*/, secretEnvVarKeys.filter(function (k) { return !k.hidden; }).map(function (k) { return k.key; })];
1692
+ _a = _b.sent(), secretEnvVarKeys = _a.secretEnvVarKeys, jobOnlyVars = _a.jobOnlyVars;
1693
+ return [2 /*return*/, __spreadArray(__spreadArray(__spreadArray([], jobOnlyVars.build.secretEnvVarKeys, true), jobOnlyVars.deploy.secretEnvVarKeys, true), secretEnvVarKeys, true).filter(function (k) { return !k.hidden; })
1694
+ .map(function (k) { return k.key; })];
1671
1695
  }
1672
1696
  });
1673
1697
  }); };
1674
1698
  var getEnvVarsToEdit = function (instance, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
1675
- var secretEnvVarKeys, allEnvVars;
1699
+ var secretEnvVarKeys, normalEnvVars, jobOnlyEnvVars, allEnvVars;
1676
1700
  return __generator(this, function (_a) {
1677
1701
  switch (_a.label) {
1678
- case 0: return [4 /*yield*/, getNonHiddenSecretEnvVarKeys(env, componentName)];
1702
+ case 0: return [4 /*yield*/, getSecretEnvVarKeysToConfigure(env, componentName)];
1679
1703
  case 1:
1680
1704
  secretEnvVarKeys = _a.sent();
1681
- return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(instance, env, componentName)];
1705
+ return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(instance, env, componentName)];
1682
1706
  case 2:
1683
- allEnvVars = _a.sent();
1707
+ normalEnvVars = _a.sent();
1708
+ return [4 /*yield*/, (0, getProjectConfig_1.getJobOnlyEnvVarsResolved)(instance, env, componentName)];
1709
+ case 3:
1710
+ jobOnlyEnvVars = _a.sent();
1711
+ allEnvVars = __assign(__assign({}, normalEnvVars), jobOnlyEnvVars);
1684
1712
  return [2 /*return*/, Object.fromEntries(secretEnvVarKeys.map(function (key) {
1685
1713
  var value = allEnvVars[key];
1686
1714
  // due to some quirky way to resolve these variables, unset variables have the $CL_ prefix, so we remove thouse here
@@ -1754,7 +1782,7 @@ var doItFor = function (instance, envAndComponents) { return __awaiter(void 0, v
1754
1782
  usedKeys = valuesToEdit[componentName][env]
1755
1783
  ? Object.keys(valuesToEdit[componentName][env])
1756
1784
  : [];
1757
- return [4 /*yield*/, getNonHiddenSecretEnvVarKeys(env, componentName)];
1785
+ return [4 /*yield*/, getSecretEnvVarKeysToConfigure(env, componentName)];
1758
1786
  case 6:
1759
1787
  secretEnvVarKeys = _k.sent();
1760
1788
  extranous = (0, lodash_1.difference)(usedKeys, secretEnvVarKeys);
@@ -2191,7 +2219,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
2191
2219
  switch (_c.label) {
2192
2220
  case 0:
2193
2221
  _b = (0, getProjectConfig_1.parseChoice)(envComponent), env = _b.env, componentName = _b.componentName;
2194
- return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(this, env, componentName)];
2222
+ return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(this, env, componentName)];
2195
2223
  case 1:
2196
2224
  envvars = _c.sent();
2197
2225
  Object.keys(envvars).forEach(function (key) {
@@ -6116,6 +6144,17 @@ exports.GRAFANA_PROXY_TARGET_PORT = 9090;
6116
6144
 
6117
6145
  "use strict";
6118
6146
 
6147
+ var __assign = (this && this.__assign) || function () {
6148
+ __assign = Object.assign || function(t) {
6149
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6150
+ s = arguments[i];
6151
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6152
+ t[p] = s[p];
6153
+ }
6154
+ return t;
6155
+ };
6156
+ return __assign.apply(this, arguments);
6157
+ };
6119
6158
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6120
6159
  if (k2 === undefined) k2 = k;
6121
6160
  Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
@@ -6160,7 +6199,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
6160
6199
  }
6161
6200
  };
6162
6201
  exports.__esModule = true;
6163
- exports.getEnvVars = exports.getGitlabVar = exports.getEnvironment = exports.getAllPipelineContexts = exports.getAllComponentsWithAllEnvsHierarchical = exports.getAllComponentsWithAllEnvsFlat = exports.getPipelineContextByChoice = exports.getProjectComponents = exports.getGitlabCi = exports.getGitlabCiFilePath = exports.getProjectConfig = exports.parseChoice = void 0;
6202
+ exports.getJobOnlyEnvVarsResolved = exports.getEnvVarsResolved = exports.getGitlabVar = exports.getEnvironment = exports.getAllPipelineContexts = exports.getAllComponentsWithAllEnvsHierarchical = exports.getAllComponentsWithAllEnvsFlat = exports.getPipelineContextByChoice = exports.getProjectComponents = exports.getGitlabCi = exports.getGitlabCiFilePath = exports.getProjectConfig = exports.parseChoice = void 0;
6164
6203
  var pipeline_1 = __nccwpck_require__(25355);
6165
6204
  var gitlab_1 = __nccwpck_require__(79818);
6166
6205
  var projects_1 = __nccwpck_require__(41619);
@@ -6364,27 +6403,55 @@ var resolveSecrets = function (vorpal, allEnvVars) { return __awaiter(void 0, vo
6364
6403
  }
6365
6404
  });
6366
6405
  }); };
6367
- var getEnvVars = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
6406
+ var getEnvVarsResolved = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
6368
6407
  var envionment, e_2;
6369
6408
  return __generator(this, function (_a) {
6370
6409
  switch (_a.label) {
6371
6410
  case 0:
6372
- _a.trys.push([0, 2, , 3]);
6373
- return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
6411
+ if (!componentName) {
6412
+ return [2 /*return*/, {}];
6413
+ }
6414
+ _a.label = 1;
6374
6415
  case 1:
6416
+ _a.trys.push([1, 3, , 4]);
6417
+ return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
6418
+ case 2:
6375
6419
  envionment = _a.sent();
6376
6420
  // in the pipeline the secrets alreadyy exists and bash will expand them
6377
6421
  // but here we need to manually load them
6378
6422
  return [2 /*return*/, resolveSecrets(vorpal, envionment.envVars)];
6379
- case 2:
6423
+ case 3:
6380
6424
  e_2 = _a.sent();
6381
6425
  // env is disabled
6382
6426
  return [2 /*return*/, {}];
6427
+ case 4: return [2 /*return*/];
6428
+ }
6429
+ });
6430
+ }); };
6431
+ exports.getEnvVarsResolved = getEnvVarsResolved;
6432
+ /**
6433
+ *
6434
+ * is used to get job only vars that should also be editable locally with catladder.
6435
+ */
6436
+ var getJobOnlyEnvVarsResolved = function (vorpal, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
6437
+ var envionment, e_3;
6438
+ return __generator(this, function (_a) {
6439
+ switch (_a.label) {
6440
+ case 0:
6441
+ _a.trys.push([0, 2, , 3]);
6442
+ return [4 /*yield*/, (0, exports.getEnvironment)(env, componentName)];
6443
+ case 1:
6444
+ envionment = _a.sent();
6445
+ return [2 /*return*/, resolveSecrets(vorpal, __assign(__assign({}, envionment.jobOnlyVars.build.envVars), envionment.jobOnlyVars.deploy.envVars))];
6446
+ case 2:
6447
+ e_3 = _a.sent();
6448
+ // env is disabled
6449
+ return [2 /*return*/, {}];
6383
6450
  case 3: return [2 /*return*/];
6384
6451
  }
6385
6452
  });
6386
6453
  }); };
6387
- exports.getEnvVars = getEnvVars;
6454
+ exports.getJobOnlyEnvVarsResolved = getJobOnlyEnvVarsResolved;
6388
6455
  //# sourceMappingURL=getProjectConfig.js.map
6389
6456
 
6390
6457
  /***/ }),
@@ -350081,6 +350148,7 @@ var utils_1 = __nccwpck_require__(37461);
350081
350148
  var yarn_1 = __nccwpck_require__(10464);
350082
350149
  var constants_1 = __nccwpck_require__(11542);
350083
350150
  var writeBuildInfo_1 = __nccwpck_require__(51754);
350151
+ var writeDotEnv_1 = __nccwpck_require__(71298);
350084
350152
  var createBuildJob = function (context, _a) {
350085
350153
  var _b, _c, _d, _e;
350086
350154
  var script = _a.script,
@@ -350093,8 +350161,8 @@ var createBuildJob = function (context, _a) {
350093
350161
  image: (0, __1.getRunnerImage)("jobs-default"),
350094
350162
  needs: [],
350095
350163
  cache: [],
350096
- variables: __assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
350097
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __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),
350164
+ 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 : {}),
350165
+ 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),
350098
350166
  artifacts: {
350099
350167
  paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
350100
350168
  reports: {
@@ -350125,6 +350193,56 @@ exports.writeBuildInfo = writeBuildInfo;
350125
350193
 
350126
350194
  /***/ }),
350127
350195
 
350196
+ /***/ 71298:
350197
+ /***/ (function(__unused_webpack_module, exports) {
350198
+
350199
+ "use strict";
350200
+
350201
+
350202
+ var __read = this && this.__read || function (o, n) {
350203
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
350204
+ if (!m) return o;
350205
+ var i = m.call(o),
350206
+ r,
350207
+ ar = [],
350208
+ e;
350209
+ try {
350210
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
350211
+ } catch (error) {
350212
+ e = {
350213
+ error: error
350214
+ };
350215
+ } finally {
350216
+ try {
350217
+ if (r && !r.done && (m = i["return"])) m.call(i);
350218
+ } finally {
350219
+ if (e) throw e.error;
350220
+ }
350221
+ }
350222
+ return ar;
350223
+ };
350224
+ exports.__esModule = true;
350225
+ exports.writeDotEnv = void 0;
350226
+ /**
350227
+ * writes a .env file in the components folder
350228
+ * @param context
350229
+ * @returns
350230
+ */
350231
+ var writeDotEnv = function (context) {
350232
+ var envVars = context.environment.envVars;
350233
+ // make key=value and sanitize multiline
350234
+ var keyValueString = Object.entries(envVars).map(function (_a) {
350235
+ var _b = __read(_a, 2),
350236
+ key = _b[0],
350237
+ value = _b[1];
350238
+ return "".concat(key, "=").concat(value.replaceAll("\n", "\\n"));
350239
+ }).join("\n");
350240
+ return ["cat <<EOF > ".concat(context.componentConfig.dir, "/.env\n").concat(keyValueString, "\nEOF")];
350241
+ };
350242
+ exports.writeDotEnv = writeDotEnv;
350243
+
350244
+ /***/ }),
350245
+
350128
350246
  /***/ 62644:
350129
350247
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
350130
350248
 
@@ -350332,9 +350450,9 @@ var createCustomTestJobs = function (context) {
350332
350450
  throw new Error("deploy config is not custom");
350333
350451
  }
350334
350452
  var base = {
350335
- variables: __assign(__assign({
350453
+ variables: __assign(__assign(__assign({
350336
350454
  APP_PATH: context.componentConfig.dir
350337
- }, RUNNER_CUSTOM_TEST_VARIABLES), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
350455
+ }, RUNNER_CUSTOM_TEST_VARIABLES), context.environment.jobOnlyVars.build.envVars), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
350338
350456
  services: buildConfig.jobServices,
350339
350457
  cache: buildConfig.jobCache,
350340
350458
  stage: "test",
@@ -351025,9 +351143,9 @@ var createNodeTestJobs = function (context) {
351025
351143
  }
351026
351144
  var buildConfig = context.componentConfig.build;
351027
351145
  var base = {
351028
- variables: __assign(__assign({
351146
+ variables: __assign(__assign(__assign({
351029
351147
  APP_PATH: context.componentConfig.dir
351030
- }, constants_1.NODE_RUNNER_BUILD_VARIABLES), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
351148
+ }, constants_1.NODE_RUNNER_BUILD_VARIABLES), context.environment.jobOnlyVars.build.envVars), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
351031
351149
  stage: "test",
351032
351150
  needs: [],
351033
351151
  envMode: "none"
@@ -351144,6 +351262,16 @@ exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
351144
351262
  "use strict";
351145
351263
 
351146
351264
 
351265
+ var __assign = this && this.__assign || function () {
351266
+ __assign = Object.assign || function (t) {
351267
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
351268
+ s = arguments[i];
351269
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
351270
+ }
351271
+ return t;
351272
+ };
351273
+ return __assign.apply(this, arguments);
351274
+ };
351147
351275
  var __read = this && this.__read || function (o, n) {
351148
351276
  var m = typeof Symbol === "function" && o[Symbol.iterator];
351149
351277
  if (!m) return o;
@@ -351185,7 +351313,7 @@ var createRailsBuildJobs = function (context) {
351185
351313
  return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
351186
351314
  }).join(" ");
351187
351315
  return [(0, docker_1.createDockerBuildJobBase)(context, {
351188
- variables: context.componentConfig.build.extraVars,
351316
+ variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), context.componentConfig.build.extraVars),
351189
351317
  // custom script
351190
351318
  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",
351191
351319
  // replace private git ssh gem sources with https to make bundler with credentials via env var work
@@ -351302,7 +351430,7 @@ var createRailsTestJobs = function (context) {
351302
351430
  }
351303
351431
  var buildConfig = context.componentConfig.build;
351304
351432
  var base = {
351305
- variables: (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {},
351433
+ variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {}),
351306
351434
  stage: "test",
351307
351435
  needs: [],
351308
351436
  envMode: "none"
@@ -351535,7 +351663,7 @@ exports.readConfigSync = readConfigSync;
351535
351663
 
351536
351664
  exports.__esModule = true;
351537
351665
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
351538
- exports.PIPELINE_IMAGE_TAG = "main-414c8270" || 0;
351666
+ exports.PIPELINE_IMAGE_TAG = "main-722844ec" || 0;
351539
351667
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
351540
351668
 
351541
351669
  /***/ }),
@@ -351591,6 +351719,16 @@ exports.getEnvType = getEnvType;
351591
351719
  "use strict";
351592
351720
 
351593
351721
 
351722
+ var __assign = this && this.__assign || function () {
351723
+ __assign = Object.assign || function (t) {
351724
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
351725
+ s = arguments[i];
351726
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
351727
+ }
351728
+ return t;
351729
+ };
351730
+ return __assign.apply(this, arguments);
351731
+ };
351594
351732
  var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
351595
351733
  function adopt(value) {
351596
351734
  return value instanceof P ? value : new P(function (resolve) {
@@ -351712,30 +351850,26 @@ var getEnvironmentContext_1 = __nccwpck_require__(95141);
351712
351850
  var getEnvironmentVariables_1 = __nccwpck_require__(76602);
351713
351851
  var getEnvironment = function (config, componentName, env, commitInfo) {
351714
351852
  return __awaiter(void 0, void 0, void 0, function () {
351715
- var _a, envVars, secretEnvVarKeys, host, url, envContext, envType;
351716
- return __generator(this, function (_b) {
351717
- switch (_b.label) {
351853
+ var variables, envContext, envType;
351854
+ return __generator(this, function (_a) {
351855
+ switch (_a.label) {
351718
351856
  case 0:
351719
351857
  return [4 /*yield*/, (0, getEnvironmentVariables_1.getEnvironmentVariables)(config, componentName, env, commitInfo)];
351720
351858
  case 1:
351721
- _a = _b.sent(), envVars = _a.envVars, secretEnvVarKeys = _a.secretEnvVarKeys, host = _a.host, url = _a.url;
351859
+ variables = _a.sent();
351722
351860
  envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
351723
351861
  envType = envContext.envType;
351724
- return [2 /*return*/, {
351862
+ return [2 /*return*/, __assign({
351725
351863
  envType: envType,
351726
- host: host,
351727
- url: url,
351728
351864
  gitlabEnvironment: {
351729
351865
  name: envContext.gitlabEnvironmentName,
351730
- url: url
351866
+ url: variables.url
351731
351867
  },
351732
351868
  fullName: envContext.fullName,
351733
351869
  slugPrefix: envContext.environmentSlugPrefix,
351734
351870
  slug: envContext.environmentSlug,
351735
- shortName: env,
351736
- envVars: envVars,
351737
- secretEnvVarKeys: secretEnvVarKeys
351738
- }];
351871
+ shortName: env
351872
+ }, variables)];
351739
351873
  }
351740
351874
  });
351741
351875
  });
@@ -351952,19 +352086,22 @@ var lodash_1 = __nccwpck_require__(23255);
351952
352086
  var deploy_1 = __nccwpck_require__(90223);
351953
352087
  var getEnvironmentContext_1 = __nccwpck_require__(95141);
351954
352088
  var resolveReferences_1 = __nccwpck_require__(80928);
352089
+ var envVars_1 = __nccwpck_require__(57185);
352090
+ var transformJobOnlyVars_1 = __nccwpck_require__(34674);
351955
352091
  var getEnvironmentVariables = function (config, componentName, env, commitInfo, alreadyVisited // to prevent endless loop
351956
352092
  ) {
351957
352093
  if (alreadyVisited === void 0) {
351958
352094
  alreadyVisited = {};
351959
352095
  }
351960
352096
  return __awaiter(void 0, void 0, void 0, function () {
351961
- var environmentContext, envConfigRaw, deployConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegasyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
351962
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
351963
- return __generator(this, function (_k) {
351964
- switch (_k.label) {
352097
+ var environmentContext, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegacyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
352098
+ var _a, _b;
352099
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l;
352100
+ return __generator(this, function (_m) {
352101
+ switch (_m.label) {
351965
352102
  case 0:
351966
352103
  environmentContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
351967
- envConfigRaw = environmentContext.envConfigRaw, deployConfigRaw = environmentContext.deployConfigRaw, envType = environmentContext.envType;
352104
+ envConfigRaw = environmentContext.envConfigRaw, deployConfigRaw = environmentContext.deployConfigRaw, buildConfigRaw = environmentContext.buildConfigRaw, envType = environmentContext.envType;
351968
352105
  basePredefinedVariables = {
351969
352106
  ENV_SHORT: env,
351970
352107
  APP_DIR: envConfigRaw.dir,
@@ -351975,7 +352112,7 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
351975
352112
  };
351976
352113
  if (envType === "local") {
351977
352114
  devLocalConfig = envConfigRaw;
351978
- port = (_a = devLocalConfig.port) !== null && _a !== void 0 ? _a : 3000;
352115
+ port = (_c = devLocalConfig.port) !== null && _c !== void 0 ? _c : 3000;
351979
352116
  host = "localhost:" + port;
351980
352117
  url = "http://" + host;
351981
352118
  predefinedVariables = {
@@ -351985,7 +352122,7 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
351985
352122
  };
351986
352123
  } else {
351987
352124
  additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
351988
- 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";
352125
+ host = (_e = (_d = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _d !== void 0 ? _d : additionalEnvVars.HOST_CANONICAL) !== null && _e !== void 0 ? _e : "unknown-host.example.com";
351989
352126
  url = "https://".concat(host);
351990
352127
  predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), config.components[componentName].build.type === "rails" ? {} : {
351991
352128
  HOST: host
@@ -351993,25 +352130,13 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
351993
352130
  ROOT_URL: url
351994
352131
  }), additionalEnvVars);
351995
352132
  }
351996
- publicEnvVarsRaw = (_e = (_d = envConfigRaw.vars) === null || _d === void 0 ? void 0 : _d.public) !== null && _e !== void 0 ? _e : {};
352133
+ publicEnvVarsRaw = (_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.public) !== null && _g !== void 0 ? _g : {};
351997
352134
  additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
351998
- secretEnvVarKeys = __spreadArray(__spreadArray([], __read(((_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.secret) !== null && _g !== void 0 ? _g : []).map(function (key) {
351999
- return {
352000
- key: key
352001
- };
352002
- })), false), __read(additionalSecretKeys), false);
352003
- secretEnvVars = Object.fromEntries(secretEnvVarKeys.map(function (_a) {
352004
- var key = _a.key;
352005
- return [key, "$".concat((0, exports.getSecretVarName)(env, componentName, key))];
352006
- }));
352007
- legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
352008
- publicEnvVarsRawWithLegasyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
352009
- publicEnvVarsRawSanitized = Object.fromEntries(Object.entries(publicEnvVarsRawWithLegasyFromComponents).map(function (_a) {
352010
- var _b = __read(_a, 2),
352011
- key = _b[0],
352012
- value = _b[1];
352013
- return [key, (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value)];
352014
- }));
352135
+ secretEnvVarKeys = __spreadArray(__spreadArray([], __read((0, envVars_1.stringListToSecreteEnvVarList)((_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.secret) !== null && _j !== void 0 ? _j : [])), false), __read(additionalSecretKeys), false);
352136
+ secretEnvVars = (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys);
352137
+ legacyFromComponents = (_l = (_k = envConfigRaw.vars) === null || _k === void 0 ? void 0 : _k.fromComponents) !== null && _l !== void 0 ? _l : {};
352138
+ publicEnvVarsRawWithLegacyFromComponents = (0, lodash_1.merge)({}, (0, resolveReferences_1.translateLegacyFromComponents)(legacyFromComponents), publicEnvVarsRaw);
352139
+ publicEnvVarsRawSanitized = (0, envVars_1.stringifyValues)(publicEnvVarsRawWithLegacyFromComponents);
352015
352140
  envVarsRaw = addIndexVar(__assign(__assign(__assign({}, predefinedVariables), secretEnvVars), publicEnvVarsRawSanitized));
352016
352141
  return [4 /*yield*/, (0, resolveReferences_1.resolveReferences)(envVarsRaw, function (otherComponentName, alreadyVisited) {
352017
352142
  return __awaiter(void 0, void 0, void 0, function () {
@@ -352028,13 +352153,18 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
352028
352153
  });
352029
352154
  }, alreadyVisited)];
352030
352155
  case 1:
352031
- envVars = _k.sent();
352032
- return [2 /*return*/, {
352156
+ envVars = _m.sent();
352157
+ _a = {
352033
352158
  envVars: envVars,
352034
- secretEnvVarKeys: secretEnvVarKeys,
352035
- host: host,
352036
- url: url
352037
- }];
352159
+ secretEnvVarKeys: secretEnvVarKeys
352160
+ };
352161
+ _b = {};
352162
+ return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, buildConfigRaw && buildConfigRaw.jobVars || null)];
352163
+ case 2:
352164
+ _b.build = _m.sent();
352165
+ return [4 /*yield*/, (0, transformJobOnlyVars_1.transformJobOnlyVars)(env, componentName, deployConfigRaw && deployConfigRaw.jobVars || null)];
352166
+ case 3:
352167
+ return [2 /*return*/, (_a.jobOnlyVars = (_b.deploy = _m.sent(), _b), _a.host = host, _a.url = url, _a)];
352038
352168
  }
352039
352169
  });
352040
352170
  });
@@ -352546,6 +352676,232 @@ exports.translateLegacyFromComponents = translateLegacyFromComponents;
352546
352676
 
352547
352677
  /***/ }),
352548
352678
 
352679
+ /***/ 34674:
352680
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
352681
+
352682
+ "use strict";
352683
+
352684
+
352685
+ var __assign = this && this.__assign || function () {
352686
+ __assign = Object.assign || function (t) {
352687
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
352688
+ s = arguments[i];
352689
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
352690
+ }
352691
+ return t;
352692
+ };
352693
+ return __assign.apply(this, arguments);
352694
+ };
352695
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
352696
+ function adopt(value) {
352697
+ return value instanceof P ? value : new P(function (resolve) {
352698
+ resolve(value);
352699
+ });
352700
+ }
352701
+ return new (P || (P = Promise))(function (resolve, reject) {
352702
+ function fulfilled(value) {
352703
+ try {
352704
+ step(generator.next(value));
352705
+ } catch (e) {
352706
+ reject(e);
352707
+ }
352708
+ }
352709
+ function rejected(value) {
352710
+ try {
352711
+ step(generator["throw"](value));
352712
+ } catch (e) {
352713
+ reject(e);
352714
+ }
352715
+ }
352716
+ function step(result) {
352717
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
352718
+ }
352719
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
352720
+ });
352721
+ };
352722
+ var __generator = this && this.__generator || function (thisArg, body) {
352723
+ var _ = {
352724
+ label: 0,
352725
+ sent: function () {
352726
+ if (t[0] & 1) throw t[1];
352727
+ return t[1];
352728
+ },
352729
+ trys: [],
352730
+ ops: []
352731
+ },
352732
+ f,
352733
+ y,
352734
+ t,
352735
+ g;
352736
+ return g = {
352737
+ next: verb(0),
352738
+ "throw": verb(1),
352739
+ "return": verb(2)
352740
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
352741
+ return this;
352742
+ }), g;
352743
+ function verb(n) {
352744
+ return function (v) {
352745
+ return step([n, v]);
352746
+ };
352747
+ }
352748
+ function step(op) {
352749
+ if (f) throw new TypeError("Generator is already executing.");
352750
+ while (_) try {
352751
+ 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;
352752
+ if (y = 0, t) op = [op[0] & 2, t.value];
352753
+ switch (op[0]) {
352754
+ case 0:
352755
+ case 1:
352756
+ t = op;
352757
+ break;
352758
+ case 4:
352759
+ _.label++;
352760
+ return {
352761
+ value: op[1],
352762
+ done: false
352763
+ };
352764
+ case 5:
352765
+ _.label++;
352766
+ y = op[1];
352767
+ op = [0];
352768
+ continue;
352769
+ case 7:
352770
+ op = _.ops.pop();
352771
+ _.trys.pop();
352772
+ continue;
352773
+ default:
352774
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
352775
+ _ = 0;
352776
+ continue;
352777
+ }
352778
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
352779
+ _.label = op[1];
352780
+ break;
352781
+ }
352782
+ if (op[0] === 6 && _.label < t[1]) {
352783
+ _.label = t[1];
352784
+ t = op;
352785
+ break;
352786
+ }
352787
+ if (t && _.label < t[2]) {
352788
+ _.label = t[2];
352789
+ _.ops.push(op);
352790
+ break;
352791
+ }
352792
+ if (t[2]) _.ops.pop();
352793
+ _.trys.pop();
352794
+ continue;
352795
+ }
352796
+ op = body.call(thisArg, _);
352797
+ } catch (e) {
352798
+ op = [6, e];
352799
+ y = 0;
352800
+ } finally {
352801
+ f = t = 0;
352802
+ }
352803
+ if (op[0] & 5) throw op[1];
352804
+ return {
352805
+ value: op[0] ? op[1] : void 0,
352806
+ done: true
352807
+ };
352808
+ }
352809
+ };
352810
+ exports.__esModule = true;
352811
+ exports.transformJobOnlyVars = void 0;
352812
+ var envVars_1 = __nccwpck_require__(57185);
352813
+ /**
352814
+ * transform EnvVars for environment.
352815
+ *
352816
+ * currently does not resolve references and is only used for additional job-only-vars
352817
+ * @param vars
352818
+ * @returns
352819
+ */
352820
+ var transformJobOnlyVars = function (env, componentName, vars) {
352821
+ return __awaiter(void 0, void 0, void 0, function () {
352822
+ var publicVars, secretEnvVarKeys, deployJobOnlySecretEnvVars, envVars;
352823
+ var _a, _b;
352824
+ return __generator(this, function (_c) {
352825
+ if (!vars) {
352826
+ return [2 /*return*/, {
352827
+ envVars: {},
352828
+ secretEnvVarKeys: []
352829
+ }];
352830
+ }
352831
+ publicVars = (0, envVars_1.stringifyValues)((_a = vars === null || vars === void 0 ? void 0 : vars.public) !== null && _a !== void 0 ? _a : {});
352832
+ secretEnvVarKeys = (0, envVars_1.stringListToSecreteEnvVarList)((_b = vars === null || vars === void 0 ? void 0 : vars.secret) !== null && _b !== void 0 ? _b : []);
352833
+ deployJobOnlySecretEnvVars = (vars === null || vars === void 0 ? void 0 : vars.secret) ? (0, envVars_1.makeSecretEnvVarMapping)(env, componentName, secretEnvVarKeys) : {};
352834
+ envVars = __assign(__assign({}, deployJobOnlySecretEnvVars), publicVars);
352835
+ return [2 /*return*/, {
352836
+ envVars: envVars,
352837
+ secretEnvVarKeys: secretEnvVarKeys
352838
+ }];
352839
+ });
352840
+ });
352841
+ };
352842
+ exports.transformJobOnlyVars = transformJobOnlyVars;
352843
+
352844
+ /***/ }),
352845
+
352846
+ /***/ 57185:
352847
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
352848
+
352849
+ "use strict";
352850
+
352851
+
352852
+ var __read = this && this.__read || function (o, n) {
352853
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
352854
+ if (!m) return o;
352855
+ var i = m.call(o),
352856
+ r,
352857
+ ar = [],
352858
+ e;
352859
+ try {
352860
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
352861
+ } catch (error) {
352862
+ e = {
352863
+ error: error
352864
+ };
352865
+ } finally {
352866
+ try {
352867
+ if (r && !r.done && (m = i["return"])) m.call(i);
352868
+ } finally {
352869
+ if (e) throw e.error;
352870
+ }
352871
+ }
352872
+ return ar;
352873
+ };
352874
+ exports.__esModule = true;
352875
+ exports.makeSecretEnvVarMapping = exports.stringListToSecreteEnvVarList = exports.stringifyValues = void 0;
352876
+ var lodash_1 = __nccwpck_require__(23255);
352877
+ var getEnvironmentVariables_1 = __nccwpck_require__(76602);
352878
+ var stringifyValues = function (obj) {
352879
+ return Object.fromEntries(Object.entries(obj).map(function (_a) {
352880
+ var _b = __read(_a, 2),
352881
+ key = _b[0],
352882
+ value = _b[1];
352883
+ return [key, (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value)];
352884
+ }));
352885
+ };
352886
+ exports.stringifyValues = stringifyValues;
352887
+ var stringListToSecreteEnvVarList = function (keys) {
352888
+ return keys.map(function (key) {
352889
+ return {
352890
+ key: key
352891
+ };
352892
+ });
352893
+ };
352894
+ exports.stringListToSecreteEnvVarList = stringListToSecreteEnvVarList;
352895
+ var makeSecretEnvVarMapping = function (env, componentName, secretEnvVars) {
352896
+ return Object.fromEntries(secretEnvVars.map(function (_a) {
352897
+ var key = _a.key;
352898
+ return [key, "$".concat((0, getEnvironmentVariables_1.getSecretVarName)(env, componentName, key))];
352899
+ }));
352900
+ };
352901
+ exports.makeSecretEnvVarMapping = makeSecretEnvVarMapping;
352902
+
352903
+ /***/ }),
352904
+
352549
352905
  /***/ 87383:
352550
352906
  /***/ ((__unused_webpack_module, exports) => {
352551
352907
 
@@ -352627,7 +352983,7 @@ var getBaseDeploymentJob = function (context) {
352627
352983
  }],
352628
352984
  allow_failure: whenDeploy === "manual" ? true : false,
352629
352985
  stage: "deploy",
352630
- variables: __assign(__assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.envVars), hasDocker ? (0, docker_1.getDockerImageVariables)(context) : {}), context.componentConfig.deploy ? (_d = context.componentConfig.deploy.extraVars) !== null && _d !== void 0 ? _d : {} : {}),
352986
+ variables: __assign(__assign(__assign(__assign(__assign({}, 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 : {} : {}),
352631
352987
  environment: __assign(__assign({}, context.environment.gitlabEnvironment), isStoppable ? {
352632
352988
  on_stop: exports.STOP_JOB_NAME,
352633
352989
  auto_stop_in: autoStop
@@ -352649,7 +353005,7 @@ var getBaseDeploymentStopJob = function (context) {
352649
353005
  when: "manual",
352650
353006
  allow_failure: true
352651
353007
  }],
352652
- variables: __assign(__assign({}, DEPLOY_RUNNER_VARIABLES), {
353008
+ variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
352653
353009
  GIT_STRATEGY: "none"
352654
353010
  }),
352655
353011
  stage: "stop",
@@ -352668,7 +353024,7 @@ var getBaseRollbackJob = function (context) {
352668
353024
  when: "manual",
352669
353025
  allow_failure: true
352670
353026
  }],
352671
- variables: __assign(__assign({}, DEPLOY_RUNNER_VARIABLES), {
353027
+ variables: __assign(__assign(__assign({}, DEPLOY_RUNNER_VARIABLES), context.environment.jobOnlyVars.deploy.envVars), {
352672
353028
  GIT_STRATEGY: "none"
352673
353029
  }),
352674
353030
  stage: "rollback",