@catladder/cli 0.0.0-kube-command-59ed84cc → 0.0.0-kubernetes-new-cloudsql-d0cdae5b

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.
@@ -1464,6 +1464,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
1464
1464
  };
1465
1465
  exports.__esModule = true;
1466
1466
  var pipeline_1 = __nccwpck_require__(25355);
1467
+ var pipeline_2 = __nccwpck_require__(25355);
1467
1468
  var child_process_promise_1 = __nccwpck_require__(75763);
1468
1469
  var fs_extra_1 = __nccwpck_require__(85501);
1469
1470
  var tmp_promise_1 = __nccwpck_require__(68841);
@@ -1494,13 +1495,13 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
1494
1495
  if (env === "review") {
1495
1496
  vorpal.log("⚠️ connection string does not include mr information on review environments");
1496
1497
  }
1497
- if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) return [3 /*break*/, 3];
1498
+ if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) return [3 /*break*/, 3];
1498
1499
  return [4 /*yield*/, getProxyInfoForKubernetes(context)];
1499
1500
  case 2:
1500
1501
  proxyInfo = _c.sent();
1501
1502
  return [3 /*break*/, 6];
1502
1503
  case 3:
1503
- if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")) return [3 /*break*/, 5];
1504
+ if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun")) return [3 /*break*/, 5];
1504
1505
  return [4 /*yield*/, getProxyInfoForCloudRun(context)];
1505
1506
  case 4:
1506
1507
  proxyInfo = _c.sent();
@@ -1562,27 +1563,20 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
1562
1563
  });
1563
1564
  }); });
1564
1565
  var getProxyInfoForKubernetes = function (context) { return __awaiter(void 0, void 0, void 0, function () {
1565
- var envVars, DB_PASSWORD, DB_NAME, values, projectId, defaultInstanceId, instanceId, defaultRegion, region, instanceName;
1566
- var _a, _b, _c, _d;
1567
- return __generator(this, function (_e) {
1568
- switch (_e.label) {
1566
+ var envVars, cloudSqlValues, DB_PASSWORD, DB_NAME, instanceName;
1567
+ return __generator(this, function (_a) {
1568
+ switch (_a.label) {
1569
1569
  case 0:
1570
- if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
1570
+ if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
1571
1571
  throw new Error("unsupported");
1572
1572
  }
1573
1573
  return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(this, context.environment.shortName, context.componentName)];
1574
1574
  case 1:
1575
- envVars = _e.sent();
1575
+ envVars = _a.sent();
1576
+ cloudSqlValues = (0, pipeline_1.createKubernetesCloudsqlBaseValues)(context);
1576
1577
  DB_PASSWORD = (envVars === null || envVars === void 0 ? void 0 : envVars.DB_PASSWORD) || (envVars === null || envVars === void 0 ? void 0 : envVars.POSTGRESQL_PASSWORD);
1577
- DB_NAME = context.environment.envVars.KUBE_APP_NAME;
1578
- values = context.componentConfig.deploy.values;
1579
- projectId = ((_a = values === null || values === void 0 ? void 0 : values.cloudsql) === null || _a === void 0 ? void 0 : _a.projectId) ||
1580
- ((_b = context.componentConfig.deploy.cluster) === null || _b === void 0 ? void 0 : _b.projectId);
1581
- defaultInstanceId = "".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName, "-").concat(context.environment.shortName);
1582
- instanceId = ((_c = values === null || values === void 0 ? void 0 : values.cloudsql) === null || _c === void 0 ? void 0 : _c.instanceId) || defaultInstanceId;
1583
- defaultRegion = "europe-west6";
1584
- region = ((_d = values === null || values === void 0 ? void 0 : values.cloudsql) === null || _d === void 0 ? void 0 : _d.region) || defaultRegion;
1585
- instanceName = "".concat(projectId, ":").concat(region, ":").concat(instanceId);
1578
+ DB_NAME = cloudSqlValues.cloudsql.fullDbName;
1579
+ instanceName = cloudSqlValues.cloudsql.instanceConnectionName;
1586
1580
  return [2 /*return*/, {
1587
1581
  instanceName: instanceName,
1588
1582
  DB_PASSWORD: DB_PASSWORD,
@@ -1597,7 +1591,7 @@ var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void
1597
1591
  return __generator(this, function (_a) {
1598
1592
  switch (_a.label) {
1599
1593
  case 0:
1600
- if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ||
1594
+ if (!(0, pipeline_2.isOfDeployType)(context.componentConfig.deploy, "google-cloudrun") ||
1601
1595
  !context.componentConfig.deploy.cloudSql) {
1602
1596
  throw new Error("unsupported");
1603
1597
  }
@@ -4540,69 +4534,6 @@ exports.setupCloudRun = setupCloudRun;
4540
4534
 
4541
4535
  /***/ }),
4542
4536
 
4543
- /***/ 63660:
4544
- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
4545
-
4546
- "use strict";
4547
-
4548
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4549
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4550
- return new (P || (P = Promise))(function (resolve, reject) {
4551
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
4552
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
4553
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
4554
- step((generator = generator.apply(thisArg, _arguments || [])).next());
4555
- });
4556
- };
4557
- var __generator = (this && this.__generator) || function (thisArg, body) {
4558
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
4559
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
4560
- function verb(n) { return function (v) { return step([n, v]); }; }
4561
- function step(op) {
4562
- if (f) throw new TypeError("Generator is already executing.");
4563
- while (_) try {
4564
- 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;
4565
- if (y = 0, t) op = [op[0] & 2, t.value];
4566
- switch (op[0]) {
4567
- case 0: case 1: t = op; break;
4568
- case 4: _.label++; return { value: op[1], done: false };
4569
- case 5: _.label++; y = op[1]; op = [0]; continue;
4570
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
4571
- default:
4572
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
4573
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
4574
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
4575
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
4576
- if (t[2]) _.ops.pop();
4577
- _.trys.pop(); continue;
4578
- }
4579
- op = body.call(thisArg, _);
4580
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
4581
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
4582
- }
4583
- };
4584
- exports.__esModule = true;
4585
- exports.setupCloudSQL = void 0;
4586
- var pipeline_1 = __nccwpck_require__(25355);
4587
- var setupCloudSQL = function (instance, context) { return __awaiter(void 0, void 0, void 0, function () {
4588
- var config;
4589
- return __generator(this, function (_a) {
4590
- if (!(0, pipeline_1.hasKubernetesCloudSQL)(context)) {
4591
- throw new Error("cannot setup cloudsql, as it has none");
4592
- }
4593
- config = (0, pipeline_1.getKubernetesCloudSQLConfig)(context);
4594
- instance.log("");
4595
- instance.log("! make sure to provide cloudsqlProxyCredentials for the cloud sql service account in " +
4596
- config.projectId);
4597
- instance.log("");
4598
- return [2 /*return*/];
4599
- });
4600
- }); };
4601
- exports.setupCloudSQL = setupCloudSQL;
4602
- //# sourceMappingURL=setupCloudSQL.js.map
4603
-
4604
- /***/ }),
4605
-
4606
4537
  /***/ 40663:
4607
4538
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
4608
4539
 
@@ -4648,7 +4579,6 @@ exports.__esModule = true;
4648
4579
  exports.setupContext = void 0;
4649
4580
  var pipeline_1 = __nccwpck_require__(25355);
4650
4581
  var setupCloudRun_1 = __nccwpck_require__(89010);
4651
- var setupCloudSQL_1 = __nccwpck_require__(63660);
4652
4582
  var setupKubernetes_1 = __nccwpck_require__(82308);
4653
4583
  var setupContext = function (instance, context) { return __awaiter(void 0, void 0, void 0, function () {
4654
4584
  var deployConfig;
@@ -4669,19 +4599,13 @@ var setupContext = function (instance, context) { return __awaiter(void 0, void
4669
4599
  _a.sent();
4670
4600
  _a.label = 2;
4671
4601
  case 2:
4672
- if (!(0, pipeline_1.hasKubernetesCloudSQL)(context)) return [3 /*break*/, 4];
4673
- return [4 /*yield*/, (0, setupCloudSQL_1.setupCloudSQL)(instance, context)];
4602
+ deployConfig = context.componentConfig.deploy;
4603
+ if (!(0, pipeline_1.isOfDeployType)(deployConfig, "kubernetes")) return [3 /*break*/, 4];
4604
+ return [4 /*yield*/, (0, setupKubernetes_1.setupKubernetes)(instance, context)];
4674
4605
  case 3:
4675
4606
  _a.sent();
4676
4607
  _a.label = 4;
4677
4608
  case 4:
4678
- deployConfig = context.componentConfig.deploy;
4679
- if (!(0, pipeline_1.isOfDeployType)(deployConfig, "kubernetes")) return [3 /*break*/, 6];
4680
- return [4 /*yield*/, (0, setupKubernetes_1.setupKubernetes)(instance, context)];
4681
- case 5:
4682
- _a.sent();
4683
- _a.label = 6;
4684
- case 6:
4685
4609
  instance.log("");
4686
4610
  instance.log("✅ " +
4687
4611
  context.environment.shortName +
@@ -130202,7 +130126,7 @@ module.exports = (stack, options) => {
130202
130126
 
130203
130127
  "use strict";
130204
130128
 
130205
- var restoreCursor = __nccwpck_require__(74390);
130129
+ var restoreCursor = __nccwpck_require__(17301);
130206
130130
  var hidden = false;
130207
130131
 
130208
130132
  exports.show = function () {
@@ -130229,6 +130153,62 @@ exports.toggle = function (force) {
130229
130153
  };
130230
130154
 
130231
130155
 
130156
+ /***/ }),
130157
+
130158
+ /***/ 17677:
130159
+ /***/ ((module) => {
130160
+
130161
+ "use strict";
130162
+
130163
+ module.exports = function (fn, errMsg) {
130164
+ if (typeof fn !== 'function') {
130165
+ throw new TypeError('Expected a function');
130166
+ }
130167
+
130168
+ var ret;
130169
+ var called = false;
130170
+ var fnName = fn.displayName || fn.name || (/function ([^\(]+)/.exec(fn.toString()) || [])[1];
130171
+
130172
+ var onetime = function () {
130173
+ if (called) {
130174
+ if (errMsg === true) {
130175
+ fnName = fnName ? fnName + '()' : 'Function';
130176
+ throw new Error(fnName + ' can only be called once.');
130177
+ }
130178
+
130179
+ return ret;
130180
+ }
130181
+
130182
+ called = true;
130183
+ ret = fn.apply(this, arguments);
130184
+ fn = null;
130185
+
130186
+ return ret;
130187
+ };
130188
+
130189
+ onetime.displayName = fnName;
130190
+
130191
+ return onetime;
130192
+ };
130193
+
130194
+
130195
+ /***/ }),
130196
+
130197
+ /***/ 17301:
130198
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
130199
+
130200
+ "use strict";
130201
+
130202
+ var onetime = __nccwpck_require__(17677);
130203
+ var exitHook = __nccwpck_require__(24793);
130204
+
130205
+ module.exports = onetime(function () {
130206
+ exitHook(function () {
130207
+ process.stdout.write('\u001b[?25h');
130208
+ });
130209
+ });
130210
+
130211
+
130232
130212
  /***/ }),
130233
130213
 
130234
130214
  /***/ 89992:
@@ -178822,60 +178802,6 @@ module.exports = () => {
178822
178802
  };
178823
178803
 
178824
178804
 
178825
- /***/ }),
178826
-
178827
- /***/ 48504:
178828
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
178829
-
178830
- "use strict";
178831
-
178832
- var numberIsNan = __nccwpck_require__(68955);
178833
-
178834
- module.exports = function (x) {
178835
- if (numberIsNan(x)) {
178836
- return false;
178837
- }
178838
-
178839
- // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
178840
-
178841
- // code points are derived from:
178842
- // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
178843
- if (x >= 0x1100 && (
178844
- x <= 0x115f || // Hangul Jamo
178845
- 0x2329 === x || // LEFT-POINTING ANGLE BRACKET
178846
- 0x232a === x || // RIGHT-POINTING ANGLE BRACKET
178847
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
178848
- (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
178849
- // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
178850
- 0x3250 <= x && x <= 0x4dbf ||
178851
- // CJK Unified Ideographs .. Yi Radicals
178852
- 0x4e00 <= x && x <= 0xa4c6 ||
178853
- // Hangul Jamo Extended-A
178854
- 0xa960 <= x && x <= 0xa97c ||
178855
- // Hangul Syllables
178856
- 0xac00 <= x && x <= 0xd7a3 ||
178857
- // CJK Compatibility Ideographs
178858
- 0xf900 <= x && x <= 0xfaff ||
178859
- // Vertical Forms
178860
- 0xfe10 <= x && x <= 0xfe19 ||
178861
- // CJK Compatibility Forms .. Small Form Variants
178862
- 0xfe30 <= x && x <= 0xfe6b ||
178863
- // Halfwidth and Fullwidth Forms
178864
- 0xff01 <= x && x <= 0xff60 ||
178865
- 0xffe0 <= x && x <= 0xffe6 ||
178866
- // Kana Supplement
178867
- 0x1b000 <= x && x <= 0x1b001 ||
178868
- // Enclosed Ideographic Supplement
178869
- 0x1f200 <= x && x <= 0x1f251 ||
178870
- // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
178871
- 0x20000 <= x && x <= 0x3fffd)) {
178872
- return true;
178873
- }
178874
-
178875
- return false;
178876
- }
178877
-
178878
-
178879
178805
  /***/ }),
178880
178806
 
178881
178807
  /***/ 86878:
@@ -210161,158 +210087,6 @@ module.exports = Keyv;
210161
210087
  }.call(this));
210162
210088
 
210163
210089
 
210164
- /***/ }),
210165
-
210166
- /***/ 12860:
210167
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
210168
-
210169
- "use strict";
210170
-
210171
- var ansiEscapes = __nccwpck_require__(11598);
210172
- var cliCursor = __nccwpck_require__(22701);
210173
-
210174
- function main(stream) {
210175
- var prevLineCount = 0;
210176
-
210177
- var render = function () {
210178
- cliCursor.hide();
210179
- var out = [].join.call(arguments, ' ') + '\n';
210180
- stream.write(ansiEscapes.eraseLines(prevLineCount) + out);
210181
- prevLineCount = out.split('\n').length;
210182
- };
210183
-
210184
- render.clear = function () {
210185
- stream.write(ansiEscapes.eraseLines(prevLineCount));
210186
- prevLineCount = 0;
210187
- };
210188
-
210189
- render.done = function () {
210190
- prevLineCount = 0;
210191
- cliCursor.show();
210192
- };
210193
-
210194
- return render;
210195
- }
210196
-
210197
- module.exports = main(process.stdout);
210198
- module.exports.stderr = main(process.stderr);
210199
- module.exports.create = main;
210200
-
210201
-
210202
- /***/ }),
210203
-
210204
- /***/ 11598:
210205
- /***/ ((module) => {
210206
-
210207
- "use strict";
210208
-
210209
- var ESC = '\u001b[';
210210
- var x = module.exports;
210211
-
210212
- x.cursorTo = function (x, y) {
210213
- if (arguments.length === 0) {
210214
- return ESC + 'H';
210215
- }
210216
-
210217
- if (arguments.length === 1) {
210218
- return ESC + (x + 1) + 'G';
210219
- }
210220
-
210221
- return ESC + (y + 1) + ';' + (x + 1) + 'H';
210222
- };
210223
-
210224
- x.cursorMove = function (x, y) {
210225
- var ret = '';
210226
-
210227
- if (x < 0) {
210228
- ret += ESC + (-x) + 'D';
210229
- } else if (x > 0) {
210230
- ret += ESC + x + 'C';
210231
- }
210232
-
210233
- if (y < 0) {
210234
- ret += ESC + (-y) + 'A';
210235
- } else if (y > 0) {
210236
- ret += ESC + y + 'B';
210237
- }
210238
-
210239
- return ret;
210240
- };
210241
-
210242
- x.cursorUp = function (count) {
210243
- return ESC + (typeof count === 'number' ? count : 1) + 'A';
210244
- };
210245
-
210246
- x.cursorDown = function (count) {
210247
- return ESC + (typeof count === 'number' ? count : 1) + 'B';
210248
- };
210249
-
210250
- x.cursorForward = function (count) {
210251
- return ESC + (typeof count === 'number' ? count : 1) + 'C';
210252
- };
210253
-
210254
- x.cursorBackward = function (count) {
210255
- return ESC + (typeof count === 'number' ? count : 1) + 'D';
210256
- };
210257
-
210258
- x.cursorLeft = ESC + '1000D';
210259
- x.cursorSavePosition = ESC + 's';
210260
- x.cursorRestorePosition = ESC + 'u';
210261
- x.cursorGetPosition = ESC + '6n';
210262
- x.cursorNextLine = ESC + 'E';
210263
- x.cursorPrevLine = ESC + 'F';
210264
- x.cursorHide = ESC + '?25l';
210265
- x.cursorShow = ESC + '?25h';
210266
-
210267
- x.eraseLines = function (count) {
210268
- var clear = '';
210269
-
210270
- for (var i = 0; i < count; i++) {
210271
- clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : '');
210272
- }
210273
-
210274
- return clear;
210275
- };
210276
-
210277
- x.eraseEndLine = ESC + 'K';
210278
- x.eraseStartLine = ESC + '1K';
210279
- x.eraseLine = ESC + '2K';
210280
- x.eraseDown = ESC + 'J';
210281
- x.eraseUp = ESC + '1J';
210282
- x.eraseScreen = ESC + '2J';
210283
- x.scrollUp = ESC + 'S';
210284
- x.scrollDown = ESC + 'T';
210285
-
210286
- x.clearScreen = '\u001bc';
210287
- x.beep = '\u0007';
210288
-
210289
- x.image = function (buf, opts) {
210290
- opts = opts || {};
210291
-
210292
- var ret = '\u001b]1337;File=inline=1';
210293
-
210294
- if (opts.width) {
210295
- ret += ';width=' + opts.width;
210296
- }
210297
-
210298
- if (opts.height) {
210299
- ret += ';height=' + opts.height;
210300
- }
210301
-
210302
- if (opts.preserveAspectRatio === false) {
210303
- ret += ';preserveAspectRatio=0';
210304
- }
210305
-
210306
- return ret + ':' + buf.toString('base64') + '\u0007';
210307
- };
210308
-
210309
- x.iTerm = {};
210310
-
210311
- x.iTerm.setCwd = function (cwd) {
210312
- return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007';
210313
- };
210314
-
210315
-
210316
210090
  /***/ }),
210317
210091
 
210318
210092
  /***/ 64633:
@@ -212316,27 +212090,6 @@ function populateMaps (extensions, types) {
212316
212090
  }
212317
212091
 
212318
212092
 
212319
- /***/ }),
212320
-
212321
- /***/ 43471:
212322
- /***/ ((module) => {
212323
-
212324
- "use strict";
212325
-
212326
-
212327
- const mimicFn = (to, from) => {
212328
- for (const prop of Reflect.ownKeys(from)) {
212329
- Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
212330
- }
212331
-
212332
- return to;
212333
- };
212334
-
212335
- module.exports = mimicFn;
212336
- // TODO: Remove this for the next major release
212337
- module.exports["default"] = mimicFn;
212338
-
212339
-
212340
212093
  /***/ }),
212341
212094
 
212342
212095
  /***/ 21963:
@@ -220470,7 +220223,7 @@ function onceStrict (fn) {
220470
220223
 
220471
220224
  "use strict";
220472
220225
 
220473
- const mimicFn = __nccwpck_require__(43471);
220226
+ const mimicFn = __nccwpck_require__(60283);
220474
220227
 
220475
220228
  const calledFunctions = new WeakMap();
220476
220229
 
@@ -220515,6 +220268,27 @@ module.exports.callCount = function_ => {
220515
220268
  };
220516
220269
 
220517
220270
 
220271
+ /***/ }),
220272
+
220273
+ /***/ 60283:
220274
+ /***/ ((module) => {
220275
+
220276
+ "use strict";
220277
+
220278
+
220279
+ const mimicFn = (to, from) => {
220280
+ for (const prop of Reflect.ownKeys(from)) {
220281
+ Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
220282
+ }
220283
+
220284
+ return to;
220285
+ };
220286
+
220287
+ module.exports = mimicFn;
220288
+ // TODO: Remove this for the next major release
220289
+ module.exports["default"] = mimicFn;
220290
+
220291
+
220518
220292
  /***/ }),
220519
220293
 
220520
220294
  /***/ 14247:
@@ -304197,7 +303971,7 @@ module.exports = QuickLRU;
304197
303971
  var readline = __nccwpck_require__(14521);
304198
303972
  var MuteStream = __nccwpck_require__(84778);
304199
303973
  var codePointAt = __nccwpck_require__(62257);
304200
- var isFullwidthCodePoint = __nccwpck_require__(48504);
303974
+ var isFullwidthCodePoint = __nccwpck_require__(29535);
304201
303975
 
304202
303976
  var Interface = module.exports = {};
304203
303977
 
@@ -304316,6 +304090,60 @@ function stripVTControlCharacters (str) {
304316
304090
  }
304317
304091
 
304318
304092
 
304093
+ /***/ }),
304094
+
304095
+ /***/ 29535:
304096
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
304097
+
304098
+ "use strict";
304099
+
304100
+ var numberIsNan = __nccwpck_require__(68955);
304101
+
304102
+ module.exports = function (x) {
304103
+ if (numberIsNan(x)) {
304104
+ return false;
304105
+ }
304106
+
304107
+ // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
304108
+
304109
+ // code points are derived from:
304110
+ // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
304111
+ if (x >= 0x1100 && (
304112
+ x <= 0x115f || // Hangul Jamo
304113
+ 0x2329 === x || // LEFT-POINTING ANGLE BRACKET
304114
+ 0x232a === x || // RIGHT-POINTING ANGLE BRACKET
304115
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
304116
+ (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
304117
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
304118
+ 0x3250 <= x && x <= 0x4dbf ||
304119
+ // CJK Unified Ideographs .. Yi Radicals
304120
+ 0x4e00 <= x && x <= 0xa4c6 ||
304121
+ // Hangul Jamo Extended-A
304122
+ 0xa960 <= x && x <= 0xa97c ||
304123
+ // Hangul Syllables
304124
+ 0xac00 <= x && x <= 0xd7a3 ||
304125
+ // CJK Compatibility Ideographs
304126
+ 0xf900 <= x && x <= 0xfaff ||
304127
+ // Vertical Forms
304128
+ 0xfe10 <= x && x <= 0xfe19 ||
304129
+ // CJK Compatibility Forms .. Small Form Variants
304130
+ 0xfe30 <= x && x <= 0xfe6b ||
304131
+ // Halfwidth and Fullwidth Forms
304132
+ 0xff01 <= x && x <= 0xff60 ||
304133
+ 0xffe0 <= x && x <= 0xffe6 ||
304134
+ // Kana Supplement
304135
+ 0x1b000 <= x && x <= 0x1b001 ||
304136
+ // Enclosed Ideographic Supplement
304137
+ 0x1f200 <= x && x <= 0x1f251 ||
304138
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
304139
+ 0x20000 <= x && x <= 0x3fffd)) {
304140
+ return true;
304141
+ }
304142
+
304143
+ return false;
304144
+ }
304145
+
304146
+
304319
304147
  /***/ }),
304320
304148
 
304321
304149
  /***/ 12757:
@@ -307985,62 +307813,6 @@ class Response extends Readable {
307985
307813
  module.exports = Response;
307986
307814
 
307987
307815
 
307988
- /***/ }),
307989
-
307990
- /***/ 74390:
307991
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
307992
-
307993
- "use strict";
307994
-
307995
- var onetime = __nccwpck_require__(38197);
307996
- var exitHook = __nccwpck_require__(24793);
307997
-
307998
- module.exports = onetime(function () {
307999
- exitHook(function () {
308000
- process.stdout.write('\u001b[?25h');
308001
- });
308002
- });
308003
-
308004
-
308005
- /***/ }),
308006
-
308007
- /***/ 38197:
308008
- /***/ ((module) => {
308009
-
308010
- "use strict";
308011
-
308012
- module.exports = function (fn, errMsg) {
308013
- if (typeof fn !== 'function') {
308014
- throw new TypeError('Expected a function');
308015
- }
308016
-
308017
- var ret;
308018
- var called = false;
308019
- var fnName = fn.displayName || fn.name || (/function ([^\(]+)/.exec(fn.toString()) || [])[1];
308020
-
308021
- var onetime = function () {
308022
- if (called) {
308023
- if (errMsg === true) {
308024
- fnName = fnName ? fnName + '()' : 'Function';
308025
- throw new Error(fnName + ' can only be called once.');
308026
- }
308027
-
308028
- return ret;
308029
- }
308030
-
308031
- called = true;
308032
- ret = fn.apply(this, arguments);
308033
- fn = null;
308034
-
308035
- return ret;
308036
- };
308037
-
308038
- onetime.displayName = fnName;
308039
-
308040
- return onetime;
308041
- };
308042
-
308043
-
308044
307816
  /***/ }),
308045
307817
 
308046
307818
  /***/ 6716:
@@ -342380,7 +342152,7 @@ var inquirer = __nccwpck_require__(8622);
342380
342152
  var EventEmitter = (__nccwpck_require__(82361).EventEmitter);
342381
342153
  var chalk = __nccwpck_require__(48173);
342382
342154
  var util = __nccwpck_require__(29821);
342383
- var logUpdate = __nccwpck_require__(12860);
342155
+ var logUpdate = __nccwpck_require__(75758);
342384
342156
 
342385
342157
  var UI = function (_EventEmitter) {
342386
342158
  _inherits(UI, _EventEmitter);
@@ -344786,6 +344558,120 @@ Object.defineProperty(vorpal, 'activeCommand', {
344786
344558
  }
344787
344559
  });
344788
344560
 
344561
+ /***/ }),
344562
+
344563
+ /***/ 37374:
344564
+ /***/ ((module) => {
344565
+
344566
+ "use strict";
344567
+
344568
+ var ESC = '\u001b[';
344569
+ var x = module.exports;
344570
+
344571
+ x.cursorTo = function (x, y) {
344572
+ if (arguments.length === 0) {
344573
+ return ESC + 'H';
344574
+ }
344575
+
344576
+ if (arguments.length === 1) {
344577
+ return ESC + (x + 1) + 'G';
344578
+ }
344579
+
344580
+ return ESC + (y + 1) + ';' + (x + 1) + 'H';
344581
+ };
344582
+
344583
+ x.cursorMove = function (x, y) {
344584
+ var ret = '';
344585
+
344586
+ if (x < 0) {
344587
+ ret += ESC + (-x) + 'D';
344588
+ } else if (x > 0) {
344589
+ ret += ESC + x + 'C';
344590
+ }
344591
+
344592
+ if (y < 0) {
344593
+ ret += ESC + (-y) + 'A';
344594
+ } else if (y > 0) {
344595
+ ret += ESC + y + 'B';
344596
+ }
344597
+
344598
+ return ret;
344599
+ };
344600
+
344601
+ x.cursorUp = function (count) {
344602
+ return ESC + (typeof count === 'number' ? count : 1) + 'A';
344603
+ };
344604
+
344605
+ x.cursorDown = function (count) {
344606
+ return ESC + (typeof count === 'number' ? count : 1) + 'B';
344607
+ };
344608
+
344609
+ x.cursorForward = function (count) {
344610
+ return ESC + (typeof count === 'number' ? count : 1) + 'C';
344611
+ };
344612
+
344613
+ x.cursorBackward = function (count) {
344614
+ return ESC + (typeof count === 'number' ? count : 1) + 'D';
344615
+ };
344616
+
344617
+ x.cursorLeft = ESC + '1000D';
344618
+ x.cursorSavePosition = ESC + 's';
344619
+ x.cursorRestorePosition = ESC + 'u';
344620
+ x.cursorGetPosition = ESC + '6n';
344621
+ x.cursorNextLine = ESC + 'E';
344622
+ x.cursorPrevLine = ESC + 'F';
344623
+ x.cursorHide = ESC + '?25l';
344624
+ x.cursorShow = ESC + '?25h';
344625
+
344626
+ x.eraseLines = function (count) {
344627
+ var clear = '';
344628
+
344629
+ for (var i = 0; i < count; i++) {
344630
+ clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : '');
344631
+ }
344632
+
344633
+ return clear;
344634
+ };
344635
+
344636
+ x.eraseEndLine = ESC + 'K';
344637
+ x.eraseStartLine = ESC + '1K';
344638
+ x.eraseLine = ESC + '2K';
344639
+ x.eraseDown = ESC + 'J';
344640
+ x.eraseUp = ESC + '1J';
344641
+ x.eraseScreen = ESC + '2J';
344642
+ x.scrollUp = ESC + 'S';
344643
+ x.scrollDown = ESC + 'T';
344644
+
344645
+ x.clearScreen = '\u001bc';
344646
+ x.beep = '\u0007';
344647
+
344648
+ x.image = function (buf, opts) {
344649
+ opts = opts || {};
344650
+
344651
+ var ret = '\u001b]1337;File=inline=1';
344652
+
344653
+ if (opts.width) {
344654
+ ret += ';width=' + opts.width;
344655
+ }
344656
+
344657
+ if (opts.height) {
344658
+ ret += ';height=' + opts.height;
344659
+ }
344660
+
344661
+ if (opts.preserveAspectRatio === false) {
344662
+ ret += ';preserveAspectRatio=0';
344663
+ }
344664
+
344665
+ return ret + ':' + buf.toString('base64') + '\u0007';
344666
+ };
344667
+
344668
+ x.iTerm = {};
344669
+
344670
+ x.iTerm.setCwd = function (cwd) {
344671
+ return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007';
344672
+ };
344673
+
344674
+
344789
344675
  /***/ }),
344790
344676
 
344791
344677
  /***/ 96901:
@@ -344996,6 +344882,98 @@ module.exports.stripColor = stripAnsi;
344996
344882
  module.exports.supportsColor = supportsColor;
344997
344883
 
344998
344884
 
344885
+ /***/ }),
344886
+
344887
+ /***/ 26666:
344888
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
344889
+
344890
+ "use strict";
344891
+
344892
+ var numberIsNan = __nccwpck_require__(68955);
344893
+
344894
+ module.exports = function (x) {
344895
+ if (numberIsNan(x)) {
344896
+ return false;
344897
+ }
344898
+
344899
+ // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
344900
+
344901
+ // code points are derived from:
344902
+ // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
344903
+ if (x >= 0x1100 && (
344904
+ x <= 0x115f || // Hangul Jamo
344905
+ 0x2329 === x || // LEFT-POINTING ANGLE BRACKET
344906
+ 0x232a === x || // RIGHT-POINTING ANGLE BRACKET
344907
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
344908
+ (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
344909
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
344910
+ 0x3250 <= x && x <= 0x4dbf ||
344911
+ // CJK Unified Ideographs .. Yi Radicals
344912
+ 0x4e00 <= x && x <= 0xa4c6 ||
344913
+ // Hangul Jamo Extended-A
344914
+ 0xa960 <= x && x <= 0xa97c ||
344915
+ // Hangul Syllables
344916
+ 0xac00 <= x && x <= 0xd7a3 ||
344917
+ // CJK Compatibility Ideographs
344918
+ 0xf900 <= x && x <= 0xfaff ||
344919
+ // Vertical Forms
344920
+ 0xfe10 <= x && x <= 0xfe19 ||
344921
+ // CJK Compatibility Forms .. Small Form Variants
344922
+ 0xfe30 <= x && x <= 0xfe6b ||
344923
+ // Halfwidth and Fullwidth Forms
344924
+ 0xff01 <= x && x <= 0xff60 ||
344925
+ 0xffe0 <= x && x <= 0xffe6 ||
344926
+ // Kana Supplement
344927
+ 0x1b000 <= x && x <= 0x1b001 ||
344928
+ // Enclosed Ideographic Supplement
344929
+ 0x1f200 <= x && x <= 0x1f251 ||
344930
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
344931
+ 0x20000 <= x && x <= 0x3fffd)) {
344932
+ return true;
344933
+ }
344934
+
344935
+ return false;
344936
+ }
344937
+
344938
+
344939
+ /***/ }),
344940
+
344941
+ /***/ 75758:
344942
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
344943
+
344944
+ "use strict";
344945
+
344946
+ var ansiEscapes = __nccwpck_require__(37374);
344947
+ var cliCursor = __nccwpck_require__(22701);
344948
+
344949
+ function main(stream) {
344950
+ var prevLineCount = 0;
344951
+
344952
+ var render = function () {
344953
+ cliCursor.hide();
344954
+ var out = [].join.call(arguments, ' ') + '\n';
344955
+ stream.write(ansiEscapes.eraseLines(prevLineCount) + out);
344956
+ prevLineCount = out.split('\n').length;
344957
+ };
344958
+
344959
+ render.clear = function () {
344960
+ stream.write(ansiEscapes.eraseLines(prevLineCount));
344961
+ prevLineCount = 0;
344962
+ };
344963
+
344964
+ render.done = function () {
344965
+ prevLineCount = 0;
344966
+ cliCursor.show();
344967
+ };
344968
+
344969
+ return render;
344970
+ }
344971
+
344972
+ module.exports = main(process.stdout);
344973
+ module.exports.stderr = main(process.stderr);
344974
+ module.exports.create = main;
344975
+
344976
+
344999
344977
  /***/ }),
345000
344978
 
345001
344979
  /***/ 61389:
@@ -345005,7 +344983,7 @@ module.exports.supportsColor = supportsColor;
345005
344983
 
345006
344984
  var stripAnsi = __nccwpck_require__(87668);
345007
344985
  var codePointAt = __nccwpck_require__(62257);
345008
- var isFullwidthCodePoint = __nccwpck_require__(48504);
344986
+ var isFullwidthCodePoint = __nccwpck_require__(26666);
345009
344987
 
345010
344988
  // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
345011
344989
  module.exports = function (str) {
@@ -350385,18 +350363,22 @@ var requiresDockerBuild = function (context) {
350385
350363
  return false;
350386
350364
  };
350387
350365
  exports.requiresDockerBuild = requiresDockerBuild;
350366
+ var getDockerBaseVariables = function () {
350367
+ return {
350368
+ DOCKER_HOST: "tcp://0.0.0.0:2375",
350369
+ DOCKER_TLS_CERTDIR: "",
350370
+ DOCKER_DRIVER: "overlay2",
350371
+ DOCKER_BUILDKIT: "1"
350372
+ };
350373
+ };
350388
350374
  var getDockerBuildVariables = function (context) {
350389
350375
  var _a, _b, _c, _d;
350390
- return __assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
350391
- DOCKER_BUILDKIT: "1",
350376
+ return __assign(__assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
350392
350377
  DOCKERFILE_ADDITIONS: (_b = (_a = context.componentConfig.build.docker) === null || _a === void 0 ? void 0 : _a.additionsBegin) === null || _b === void 0 ? void 0 : _b.join("\n"),
350393
350378
  DOCKERFILE_ADDITIONS_END: (_d = (_c = context.componentConfig.build.docker) === null || _c === void 0 ? void 0 : _c.additionsEnd) === null || _d === void 0 ? void 0 : _d.join("\n"),
350394
350379
  APP_DIR: context.componentConfig.dir,
350395
- DOCKER_HOST: "tcp://0.0.0.0:2375",
350396
- DOCKER_TLS_CERTDIR: "",
350397
- DOCKER_DIR: ".",
350398
- DOCKER_DRIVER: "overlay2"
350399
- }), (0, exports.getDockerImageVariables)(context));
350380
+ DOCKER_DIR: "."
350381
+ }), getDockerBaseVariables()), (0, exports.getDockerImageVariables)(context));
350400
350382
  };
350401
350383
  exports.getDockerBuildVariables = getDockerBuildVariables;
350402
350384
  exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
@@ -350407,7 +350389,7 @@ var getDockerJobBaseProps = function (context) {
350407
350389
  name: "docker:20-dind",
350408
350390
  command: ["--tls=false"]
350409
350391
  }],
350410
- variables: (0, exports.getDockerBuildVariables)(context)
350392
+ variables: getDockerBaseVariables()
350411
350393
  };
350412
350394
  };
350413
350395
  exports.getDockerJobBaseProps = getDockerJobBaseProps;
@@ -350420,7 +350402,9 @@ var createDockerBuildJobBase = function (context, _a) {
350420
350402
  stage: "build"
350421
350403
  }, (0, exports.getDockerJobBaseProps)(context)), {
350422
350404
  script: script || []
350423
- }), def);
350405
+ }), {
350406
+ variables: (0, exports.getDockerBuildVariables)(context)
350407
+ }, def);
350424
350408
  };
350425
350409
  exports.createDockerBuildJobBase = createDockerBuildJobBase;
350426
350410
  exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
@@ -351069,29 +351053,25 @@ exports.createRailsBuildJobs = void 0;
351069
351053
  var types_1 = __nccwpck_require__(71197);
351070
351054
  var docker_1 = __nccwpck_require__(33219);
351071
351055
  var createRailsBuildJobs = function (context) {
351072
- var _a, _b, _c, _d, _e, _f;
351056
+ var _a, _b, _c;
351073
351057
  var buildConfig = context.componentConfig.build;
351074
351058
  if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
351075
351059
  // should not happen
351076
351060
  throw new Error("build type is not rails");
351077
351061
  }
351078
351062
  var cnbConf = buildConfig.cnbBuilder;
351079
- // backwards compatabilty with CNB_ENV_VARS
351080
- // TODO: remove when all projects are migrated
351081
- var packEnvArgs = (_c = (_b = (_a = buildConfig.extraVars) === null || _a === void 0 ? void 0 : _a.CNB_ENV_VARS) === null || _b === void 0 ? void 0 : _b.split(" ").map(function (v) {
351082
- return "--env '".concat(v, "'");
351083
- })) !== null && _c !== void 0 ? _c : Object.entries((_d = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
351063
+ var packEnvArgs = Object.entries((_a = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
351084
351064
  var _b = __read(_a, 2),
351085
351065
  k = _b[0],
351086
351066
  v = _b[1];
351087
351067
  return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
351088
- });
351068
+ }).join(" ");
351089
351069
  return [(0, docker_1.createDockerBuildJobBase)(context, {
351090
351070
  variables: context.componentConfig.build.extraVars,
351091
351071
  // custom script
351092
351072
  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",
351093
351073
  // replace private git ssh gem sources with https to make bundler with credentials via env var work
351094
- "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.join(" "), " ").concat((_f = (_e = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.packExtraArgs) === null || _e === void 0 ? void 0 : _e.join(" ")) !== null && _f !== void 0 ? _f : "")]
351074
+ "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 : "")]
351095
351075
  })];
351096
351076
  };
351097
351077
  exports.createRailsBuildJobs = createRailsBuildJobs;
@@ -351215,9 +351195,8 @@ var createRailsTestJobs = function (context) {
351215
351195
  var bundlerCache = {
351216
351196
  key: {
351217
351197
  files: ["Gemfile.lock"],
351218
- prefix: "$CI_JOB_IMAGE" // a changed image might have different OS libraries which no longer work with the cached gems
351198
+ prefix: "$CI_JOB_IMAGE"
351219
351199
  },
351220
-
351221
351200
  paths: [bundlerCacheDir]
351222
351201
  };
351223
351202
  var auditJob = buildConfig.audit !== false ? __assign(__assign({
@@ -351438,7 +351417,7 @@ exports.readConfigSync = readConfigSync;
351438
351417
 
351439
351418
  exports.__esModule = true;
351440
351419
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
351441
- exports.PIPELINE_IMAGE_TAG = "kube-command-59ed84cc" || 0;
351420
+ exports.PIPELINE_IMAGE_TAG = "kubernetes-new-cloudsql-d0cdae5b" || 0;
351442
351421
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
351443
351422
 
351444
351423
  /***/ }),
@@ -352871,20 +352850,21 @@ exports.__esModule = true;
352871
352850
  exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
352872
352851
  var context_1 = __nccwpck_require__(22041);
352873
352852
  var gitlab_1 = __nccwpck_require__(84997);
352853
+ var utils_1 = __nccwpck_require__(70463);
352874
352854
  var deployJob_1 = __nccwpck_require__(82256);
352875
352855
  var jobName_1 = __nccwpck_require__(77311);
352876
352856
  exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
352877
352857
  exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
352878
352858
  var getCloudSqlVariables = function (_a) {
352879
- var _b, _c, _d, _e;
352859
+ var _b, _c;
352880
352860
  var deployConfigRaw = _a.deployConfigRaw,
352881
352861
  environmentSlugPrefix = _a.environmentSlugPrefix,
352882
352862
  env = _a.env,
352883
352863
  componentName = _a.componentName,
352884
352864
  fullConfig = _a.fullConfig;
352885
352865
  if (deployConfigRaw && deployConfigRaw.cloudSql) {
352886
- var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_c = deployConfigRaw.cloudSql.dbBaseName) !== null && _c !== void 0 ? _c : componentName].filter(Boolean).join("-");
352887
- var additionalQueryParamsString = Object.entries((_d = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
352866
+ var DB_NAME = (0, utils_1.getFullDbName)(deployConfigRaw.cloudSql, fullConfig, environmentSlugPrefix, componentName);
352867
+ var additionalQueryParamsString = Object.entries((_b = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
352888
352868
  var _b = __read(_a, 2),
352889
352869
  key = _b[0],
352890
352870
  value = _b[1];
@@ -352893,7 +352873,7 @@ var getCloudSqlVariables = function (_a) {
352893
352873
  return {
352894
352874
  CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
352895
352875
  DB_NAME: DB_NAME,
352896
- DB_USER: (_e = deployConfigRaw.cloudSql.dbUser) !== null && _e !== void 0 ? _e : "postgres",
352876
+ DB_USER: (_c = deployConfigRaw.cloudSql.dbUser) !== null && _c !== void 0 ? _c : "postgres",
352897
352877
  DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
352898
352878
  DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
352899
352879
  DATABASE_JDBC_URL: "jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD".concat(additionalQueryParamsString)
@@ -353104,6 +353084,22 @@ exports.getCloudRunJobName = getCloudRunJobName;
353104
353084
 
353105
353085
  /***/ }),
353106
353086
 
353087
+ /***/ 70463:
353088
+ /***/ ((__unused_webpack_module, exports) => {
353089
+
353090
+ "use strict";
353091
+
353092
+
353093
+ exports.__esModule = true;
353094
+ exports.getFullDbName = void 0;
353095
+ var getFullDbName = function (cloudSqlConfig, fullConfig, environmentSlugPrefix, componentName) {
353096
+ var _a, _b;
353097
+ return [(_a = cloudSqlConfig.dbNamePrefix) !== null && _a !== void 0 ? _a : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlugPrefix, (_b = cloudSqlConfig.dbBaseName) !== null && _b !== void 0 ? _b : componentName].filter(Boolean).join("-");
353098
+ };
353099
+ exports.getFullDbName = getFullDbName;
353100
+
353101
+ /***/ }),
353102
+
353107
353103
  /***/ 16531:
353108
353104
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
353109
353105
 
@@ -353327,8 +353323,9 @@ exports.additionalKubernetesSecretKeys = additionalKubernetesSecretKeys;
353327
353323
 
353328
353324
 
353329
353325
  exports.__esModule = true;
353330
- exports.createCloudsqlBaseConfig = exports.getKubernetesCloudSQLConfig = exports.hasKubernetesCloudSQL = void 0;
353326
+ exports.createKubernetesCloudsqlBaseValues = exports.hasKubernetesCloudSQL = void 0;
353331
353327
  var context_1 = __nccwpck_require__(22041);
353328
+ var utils_1 = __nccwpck_require__(70463);
353332
353329
  var types_1 = __nccwpck_require__(63109);
353333
353330
  var hasKubernetesCloudSQL = function (context) {
353334
353331
  var _a, _b;
@@ -353338,22 +353335,42 @@ var hasKubernetesCloudSQL = function (context) {
353338
353335
  return false;
353339
353336
  };
353340
353337
  exports.hasKubernetesCloudSQL = hasKubernetesCloudSQL;
353341
- var getKubernetesCloudSQLConfig = function (context) {
353342
- var _a;
353343
- if ((0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
353344
- return (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
353338
+ var createKubernetesCloudsqlBaseValues = function (context) {
353339
+ var _a, _b, _c, _d, _e;
353340
+ if (!(0, types_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
353341
+ throw new Error("cannot get cloud sql config");
353342
+ }
353343
+ var config = (_a = context.componentConfig.deploy.values) === null || _a === void 0 ? void 0 : _a.cloudsql;
353344
+ if (!config) {
353345
+ throw new Error("cannot get cloud sql config");
353346
+ }
353347
+ var proxyCredentials = "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"));
353348
+ if ((config === null || config === void 0 ? void 0 : config.type) !== "unmanaged") {
353349
+ var instanceConnectionName = "".concat((_b = config.projectId) !== null && _b !== void 0 ? _b : "skynet-164509", ":").concat((_c = config.region) !== null && _c !== void 0 ? _c : "europe-west6", ":").concat((_d = config.instanceId) !== null && _d !== void 0 ? _d : context.environment.envVars.KUBE_NAMESPACE);
353350
+ return {
353351
+ cloudsql: {
353352
+ enabled: config.enabled,
353353
+ dbUser: "postgres",
353354
+ instanceConnectionName: instanceConnectionName,
353355
+ proxyCredentials: proxyCredentials,
353356
+ fullDbName: context.environment.envVars.KUBE_APP_NAME
353357
+ }
353358
+ };
353359
+ } else if (config.type === "unmanaged") {
353360
+ return {
353361
+ cloudsql: {
353362
+ enabled: config.enabled,
353363
+ dbUser: (_e = config.dbUser) !== null && _e !== void 0 ? _e : "postgres",
353364
+ instanceConnectionName: config.instanceConnectionName,
353365
+ proxyCredentials: proxyCredentials,
353366
+ fullDbName: (0, utils_1.getFullDbName)(config, context.fullConfig, context.environment.slugPrefix, context.componentName)
353367
+ }
353368
+ };
353369
+ } else {
353370
+ throw new Error("unknonw type");
353345
353371
  }
353346
- throw new Error("cannot get cloud sql config");
353347
- };
353348
- exports.getKubernetesCloudSQLConfig = getKubernetesCloudSQLConfig;
353349
- var createCloudsqlBaseConfig = function (context) {
353350
- return {
353351
- cloudsql: {
353352
- proxyCredentials: "$".concat((0, context_1.getSecretVarNameForContext)(context, "cloudsqlProxyCredentials"))
353353
- }
353354
- };
353355
353372
  };
353356
- exports.createCloudsqlBaseConfig = createCloudsqlBaseConfig;
353373
+ exports.createKubernetesCloudsqlBaseValues = createKubernetesCloudsqlBaseValues;
353357
353374
 
353358
353375
  /***/ }),
353359
353376
 
@@ -353736,7 +353753,7 @@ var createKubeValues = function (context) {
353736
353753
  var defaultKubeValues = (0, lodash_1.merge)({
353737
353754
  env: env,
353738
353755
  application: createAppConfig(context, application)
353739
- }, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createCloudsqlBaseConfig)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
353756
+ }, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createKubernetesCloudsqlBaseValues)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
353740
353757
  var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
353741
353758
  jobs: removeFalsy(jobs),
353742
353759
  cronjobs: removeFalsy(cronjobs)
@@ -354170,27 +354187,174 @@ var __generator = this && this.__generator || function (thisArg, body) {
354170
354187
  }
354171
354188
  };
354172
354189
  exports.__esModule = true;
354173
- exports.getBuildId = void 0;
354174
- var child_process_promise_1 = __nccwpck_require__(75763);
354175
- var getBuildId = function () {
354190
+ exports.getBuildId = void 0;
354191
+ var child_process_promise_1 = __nccwpck_require__(75763);
354192
+ var getBuildId = function () {
354193
+ return __awaiter(void 0, void 0, void 0, function () {
354194
+ return __generator(this, function (_a) {
354195
+ switch (_a.label) {
354196
+ case 0:
354197
+ return [4 /*yield*/, (0, child_process_promise_1.exec)("git describe --tags || git rev-parse HEAD").then(function (s) {
354198
+ return s.stdout.trim();
354199
+ })];
354200
+ case 1:
354201
+ return [2 /*return*/, _a.sent()];
354202
+ }
354203
+ });
354204
+ });
354205
+ };
354206
+ exports.getBuildId = getBuildId;
354207
+
354208
+ /***/ }),
354209
+
354210
+ /***/ 5923:
354211
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
354212
+
354213
+ "use strict";
354214
+
354215
+
354216
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
354217
+ function adopt(value) {
354218
+ return value instanceof P ? value : new P(function (resolve) {
354219
+ resolve(value);
354220
+ });
354221
+ }
354222
+ return new (P || (P = Promise))(function (resolve, reject) {
354223
+ function fulfilled(value) {
354224
+ try {
354225
+ step(generator.next(value));
354226
+ } catch (e) {
354227
+ reject(e);
354228
+ }
354229
+ }
354230
+ function rejected(value) {
354231
+ try {
354232
+ step(generator["throw"](value));
354233
+ } catch (e) {
354234
+ reject(e);
354235
+ }
354236
+ }
354237
+ function step(result) {
354238
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
354239
+ }
354240
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
354241
+ });
354242
+ };
354243
+ var __generator = this && this.__generator || function (thisArg, body) {
354244
+ var _ = {
354245
+ label: 0,
354246
+ sent: function () {
354247
+ if (t[0] & 1) throw t[1];
354248
+ return t[1];
354249
+ },
354250
+ trys: [],
354251
+ ops: []
354252
+ },
354253
+ f,
354254
+ y,
354255
+ t,
354256
+ g;
354257
+ return g = {
354258
+ next: verb(0),
354259
+ "throw": verb(1),
354260
+ "return": verb(2)
354261
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
354262
+ return this;
354263
+ }), g;
354264
+ function verb(n) {
354265
+ return function (v) {
354266
+ return step([n, v]);
354267
+ };
354268
+ }
354269
+ function step(op) {
354270
+ if (f) throw new TypeError("Generator is already executing.");
354271
+ while (_) try {
354272
+ 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;
354273
+ if (y = 0, t) op = [op[0] & 2, t.value];
354274
+ switch (op[0]) {
354275
+ case 0:
354276
+ case 1:
354277
+ t = op;
354278
+ break;
354279
+ case 4:
354280
+ _.label++;
354281
+ return {
354282
+ value: op[1],
354283
+ done: false
354284
+ };
354285
+ case 5:
354286
+ _.label++;
354287
+ y = op[1];
354288
+ op = [0];
354289
+ continue;
354290
+ case 7:
354291
+ op = _.ops.pop();
354292
+ _.trys.pop();
354293
+ continue;
354294
+ default:
354295
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
354296
+ _ = 0;
354297
+ continue;
354298
+ }
354299
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
354300
+ _.label = op[1];
354301
+ break;
354302
+ }
354303
+ if (op[0] === 6 && _.label < t[1]) {
354304
+ _.label = t[1];
354305
+ t = op;
354306
+ break;
354307
+ }
354308
+ if (t && _.label < t[2]) {
354309
+ _.label = t[2];
354310
+ _.ops.push(op);
354311
+ break;
354312
+ }
354313
+ if (t[2]) _.ops.pop();
354314
+ _.trys.pop();
354315
+ continue;
354316
+ }
354317
+ op = body.call(thisArg, _);
354318
+ } catch (e) {
354319
+ op = [6, e];
354320
+ y = 0;
354321
+ } finally {
354322
+ f = t = 0;
354323
+ }
354324
+ if (op[0] & 5) throw op[1];
354325
+ return {
354326
+ value: op[0] ? op[1] : void 0,
354327
+ done: true
354328
+ };
354329
+ }
354330
+ };
354331
+ exports.__esModule = true;
354332
+ exports.getBaseCommitInfo = void 0;
354333
+ var getBuildId_1 = __nccwpck_require__(60630);
354334
+ var getBaseCommitInfo = function () {
354176
354335
  return __awaiter(void 0, void 0, void 0, function () {
354177
- return __generator(this, function (_a) {
354178
- switch (_a.label) {
354336
+ var _a;
354337
+ var _b;
354338
+ return __generator(this, function (_c) {
354339
+ switch (_c.label) {
354179
354340
  case 0:
354180
- return [4 /*yield*/, (0, child_process_promise_1.exec)("git describe --tags || git rev-parse HEAD").then(function (s) {
354181
- return s.stdout.trim();
354182
- })];
354341
+ _a = {
354342
+ refName: (_b = process.env.CI_COMMIT_REF_NAME) !== null && _b !== void 0 ? _b : "unknown",
354343
+ reviewSlug: process.env.CI_MERGE_REQUEST_IID ? "mr".concat(process.env.CI_MERGE_REQUEST_IID) : "unknown",
354344
+ buildTime: new Date().toISOString()
354345
+ };
354346
+ return [4 /*yield*/, (0, getBuildId_1.getBuildId)()];
354183
354347
  case 1:
354184
- return [2 /*return*/, _a.sent()];
354348
+ return [2 /*return*/, (_a.buildId = _c.sent(), _a)];
354185
354349
  }
354186
354350
  });
354187
354351
  });
354188
354352
  };
354189
- exports.getBuildId = getBuildId;
354353
+ exports.getBaseCommitInfo = getBaseCommitInfo;
354190
354354
 
354191
354355
  /***/ }),
354192
354356
 
354193
- /***/ 5923:
354357
+ /***/ 17052:
354194
354358
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
354195
354359
 
354196
354360
  "use strict";
@@ -354312,28 +354476,52 @@ var __generator = this && this.__generator || function (thisArg, body) {
354312
354476
  }
354313
354477
  };
354314
354478
  exports.__esModule = true;
354315
- exports.getBaseCommitInfo = void 0;
354316
- var getBuildId_1 = __nccwpck_require__(60630);
354317
- var getBaseCommitInfo = function () {
354479
+ exports.createAllJobs = void 0;
354480
+ var config_1 = __nccwpck_require__(33138);
354481
+ var createJobsForComponent_1 = __nccwpck_require__(80962);
354482
+ var createAllJobs = function (config, trigger) {
354318
354483
  return __awaiter(void 0, void 0, void 0, function () {
354319
- var _a;
354320
- var _b;
354484
+ var _a, _b;
354321
354485
  return __generator(this, function (_c) {
354322
354486
  switch (_c.label) {
354323
354487
  case 0:
354324
- _a = {
354325
- refName: (_b = process.env.CI_COMMIT_REF_NAME) !== null && _b !== void 0 ? _b : "unknown",
354326
- reviewSlug: process.env.CI_MERGE_REQUEST_IID ? "mr".concat(process.env.CI_MERGE_REQUEST_IID) : "unknown",
354327
- buildTime: new Date().toISOString()
354328
- };
354329
- return [4 /*yield*/, (0, getBuildId_1.getBuildId)()];
354488
+ _b = (_a = Object).fromEntries;
354489
+ return [4 /*yield*/, Promise.all(Object.keys(config.components).map(function (componentName) {
354490
+ return __awaiter(void 0, void 0, void 0, function () {
354491
+ var envs, _a, _b, _c;
354492
+ return __generator(this, function (_d) {
354493
+ switch (_d.label) {
354494
+ case 0:
354495
+ envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
354496
+ _a = [componentName];
354497
+ _c = (_b = Object).fromEntries;
354498
+ return [4 /*yield*/, Promise.all(envs.map(function (env) {
354499
+ return __awaiter(void 0, void 0, void 0, function () {
354500
+ var _a;
354501
+ return __generator(this, function (_b) {
354502
+ switch (_b.label) {
354503
+ case 0:
354504
+ _a = [env];
354505
+ return [4 /*yield*/, (0, createJobsForComponent_1.createJobsForComponent)(config, componentName, env, trigger)];
354506
+ case 1:
354507
+ return [2 /*return*/, _a.concat([_b.sent()])];
354508
+ }
354509
+ });
354510
+ });
354511
+ }))];
354512
+ case 1:
354513
+ return [2 /*return*/, _a.concat([_c.apply(_b, [_d.sent()])])];
354514
+ }
354515
+ });
354516
+ });
354517
+ }))];
354330
354518
  case 1:
354331
- return [2 /*return*/, (_a.buildId = _c.sent(), _a)];
354519
+ return [2 /*return*/, _b.apply(_a, [_c.sent()])];
354332
354520
  }
354333
354521
  });
354334
354522
  });
354335
354523
  };
354336
- exports.getBaseCommitInfo = getBaseCommitInfo;
354524
+ exports.createAllJobs = createAllJobs;
354337
354525
 
354338
354526
  /***/ }),
354339
354527
 
@@ -354343,16 +354531,6 @@ exports.getBaseCommitInfo = getBaseCommitInfo;
354343
354531
  "use strict";
354344
354532
 
354345
354533
 
354346
- var __assign = this && this.__assign || function () {
354347
- __assign = Object.assign || function (t) {
354348
- for (var s, i = 1, n = arguments.length; i < n; i++) {
354349
- s = arguments[i];
354350
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
354351
- }
354352
- return t;
354353
- };
354354
- return __assign.apply(this, arguments);
354355
- };
354356
354534
  var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
354357
354535
  function adopt(value) {
354358
354536
  return value instanceof P ? value : new P(function (resolve) {
@@ -354505,54 +354683,40 @@ var config_1 = __nccwpck_require__(33138);
354505
354683
  var rules_1 = __nccwpck_require__(42020);
354506
354684
  var runner_1 = __nccwpck_require__(55071);
354507
354685
  var jobs_1 = __nccwpck_require__(62339);
354508
- var createJobs_1 = __nccwpck_require__(57726);
354686
+ var createAllJobs_1 = __nccwpck_require__(17052);
354687
+ var createGitlabJobs_1 = __nccwpck_require__(63920);
354509
354688
  var createChildPipeline = function (type, trigger, config) {
354510
354689
  return __awaiter(void 0, void 0, void 0, function () {
354511
- var components, jobs, allEnvs, stages, pipeline;
354512
- return __generator(this, function (_a) {
354513
- switch (_a.label) {
354690
+ var jobs, allEnvs, stages, pipeline;
354691
+ var _a;
354692
+ return __generator(this, function (_b) {
354693
+ switch (_b.label) {
354514
354694
  case 0:
354515
- components = Object.keys(config.components);
354516
- return [4 /*yield*/, components.reduce(function (acc, componentName) {
354517
- return __awaiter(void 0, void 0, void 0, function () {
354518
- var envs, _a, _b;
354519
- return __generator(this, function (_c) {
354520
- switch (_c.label) {
354521
- case 0:
354522
- envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
354523
- _a = [{}];
354524
- return [4 /*yield*/, acc];
354525
- case 1:
354526
- _b = [__assign.apply(void 0, _a.concat([_c.sent()]))];
354527
- return [4 /*yield*/, (0, createJobs_1.createJobs)(type, envs, config, componentName, trigger)];
354528
- case 2:
354529
- return [2 /*return*/, __assign.apply(void 0, _b.concat([_c.sent()]))];
354530
- }
354531
- });
354532
- });
354533
- }, Promise.resolve({}))];
354695
+ return [4 /*yield*/, (0, createAllJobs_1.createAllJobs)(config, trigger)];
354534
354696
  case 1:
354535
- jobs = _a.sent();
354697
+ jobs = _b.sent();
354536
354698
  allEnvs = (0, config_1.getAllEnvsInAllComponents)(config);
354537
354699
  stages = jobs_1.BASE_STAGES.reduce(function (acc, baseStage) {
354538
354700
  return __spreadArray(__spreadArray(__spreadArray([], __read(acc), false), [baseStage], false), __read(allEnvs.map(function (e) {
354539
354701
  return "".concat(baseStage, " ").concat(e);
354540
354702
  })), false);
354541
354703
  }, []);
354542
- if (type === "gitlab") {
354543
- pipeline = {
354544
- image: (0, runner_1.getRunnerImage)("jobs-default"),
354545
- variables: {
354546
- FF_USE_FASTZIP: "true"
354547
- },
354548
- workflow: {
354549
- rules: rules_1.RULES_ALWAYS
354550
- },
354551
- stages: stages,
354552
- jobs: jobs
354553
- };
354554
- return [2 /*return*/, pipeline];
354555
- }
354704
+ if (!(type === "gitlab")) return [3 /*break*/, 3];
354705
+ _a = {
354706
+ image: (0, runner_1.getRunnerImage)("jobs-default"),
354707
+ variables: {
354708
+ FF_USE_FASTZIP: "true"
354709
+ },
354710
+ workflow: {
354711
+ rules: rules_1.RULES_ALWAYS
354712
+ },
354713
+ stages: stages
354714
+ };
354715
+ return [4 /*yield*/, (0, createGitlabJobs_1.createGitlabJobs)(jobs)];
354716
+ case 2:
354717
+ pipeline = (_a.jobs = _b.sent(), _a);
354718
+ return [2 /*return*/, pipeline];
354719
+ case 3:
354556
354720
  throw new Error("".concat(type, " is not supported"));
354557
354721
  }
354558
354722
  });
@@ -354562,7 +354726,7 @@ exports.createChildPipeline = createChildPipeline;
354562
354726
 
354563
354727
  /***/ }),
354564
354728
 
354565
- /***/ 57726:
354729
+ /***/ 80962:
354566
354730
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
354567
354731
 
354568
354732
  "use strict";
@@ -354733,14 +354897,12 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
354733
354897
  return to.concat(ar || Array.prototype.slice.call(from));
354734
354898
  };
354735
354899
  exports.__esModule = true;
354736
- exports.createJobs = void 0;
354900
+ exports.createJobsForComponent = void 0;
354737
354901
  var lodash_1 = __nccwpck_require__(23255);
354738
354902
  var build_1 = __nccwpck_require__(73760);
354739
354903
  var context_1 = __nccwpck_require__(22041);
354740
354904
  var deploy_1 = __nccwpck_require__(90223);
354741
- var utils_1 = __nccwpck_require__(37461);
354742
354905
  var getCommitInfo_1 = __nccwpck_require__(5923);
354743
- var makeGitlabJob_1 = __nccwpck_require__(15715);
354744
354906
  var packageManager_1 = __nccwpck_require__(69168);
354745
354907
  var injectDefaultVarsInCustomJobs = function (context, jobs) {
354746
354908
  return jobs.map(function (_a) {
@@ -354768,71 +354930,9 @@ var createRawJobs = function (context) {
354768
354930
  var customJobs = getCustomJobs(context);
354769
354931
  return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
354770
354932
  };
354771
- var getFullJobName = function (name, componentName, env) {
354772
- if (env) {
354773
- return "".concat(componentName, " ").concat(name, " | ").concat(env, " ");
354774
- }
354775
- return "".concat(componentName, " ").concat(name);
354776
- };
354777
- var getFullReferencedJobName = function (referencedJobName, componentName, env, allRawJobs) {
354778
- var referencedJob = allRawJobs.find(function (j) {
354779
- return j.name === referencedJobName;
354780
- });
354781
- if (!referencedJob) {
354782
- throw new Error("unknown job referenced: " + referencedJobName);
354783
- }
354784
- var envToSet = referencedJob.envMode !== "none" ? env : null;
354785
- return getFullJobName(referencedJobName, componentName, envToSet);
354786
- };
354787
- // replaces references to other jobs with the full name
354788
- // the full name contains the componentname and the env name (if any)
354789
- var replaceReferences = function (job, componentName, env, allRawJobs) {
354790
- var _a, _b, _c;
354791
- var stage = job.envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
354792
- var cleanedNeeds = __spreadArray(__spreadArray([], __read((_a = job.needs) !== null && _a !== void 0 ? _a : []), false), __read((_b = job.needsOtherComponent) !== null && _b !== void 0 ? _b : []), false);
354793
- var needs = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
354794
- var _a;
354795
- return (0, lodash_1.isObject)(n) ? {
354796
- job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allRawJobs),
354797
- artifacts: n.artifacts
354798
- } : getFullReferencedJobName(n, componentName, env, allRawJobs);
354799
- });
354800
- return __assign(__assign({}, job), {
354801
- stage: stage,
354802
- needs: needs,
354803
- environment: ((_c = job.environment) === null || _c === void 0 ? void 0 : _c.on_stop) ? __assign(__assign({}, job.environment), {
354804
- on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allRawJobs)
354805
- }) : job.environment
354806
- });
354807
- };
354808
- // this can be removed once https://gitlab.com/gitlab-org/gitlab/-/issues/220758 is resolved
354809
- var addStageNeeds = function (jobs) {
354810
- // when a job defines needsStages, we add these as needs
354811
- return jobs.map(function (job) {
354812
- var _a;
354813
- if (!job.needsStages || job.needsStages.length === 0) {
354814
- return job;
354815
- }
354816
- var neededJobs = jobs.map(function (j) {
354817
- var _a, _b;
354818
- var neededStage = (_a = job.needsStages) === null || _a === void 0 ? void 0 : _a.find(function (s) {
354819
- return j.stage === s.stage;
354820
- });
354821
- if (neededStage) {
354822
- return {
354823
- job: j.name,
354824
- artifacts: (_b = neededStage.artifacts) !== null && _b !== void 0 ? _b : false
354825
- };
354826
- }
354827
- }).filter(utils_1.notNil);
354828
- return __assign(__assign({}, job), {
354829
- needs: __spreadArray(__spreadArray([], __read((_a = job.needs) !== null && _a !== void 0 ? _a : []), false), __read(neededJobs), false)
354830
- });
354831
- });
354832
- };
354833
- var createJobs = function (type, envs, config, componentName, trigger) {
354933
+ var createJobsForComponent = function (config, componentName, env, trigger) {
354834
354934
  return __awaiter(void 0, void 0, void 0, function () {
354835
- var commitInfo, _a, packageManagerInfo;
354935
+ var commitInfo, _a, packageManagerInfo, context;
354836
354936
  return __generator(this, function (_b) {
354837
354937
  switch (_b.label) {
354838
354938
  case 0:
@@ -354845,47 +354945,19 @@ var createJobs = function (type, envs, config, componentName, trigger) {
354845
354945
  return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(config, componentName)];
354846
354946
  case 2:
354847
354947
  packageManagerInfo = _b.sent();
354848
- return [2 /*return*/, envs.reduce(function (acc, env) {
354849
- return __awaiter(void 0, void 0, void 0, function () {
354850
- var context, jobs, result, _a, _b, _c, _d, _e;
354851
- return __generator(this, function (_f) {
354852
- switch (_f.label) {
354853
- case 0:
354854
- return [4 /*yield*/, (0, context_1.createContext)(config, componentName, env, commitInfo, packageManagerInfo)];
354855
- case 1:
354856
- context = _f.sent();
354857
- jobs = addStageNeeds(createRawJobs(context));
354858
- _a = [{}];
354859
- return [4 /*yield*/, acc];
354860
- case 2:
354861
- _b = [__assign.apply(void 0, _a.concat([_f.sent()]))];
354862
- _d = (_c = jobs).reduce;
354863
- _e = [function (acc, job) {
354864
- var _a;
354865
- var jobWithResolvedReferences = replaceReferences(job, componentName, env, jobs);
354866
- var jobName = getFullJobName(job.name, componentName, job.envMode !== "none" ? env : undefined);
354867
- if (type === "gitlab") {
354868
- return __assign(__assign({}, acc), (_a = {}, _a[jobName] = (0, makeGitlabJob_1.makeGitlabJob)(jobWithResolvedReferences), _a));
354869
- }
354870
- throw new Error("not supported");
354871
- }];
354872
- return [4 /*yield*/, Promise.resolve({})];
354873
- case 3:
354874
- result = __assign.apply(void 0, _b.concat([_d.apply(_c, _e.concat([_f.sent()]))]));
354875
- return [2 /*return*/, result];
354876
- }
354877
- });
354878
- });
354879
- }, {})];
354948
+ return [4 /*yield*/, (0, context_1.createContext)(config, componentName, env, commitInfo, packageManagerInfo)];
354949
+ case 3:
354950
+ context = _b.sent();
354951
+ return [2 /*return*/, createRawJobs(context)];
354880
354952
  }
354881
354953
  });
354882
354954
  });
354883
354955
  };
354884
- exports.createJobs = createJobs;
354956
+ exports.createJobsForComponent = createJobsForComponent;
354885
354957
 
354886
354958
  /***/ }),
354887
354959
 
354888
- /***/ 15715:
354960
+ /***/ 63920:
354889
354961
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
354890
354962
 
354891
354963
  "use strict";
@@ -354901,6 +354973,121 @@ var __assign = this && this.__assign || function () {
354901
354973
  };
354902
354974
  return __assign.apply(this, arguments);
354903
354975
  };
354976
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
354977
+ function adopt(value) {
354978
+ return value instanceof P ? value : new P(function (resolve) {
354979
+ resolve(value);
354980
+ });
354981
+ }
354982
+ return new (P || (P = Promise))(function (resolve, reject) {
354983
+ function fulfilled(value) {
354984
+ try {
354985
+ step(generator.next(value));
354986
+ } catch (e) {
354987
+ reject(e);
354988
+ }
354989
+ }
354990
+ function rejected(value) {
354991
+ try {
354992
+ step(generator["throw"](value));
354993
+ } catch (e) {
354994
+ reject(e);
354995
+ }
354996
+ }
354997
+ function step(result) {
354998
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
354999
+ }
355000
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
355001
+ });
355002
+ };
355003
+ var __generator = this && this.__generator || function (thisArg, body) {
355004
+ var _ = {
355005
+ label: 0,
355006
+ sent: function () {
355007
+ if (t[0] & 1) throw t[1];
355008
+ return t[1];
355009
+ },
355010
+ trys: [],
355011
+ ops: []
355012
+ },
355013
+ f,
355014
+ y,
355015
+ t,
355016
+ g;
355017
+ return g = {
355018
+ next: verb(0),
355019
+ "throw": verb(1),
355020
+ "return": verb(2)
355021
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
355022
+ return this;
355023
+ }), g;
355024
+ function verb(n) {
355025
+ return function (v) {
355026
+ return step([n, v]);
355027
+ };
355028
+ }
355029
+ function step(op) {
355030
+ if (f) throw new TypeError("Generator is already executing.");
355031
+ while (_) try {
355032
+ 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;
355033
+ if (y = 0, t) op = [op[0] & 2, t.value];
355034
+ switch (op[0]) {
355035
+ case 0:
355036
+ case 1:
355037
+ t = op;
355038
+ break;
355039
+ case 4:
355040
+ _.label++;
355041
+ return {
355042
+ value: op[1],
355043
+ done: false
355044
+ };
355045
+ case 5:
355046
+ _.label++;
355047
+ y = op[1];
355048
+ op = [0];
355049
+ continue;
355050
+ case 7:
355051
+ op = _.ops.pop();
355052
+ _.trys.pop();
355053
+ continue;
355054
+ default:
355055
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
355056
+ _ = 0;
355057
+ continue;
355058
+ }
355059
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
355060
+ _.label = op[1];
355061
+ break;
355062
+ }
355063
+ if (op[0] === 6 && _.label < t[1]) {
355064
+ _.label = t[1];
355065
+ t = op;
355066
+ break;
355067
+ }
355068
+ if (t && _.label < t[2]) {
355069
+ _.label = t[2];
355070
+ _.ops.push(op);
355071
+ break;
355072
+ }
355073
+ if (t[2]) _.ops.pop();
355074
+ _.trys.pop();
355075
+ continue;
355076
+ }
355077
+ op = body.call(thisArg, _);
355078
+ } catch (e) {
355079
+ op = [6, e];
355080
+ y = 0;
355081
+ } finally {
355082
+ f = t = 0;
355083
+ }
355084
+ if (op[0] & 5) throw op[1];
355085
+ return {
355086
+ value: op[0] ? op[1] : void 0,
355087
+ done: true
355088
+ };
355089
+ }
355090
+ };
354904
355091
  var __rest = this && this.__rest || function (s, e) {
354905
355092
  var t = {};
354906
355093
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -354941,29 +355128,99 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
354941
355128
  return to.concat(ar || Array.prototype.slice.call(from));
354942
355129
  };
354943
355130
  exports.__esModule = true;
354944
- exports.makeGitlabJob = void 0;
355131
+ exports.createGitlabJobs = exports.makeGitlabJob = void 0;
354945
355132
  var lodash_1 = __nccwpck_require__(23255);
354946
355133
  var defaults_1 = __nccwpck_require__(87383);
355134
+ var getFullJobName = function (name, componentName, env) {
355135
+ if (env) {
355136
+ return "".concat(componentName, " ").concat(name, " | ").concat(env, " ");
355137
+ }
355138
+ return "".concat(componentName, " ").concat(name);
355139
+ };
355140
+ var getFullReferencedJobName = function (referencedJobName, componentName, env, allJobs) {
355141
+ var _a, _b;
355142
+ var referencedJob = (_b = (_a = allJobs[componentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.find(function (j) {
355143
+ return j.name === referencedJobName;
355144
+ });
355145
+ if (!referencedJob) {
355146
+ throw new Error("unknown job referenced: '".concat(referencedJobName, "' from '").concat(env, ":").concat(componentName, "'"));
355147
+ }
355148
+ var envToSet = referencedJob.envMode !== "none" ? env : null;
355149
+ return getFullJobName(referencedJobName, componentName, envToSet);
355150
+ };
354947
355151
  var getJobName = function (need) {
354948
355152
  return (0, lodash_1.isObject)(need) ? need.job : need;
354949
355153
  };
354950
- var makeGitlabJob = function (_a) {
355154
+ var makeGitlabJob = function (componentName, env, _a, allJobs) {
355155
+ var _b;
354951
355156
  var envMode = _a.envMode,
354952
355157
  needsStages = _a.needsStages,
354953
355158
  needsOtherComponent = _a.needsOtherComponent,
354954
355159
  name = _a.name,
354955
355160
  needs = _a.needs,
354956
- rest = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
354957
- return __assign(__assign({}, rest), {
355161
+ job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
355162
+ var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
355163
+ var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
355164
+ var _a, _b, _c, _d;
355165
+ var referencedComponentName = componentName;
355166
+ var allJobNamesFromThatStage = (_d = (_c = (_b = (_a = allJobs[referencedComponentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.filter(function (j) {
355167
+ return j.stage === n.stage;
355168
+ })) === null || _c === void 0 ? void 0 : _c.map(function (j) {
355169
+ return j.name;
355170
+ })) !== null && _d !== void 0 ? _d : [];
355171
+ return allJobNamesFromThatStage.map(function (job) {
355172
+ var _a;
355173
+ return {
355174
+ job: job,
355175
+ artifacts: (_a = n.artifacts) !== null && _a !== void 0 ? _a : false,
355176
+ componentName: referencedComponentName
355177
+ };
355178
+ });
355179
+ });
355180
+ var cleanedNeeds = __spreadArray(__spreadArray(__spreadArray([], __read(needs !== null && needs !== void 0 ? needs : []), false), __read(needsOtherComponent !== null && needsOtherComponent !== void 0 ? needsOtherComponent : []), false), __read(needsFromStages !== null && needsFromStages !== void 0 ? needsFromStages : []), false);
355181
+ var gitlabNeeds = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
355182
+ var _a;
355183
+ return (0, lodash_1.isObject)(n) ? {
355184
+ job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
355185
+ artifacts: n.artifacts
355186
+ } : getFullReferencedJobName(n, componentName, env, allJobs);
355187
+ }).sort(function (a, b) {
355188
+ return getJobName(a).localeCompare(getJobName(b));
355189
+ });
355190
+ var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
355191
+ var gitlabJob = __assign(__assign({}, job), {
355192
+ stage: stage,
355193
+ environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {
355194
+ on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allJobs)
355195
+ }) : job.environment,
354958
355196
  // sort in a predictable manner for snapshot tests
354959
- needs: needs ? __spreadArray([], __read(needs), false).sort(function (a, b) {
354960
- return getJobName(a).localeCompare(getJobName(b));
354961
- }) : undefined,
355197
+ needs: gitlabNeeds,
354962
355198
  retry: defaults_1.BASE_RETRY,
354963
355199
  interruptible: true
354964
355200
  });
355201
+ return [fullJobName, gitlabJob];
354965
355202
  };
354966
355203
  exports.makeGitlabJob = makeGitlabJob;
355204
+ var createGitlabJobs = function (allJobs) {
355205
+ return __awaiter(void 0, void 0, void 0, function () {
355206
+ return __generator(this, function (_a) {
355207
+ return [2 /*return*/, Object.keys(allJobs).reduce(function (accForComponents, componentName) {
355208
+ var componentJobs = allJobs[componentName];
355209
+ return __assign(__assign({}, accForComponents), Object.keys(componentJobs).reduce(function (accForEnvs, env) {
355210
+ var jobs = componentJobs[env];
355211
+ return __assign(__assign({}, accForEnvs), jobs.reduce(function (accForJobs, job) {
355212
+ var _a;
355213
+ var _b = __read((0, exports.makeGitlabJob)(componentName, env, job, allJobs), 2),
355214
+ fullJobName = _b[0],
355215
+ gitlabJob = _b[1];
355216
+ return __assign(__assign({}, accForJobs), (_a = {}, _a[fullJobName] = gitlabJob, _a));
355217
+ }, {}));
355218
+ }, {}));
355219
+ }, {})];
355220
+ });
355221
+ });
355222
+ };
355223
+ exports.createGitlabJobs = createGitlabJobs;
354967
355224
 
354968
355225
  /***/ }),
354969
355226
 
@@ -354990,7 +355247,7 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
354990
355247
  };
354991
355248
  exports.__esModule = true;
354992
355249
  __exportStar(__nccwpck_require__(78974), exports);
354993
- __exportStar(__nccwpck_require__(57726), exports);
355250
+ __exportStar(__nccwpck_require__(80962), exports);
354994
355251
 
354995
355252
  /***/ }),
354996
355253