@catladder/cli 0.0.0-fix-cloud-run-instance-number-619b31f2 → 0.0.0-hidden-secrets-da086bf2
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.
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +15 -4
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/index.js +11 -7
- package/dist/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/apps/cli/commands/project/setup/setupTopic.d.ts +2 -0
- package/dist/apps/cli/commands/project/setup/setupTopic.js +69 -0
- package/dist/apps/cli/commands/project/setup/setupTopic.js.map +1 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.js +3 -1
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -1
- package/dist/bundles/catenv/index.js +538 -215
- package/dist/bundles/cli/index.js +1265 -795
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +16 -2
- package/src/apps/cli/commands/project/setup/index.ts +2 -0
- package/src/apps/cli/commands/project/setup/setupTopic.ts +22 -0
- package/src/apps/cli/verify/migration/migrateSecrets.ts +6 -1
|
@@ -1700,13 +1700,24 @@ var resolveJson = function (v) {
|
|
|
1700
1700
|
];
|
|
1701
1701
|
}));
|
|
1702
1702
|
};
|
|
1703
|
-
var
|
|
1704
|
-
var secretEnvVarKeys
|
|
1703
|
+
var getNonHiddenSecretEnvVarKeys = function (env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1704
|
+
var secretEnvVarKeys;
|
|
1705
1705
|
return __generator(this, function (_a) {
|
|
1706
1706
|
switch (_a.label) {
|
|
1707
1707
|
case 0: return [4 /*yield*/, (0, getProjectConfig_1.getEnvironment)(env, componentName)];
|
|
1708
1708
|
case 1:
|
|
1709
1709
|
secretEnvVarKeys = (_a.sent()).secretEnvVarKeys;
|
|
1710
|
+
return [2 /*return*/, secretEnvVarKeys.filter(function (k) { return !k.hidden; }).map(function (k) { return k.key; })];
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1713
|
+
}); };
|
|
1714
|
+
var getEnvVarsToEdit = function (instance, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1715
|
+
var secretEnvVarKeys, allEnvVars;
|
|
1716
|
+
return __generator(this, function (_a) {
|
|
1717
|
+
switch (_a.label) {
|
|
1718
|
+
case 0: return [4 /*yield*/, getNonHiddenSecretEnvVarKeys(env, componentName)];
|
|
1719
|
+
case 1:
|
|
1720
|
+
secretEnvVarKeys = _a.sent();
|
|
1710
1721
|
return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(instance, env, componentName)];
|
|
1711
1722
|
case 2:
|
|
1712
1723
|
allEnvVars = _a.sent();
|
|
@@ -1783,9 +1794,9 @@ var doItFor = function (instance, envAndComponents) { return __awaiter(void 0, v
|
|
|
1783
1794
|
usedKeys = valuesToEdit[componentName][env]
|
|
1784
1795
|
? Object.keys(valuesToEdit[componentName][env])
|
|
1785
1796
|
: [];
|
|
1786
|
-
return [4 /*yield*/, (
|
|
1797
|
+
return [4 /*yield*/, getNonHiddenSecretEnvVarKeys(env, componentName)];
|
|
1787
1798
|
case 6:
|
|
1788
|
-
secretEnvVarKeys =
|
|
1799
|
+
secretEnvVarKeys = _k.sent();
|
|
1789
1800
|
extranous = (0, lodash_1.difference)(usedKeys, secretEnvVarKeys);
|
|
1790
1801
|
missing = (0, lodash_1.difference)(secretEnvVarKeys, usedKeys);
|
|
1791
1802
|
if (!(extranous.length > 0 || missing.length > 0)) return [3 /*break*/, 9];
|
|
@@ -4225,6 +4236,7 @@ var getProjectConfig_1 = __nccwpck_require__(24146);
|
|
|
4225
4236
|
var commandConfigSecrets_1 = __nccwpck_require__(80883);
|
|
4226
4237
|
var setupAccessTokens_1 = __nccwpck_require__(64270);
|
|
4227
4238
|
var setupContext_1 = __nccwpck_require__(40663);
|
|
4239
|
+
var setupTopic_1 = __nccwpck_require__(21082);
|
|
4228
4240
|
var setupProject = function (instance) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4229
4241
|
var allContext, _i, allContext_1, context, configSecrets;
|
|
4230
4242
|
return __generator(this, function (_a) {
|
|
@@ -4246,6 +4258,9 @@ var setupProject = function (instance) { return __awaiter(void 0, void 0, void 0
|
|
|
4246
4258
|
return [3 /*break*/, 2];
|
|
4247
4259
|
case 5: return [4 /*yield*/, (0, setupAccessTokens_1.setupAccessTokens)(instance)];
|
|
4248
4260
|
case 6:
|
|
4261
|
+
_a.sent();
|
|
4262
|
+
return [4 /*yield*/, (0, setupTopic_1.setupTopic)(instance)];
|
|
4263
|
+
case 7:
|
|
4249
4264
|
_a.sent();
|
|
4250
4265
|
instance.log("");
|
|
4251
4266
|
return [4 /*yield*/, instance.prompt({
|
|
@@ -4254,18 +4269,18 @@ var setupProject = function (instance) { return __awaiter(void 0, void 0, void 0
|
|
|
4254
4269
|
name: "configSecrets",
|
|
4255
4270
|
type: "confirm"
|
|
4256
4271
|
})];
|
|
4257
|
-
case
|
|
4272
|
+
case 8:
|
|
4258
4273
|
configSecrets = (_a.sent()).configSecrets;
|
|
4259
4274
|
instance.log("");
|
|
4260
|
-
if (!configSecrets) return [3 /*break*/,
|
|
4275
|
+
if (!configSecrets) return [3 /*break*/, 10];
|
|
4261
4276
|
return [4 /*yield*/, (0, commandConfigSecrets_1.projectConfigSecrets)(instance)];
|
|
4262
|
-
case 8:
|
|
4263
|
-
_a.sent();
|
|
4264
|
-
return [3 /*break*/, 10];
|
|
4265
4277
|
case 9:
|
|
4266
|
-
|
|
4267
|
-
|
|
4278
|
+
_a.sent();
|
|
4279
|
+
return [3 /*break*/, 11];
|
|
4268
4280
|
case 10:
|
|
4281
|
+
instance.log("👆 don't forget to config secret using `project-config-secrets`");
|
|
4282
|
+
_a.label = 11;
|
|
4283
|
+
case 11:
|
|
4269
4284
|
instance.log("");
|
|
4270
4285
|
instance.log("gitlab is ready! 🥂");
|
|
4271
4286
|
instance.log("\n");
|
|
@@ -4829,7 +4844,7 @@ exports.setupKubernetes = setupKubernetes;
|
|
|
4829
4844
|
|
|
4830
4845
|
/***/ }),
|
|
4831
4846
|
|
|
4832
|
-
/***/
|
|
4847
|
+
/***/ 21082:
|
|
4833
4848
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4834
4849
|
|
|
4835
4850
|
"use strict";
|
|
@@ -4880,59 +4895,32 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
4880
4895
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
4881
4896
|
};
|
|
4882
4897
|
exports.__esModule = true;
|
|
4883
|
-
exports.
|
|
4884
|
-
var
|
|
4885
|
-
var
|
|
4886
|
-
var
|
|
4887
|
-
var
|
|
4888
|
-
return __generator(this, function (_a) {
|
|
4889
|
-
switch (_a.label) {
|
|
4890
|
-
case 0: return [4 /*yield*/, (0, getProjectConfig_1.getProjectConfig)()];
|
|
4891
|
-
case 1:
|
|
4892
|
-
config = _a.sent();
|
|
4893
|
-
if (!config) {
|
|
4894
|
-
return [2 /*return*/, []];
|
|
4895
|
-
}
|
|
4896
|
-
return [2 /*return*/, (0, pipeline_1.getAllEnvsInAllComponents)(config)];
|
|
4897
|
-
}
|
|
4898
|
-
});
|
|
4899
|
-
}); };
|
|
4900
|
-
exports.allEnvs = allEnvs;
|
|
4901
|
-
var envAndComponents = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
4902
|
-
var allEnvAndcomponents;
|
|
4898
|
+
exports.setupTopic = void 0;
|
|
4899
|
+
var gitlab_1 = __nccwpck_require__(79818);
|
|
4900
|
+
var catladderTopic = "catladder";
|
|
4901
|
+
var setupTopic = function (instance) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4902
|
+
var projectId, topics;
|
|
4903
4903
|
return __generator(this, function (_a) {
|
|
4904
4904
|
switch (_a.label) {
|
|
4905
|
-
case 0: return [4 /*yield*/, (0,
|
|
4906
|
-
case 1:
|
|
4907
|
-
allEnvAndcomponents = _a.sent();
|
|
4908
|
-
return [2 /*return*/, allEnvAndcomponents.reduce(function (acc, _a) {
|
|
4909
|
-
var env = _a.env, componentName = _a.componentName;
|
|
4910
|
-
return __spreadArray(__spreadArray([], acc, true), [env + ":" + componentName], false);
|
|
4911
|
-
}, [])];
|
|
4912
|
-
}
|
|
4913
|
-
});
|
|
4914
|
-
}); };
|
|
4915
|
-
exports.envAndComponents = envAndComponents;
|
|
4916
|
-
var allEnvsAndAllComponents = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
4917
|
-
var _a, _b;
|
|
4918
|
-
return __generator(this, function (_c) {
|
|
4919
|
-
switch (_c.label) {
|
|
4920
|
-
case 0:
|
|
4921
|
-
_a = [[]];
|
|
4922
|
-
return [4 /*yield*/, (0, exports.allEnvs)()];
|
|
4905
|
+
case 0: return [4 /*yield*/, (0, gitlab_1.getProjectInfo)(instance)];
|
|
4923
4906
|
case 1:
|
|
4924
|
-
|
|
4925
|
-
return [4 /*yield*/, (0,
|
|
4926
|
-
case 2:
|
|
4907
|
+
projectId = (_a.sent()).id;
|
|
4908
|
+
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId))];
|
|
4909
|
+
case 2:
|
|
4910
|
+
topics = (_a.sent()).topics;
|
|
4911
|
+
return [4 /*yield*/, (0, gitlab_1.doGitlabRequest)(instance, "projects/".concat(projectId), { topics: __spreadArray([catladderTopic], topics, true) }, "PUT")];
|
|
4912
|
+
case 3:
|
|
4913
|
+
_a.sent();
|
|
4914
|
+
return [2 /*return*/];
|
|
4927
4915
|
}
|
|
4928
4916
|
});
|
|
4929
4917
|
}); };
|
|
4930
|
-
exports.
|
|
4931
|
-
//# sourceMappingURL=
|
|
4918
|
+
exports.setupTopic = setupTopic;
|
|
4919
|
+
//# sourceMappingURL=setupTopic.js.map
|
|
4932
4920
|
|
|
4933
4921
|
/***/ }),
|
|
4934
4922
|
|
|
4935
|
-
/***/
|
|
4923
|
+
/***/ 41373:
|
|
4936
4924
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
4937
4925
|
|
|
4938
4926
|
"use strict";
|
|
@@ -4973,168 +4961,271 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
4973
4961
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
4974
4962
|
}
|
|
4975
4963
|
};
|
|
4964
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
4965
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4966
|
+
if (ar || !(i in from)) {
|
|
4967
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
4968
|
+
ar[i] = from[i];
|
|
4969
|
+
}
|
|
4970
|
+
}
|
|
4971
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
4972
|
+
};
|
|
4976
4973
|
exports.__esModule = true;
|
|
4974
|
+
exports.allEnvsAndAllComponents = exports.envAndComponents = exports.allEnvs = void 0;
|
|
4977
4975
|
var pipeline_1 = __nccwpck_require__(25355);
|
|
4978
4976
|
var getProjectConfig_1 = __nccwpck_require__(24146);
|
|
4979
|
-
var
|
|
4980
|
-
|
|
4981
|
-
return
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
return [
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
throw new Error("can't ensure cluster for non-kubernetes deployments");
|
|
4992
|
-
}
|
|
4993
|
-
cluster = (0, pipeline_1.getFullKubernetesClusterName)(context.componentConfig.deploy.cluster);
|
|
4994
|
-
return [4 /*yield*/, (0, cluster_1.getCurrentConnectedClusterName)()];
|
|
4995
|
-
case 2:
|
|
4996
|
-
connectedClusterName = _b.sent();
|
|
4997
|
-
if (!(cluster !== connectedClusterName)) return [3 /*break*/, 6];
|
|
4998
|
-
this.log("you are currently connected to cluster '".concat(connectedClusterName, "'"));
|
|
4999
|
-
this.log("but the project requires cluster '".concat(cluster, "'"));
|
|
5000
|
-
return [4 /*yield*/, this.prompt({
|
|
5001
|
-
type: "confirm",
|
|
5002
|
-
name: "shouldContinue",
|
|
5003
|
-
"default": true,
|
|
5004
|
-
message: "Do you want to connect to '".concat(cluster, "'?")
|
|
5005
|
-
})];
|
|
5006
|
-
case 3:
|
|
5007
|
-
shouldContinue = (_b.sent()).shouldContinue;
|
|
5008
|
-
if (!!shouldContinue) return [3 /*break*/, 4];
|
|
5009
|
-
this.log("abort");
|
|
5010
|
-
return [3 /*break*/, 6];
|
|
5011
|
-
case 4: return [4 /*yield*/, (0, cluster_1.connectToCluster)(cluster)];
|
|
5012
|
-
case 5:
|
|
5013
|
-
_b.sent();
|
|
5014
|
-
this.log("connected to cluster '".concat(cluster, "'"));
|
|
5015
|
-
_b.label = 6;
|
|
5016
|
-
case 6: return [2 /*return*/];
|
|
5017
|
-
}
|
|
5018
|
-
});
|
|
4977
|
+
var allEnvs = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
4978
|
+
var config;
|
|
4979
|
+
return __generator(this, function (_a) {
|
|
4980
|
+
switch (_a.label) {
|
|
4981
|
+
case 0: return [4 /*yield*/, (0, getProjectConfig_1.getProjectConfig)()];
|
|
4982
|
+
case 1:
|
|
4983
|
+
config = _a.sent();
|
|
4984
|
+
if (!config) {
|
|
4985
|
+
return [2 /*return*/, []];
|
|
4986
|
+
}
|
|
4987
|
+
return [2 /*return*/, (0, pipeline_1.getAllEnvsInAllComponents)(config)];
|
|
4988
|
+
}
|
|
5019
4989
|
});
|
|
5020
|
-
}
|
|
5021
|
-
exports
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5034
|
-
s = arguments[i];
|
|
5035
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
5036
|
-
t[p] = s[p];
|
|
4990
|
+
}); };
|
|
4991
|
+
exports.allEnvs = allEnvs;
|
|
4992
|
+
var envAndComponents = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
4993
|
+
var allEnvAndcomponents;
|
|
4994
|
+
return __generator(this, function (_a) {
|
|
4995
|
+
switch (_a.label) {
|
|
4996
|
+
case 0: return [4 /*yield*/, (0, getProjectConfig_1.getAllComponentsWithAllEnvsFlat)()];
|
|
4997
|
+
case 1:
|
|
4998
|
+
allEnvAndcomponents = _a.sent();
|
|
4999
|
+
return [2 /*return*/, allEnvAndcomponents.reduce(function (acc, _a) {
|
|
5000
|
+
var env = _a.env, componentName = _a.componentName;
|
|
5001
|
+
return __spreadArray(__spreadArray([], acc, true), [env + ":" + componentName], false);
|
|
5002
|
+
}, [])];
|
|
5037
5003
|
}
|
|
5038
|
-
return t;
|
|
5039
|
-
};
|
|
5040
|
-
return __assign.apply(this, arguments);
|
|
5041
|
-
};
|
|
5042
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5043
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5044
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5045
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5046
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5047
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
5048
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5049
5004
|
});
|
|
5050
|
-
};
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
5065
|
-
default:
|
|
5066
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
5067
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
5068
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
5069
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
5070
|
-
if (t[2]) _.ops.pop();
|
|
5071
|
-
_.trys.pop(); continue;
|
|
5072
|
-
}
|
|
5073
|
-
op = body.call(thisArg, _);
|
|
5074
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
5075
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
5076
|
-
}
|
|
5077
|
-
};
|
|
5078
|
-
exports.__esModule = true;
|
|
5079
|
-
var pipeline_1 = __nccwpck_require__(25355);
|
|
5080
|
-
var client_node_1 = __nccwpck_require__(15124);
|
|
5081
|
-
var k8sApi_1 = __nccwpck_require__(54756);
|
|
5082
|
-
function default_1(context) {
|
|
5083
|
-
var _a, _b, _c, _d, _e;
|
|
5084
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5085
|
-
var namespace, namespaceBody, metadata, k8sApi, e_1;
|
|
5086
|
-
return __generator(this, function (_f) {
|
|
5087
|
-
switch (_f.label) {
|
|
5088
|
-
case 0:
|
|
5089
|
-
namespace = (0, pipeline_1.getKubernetesNamespace)(context.fullConfig, context.environment.shortName);
|
|
5090
|
-
namespaceBody = new client_node_1.V1Namespace();
|
|
5091
|
-
metadata = {
|
|
5092
|
-
name: namespace,
|
|
5093
|
-
labels: __assign(__assign({ customerName: context.fullConfig.customerName, appName: context.fullConfig.appName, environment: context.environment.shortName, components: Object.keys(context.fullConfig.components).join("_"), buildTypes: Object.values(context.fullConfig.components)
|
|
5094
|
-
.map(function (config) { return config.build.type; })
|
|
5095
|
-
.join("_") }, Object.fromEntries(Object.entries(context.fullConfig.components).map(function (_a) {
|
|
5096
|
-
var componentName = _a[0], config = _a[1];
|
|
5097
|
-
return [
|
|
5098
|
-
"buildType_" + componentName,
|
|
5099
|
-
config.build.type,
|
|
5100
|
-
];
|
|
5101
|
-
}))), ((_b = (_a = context.fullConfig.meta) === null || _a === void 0 ? void 0 : _a.labels) !== null && _b !== void 0 ? _b : {}))
|
|
5102
|
-
};
|
|
5103
|
-
namespaceBody.metadata = metadata;
|
|
5104
|
-
k8sApi = (0, k8sApi_1.getk8sApi)();
|
|
5105
|
-
_f.label = 1;
|
|
5106
|
-
case 1:
|
|
5107
|
-
_f.trys.push([1, 4, , 8]);
|
|
5108
|
-
return [4 /*yield*/, k8sApi.readNamespace(namespace)];
|
|
5109
|
-
case 2:
|
|
5110
|
-
_f.sent();
|
|
5111
|
-
return [4 /*yield*/, k8sApi.patchNamespace(namespace, namespaceBody, undefined, undefined, undefined, undefined, { headers: { "content-type": "application/merge-patch+json" } } // see https://github.com/kubernetes-client/javascript/issues/443
|
|
5112
|
-
)];
|
|
5113
|
-
case 3:
|
|
5114
|
-
_f.sent(); // update meta data
|
|
5115
|
-
return [3 /*break*/, 8];
|
|
5116
|
-
case 4:
|
|
5117
|
-
e_1 = _f.sent();
|
|
5118
|
-
if (!(((_d = (_c = e_1.response) === null || _c === void 0 ? void 0 : _c.body) === null || _d === void 0 ? void 0 : _d.reason) === "NotFound")) return [3 /*break*/, 6];
|
|
5119
|
-
return [4 /*yield*/, k8sApi.createNamespace(namespaceBody)];
|
|
5120
|
-
case 5:
|
|
5121
|
-
_f.sent();
|
|
5122
|
-
return [3 /*break*/, 7];
|
|
5123
|
-
case 6:
|
|
5124
|
-
console.error((_e = e_1.response) === null || _e === void 0 ? void 0 : _e.body);
|
|
5125
|
-
throw e_1;
|
|
5126
|
-
case 7: return [3 /*break*/, 8];
|
|
5127
|
-
case 8: return [2 /*return*/, namespace];
|
|
5128
|
-
}
|
|
5129
|
-
});
|
|
5005
|
+
}); };
|
|
5006
|
+
exports.envAndComponents = envAndComponents;
|
|
5007
|
+
var allEnvsAndAllComponents = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
5008
|
+
var _a, _b;
|
|
5009
|
+
return __generator(this, function (_c) {
|
|
5010
|
+
switch (_c.label) {
|
|
5011
|
+
case 0:
|
|
5012
|
+
_a = [[]];
|
|
5013
|
+
return [4 /*yield*/, (0, exports.allEnvs)()];
|
|
5014
|
+
case 1:
|
|
5015
|
+
_b = [__spreadArray.apply(void 0, _a.concat([(_c.sent()), true]))];
|
|
5016
|
+
return [4 /*yield*/, (0, exports.envAndComponents)()];
|
|
5017
|
+
case 2: return [2 /*return*/, __spreadArray.apply(void 0, _b.concat([(_c.sent()), true]))];
|
|
5018
|
+
}
|
|
5130
5019
|
});
|
|
5131
|
-
}
|
|
5132
|
-
exports
|
|
5133
|
-
//# sourceMappingURL=
|
|
5020
|
+
}); };
|
|
5021
|
+
exports.allEnvsAndAllComponents = allEnvsAndAllComponents;
|
|
5022
|
+
//# sourceMappingURL=autocompletions.js.map
|
|
5134
5023
|
|
|
5135
5024
|
/***/ }),
|
|
5136
5025
|
|
|
5137
|
-
/***/
|
|
5026
|
+
/***/ 8722:
|
|
5027
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
5028
|
+
|
|
5029
|
+
"use strict";
|
|
5030
|
+
|
|
5031
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5032
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5033
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5034
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5035
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5036
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
5037
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5038
|
+
});
|
|
5039
|
+
};
|
|
5040
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
5041
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
5042
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5043
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
5044
|
+
function step(op) {
|
|
5045
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
5046
|
+
while (_) try {
|
|
5047
|
+
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;
|
|
5048
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
5049
|
+
switch (op[0]) {
|
|
5050
|
+
case 0: case 1: t = op; break;
|
|
5051
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
5052
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
5053
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
5054
|
+
default:
|
|
5055
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
5056
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
5057
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
5058
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
5059
|
+
if (t[2]) _.ops.pop();
|
|
5060
|
+
_.trys.pop(); continue;
|
|
5061
|
+
}
|
|
5062
|
+
op = body.call(thisArg, _);
|
|
5063
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
5064
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
5065
|
+
}
|
|
5066
|
+
};
|
|
5067
|
+
exports.__esModule = true;
|
|
5068
|
+
var pipeline_1 = __nccwpck_require__(25355);
|
|
5069
|
+
var getProjectConfig_1 = __nccwpck_require__(24146);
|
|
5070
|
+
var cluster_1 = __nccwpck_require__(66894);
|
|
5071
|
+
function default_1(envComponent) {
|
|
5072
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5073
|
+
var _a, env, componentName, context, cluster, connectedClusterName, shouldContinue;
|
|
5074
|
+
return __generator(this, function (_b) {
|
|
5075
|
+
switch (_b.label) {
|
|
5076
|
+
case 0:
|
|
5077
|
+
_a = (0, getProjectConfig_1.parseChoice)(envComponent), env = _a.env, componentName = _a.componentName;
|
|
5078
|
+
return [4 /*yield*/, (0, getProjectConfig_1.getPipelineContextByChoice)(env, componentName)];
|
|
5079
|
+
case 1:
|
|
5080
|
+
context = _b.sent();
|
|
5081
|
+
if (!(0, pipeline_1.isOfDeployType)(context.componentConfig.deploy, "kubernetes")) {
|
|
5082
|
+
throw new Error("can't ensure cluster for non-kubernetes deployments");
|
|
5083
|
+
}
|
|
5084
|
+
cluster = (0, pipeline_1.getFullKubernetesClusterName)(context.componentConfig.deploy.cluster);
|
|
5085
|
+
return [4 /*yield*/, (0, cluster_1.getCurrentConnectedClusterName)()];
|
|
5086
|
+
case 2:
|
|
5087
|
+
connectedClusterName = _b.sent();
|
|
5088
|
+
if (!(cluster !== connectedClusterName)) return [3 /*break*/, 6];
|
|
5089
|
+
this.log("you are currently connected to cluster '".concat(connectedClusterName, "'"));
|
|
5090
|
+
this.log("but the project requires cluster '".concat(cluster, "'"));
|
|
5091
|
+
return [4 /*yield*/, this.prompt({
|
|
5092
|
+
type: "confirm",
|
|
5093
|
+
name: "shouldContinue",
|
|
5094
|
+
"default": true,
|
|
5095
|
+
message: "Do you want to connect to '".concat(cluster, "'?")
|
|
5096
|
+
})];
|
|
5097
|
+
case 3:
|
|
5098
|
+
shouldContinue = (_b.sent()).shouldContinue;
|
|
5099
|
+
if (!!shouldContinue) return [3 /*break*/, 4];
|
|
5100
|
+
this.log("abort");
|
|
5101
|
+
return [3 /*break*/, 6];
|
|
5102
|
+
case 4: return [4 /*yield*/, (0, cluster_1.connectToCluster)(cluster)];
|
|
5103
|
+
case 5:
|
|
5104
|
+
_b.sent();
|
|
5105
|
+
this.log("connected to cluster '".concat(cluster, "'"));
|
|
5106
|
+
_b.label = 6;
|
|
5107
|
+
case 6: return [2 /*return*/];
|
|
5108
|
+
}
|
|
5109
|
+
});
|
|
5110
|
+
});
|
|
5111
|
+
}
|
|
5112
|
+
exports["default"] = default_1;
|
|
5113
|
+
//# sourceMappingURL=ensureCluster.js.map
|
|
5114
|
+
|
|
5115
|
+
/***/ }),
|
|
5116
|
+
|
|
5117
|
+
/***/ 99489:
|
|
5118
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
5119
|
+
|
|
5120
|
+
"use strict";
|
|
5121
|
+
|
|
5122
|
+
var __assign = (this && this.__assign) || function () {
|
|
5123
|
+
__assign = Object.assign || function(t) {
|
|
5124
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5125
|
+
s = arguments[i];
|
|
5126
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
5127
|
+
t[p] = s[p];
|
|
5128
|
+
}
|
|
5129
|
+
return t;
|
|
5130
|
+
};
|
|
5131
|
+
return __assign.apply(this, arguments);
|
|
5132
|
+
};
|
|
5133
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5134
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5135
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5136
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5137
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
5138
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
5139
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5140
|
+
});
|
|
5141
|
+
};
|
|
5142
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
5143
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
5144
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5145
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
5146
|
+
function step(op) {
|
|
5147
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
5148
|
+
while (_) try {
|
|
5149
|
+
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;
|
|
5150
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
5151
|
+
switch (op[0]) {
|
|
5152
|
+
case 0: case 1: t = op; break;
|
|
5153
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
5154
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
5155
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
5156
|
+
default:
|
|
5157
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
5158
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
5159
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
5160
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
5161
|
+
if (t[2]) _.ops.pop();
|
|
5162
|
+
_.trys.pop(); continue;
|
|
5163
|
+
}
|
|
5164
|
+
op = body.call(thisArg, _);
|
|
5165
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
5166
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
5167
|
+
}
|
|
5168
|
+
};
|
|
5169
|
+
exports.__esModule = true;
|
|
5170
|
+
var pipeline_1 = __nccwpck_require__(25355);
|
|
5171
|
+
var client_node_1 = __nccwpck_require__(15124);
|
|
5172
|
+
var k8sApi_1 = __nccwpck_require__(54756);
|
|
5173
|
+
function default_1(context) {
|
|
5174
|
+
var _a, _b, _c, _d, _e;
|
|
5175
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5176
|
+
var namespace, namespaceBody, metadata, k8sApi, e_1;
|
|
5177
|
+
return __generator(this, function (_f) {
|
|
5178
|
+
switch (_f.label) {
|
|
5179
|
+
case 0:
|
|
5180
|
+
namespace = (0, pipeline_1.getKubernetesNamespace)(context.fullConfig, context.environment.shortName);
|
|
5181
|
+
namespaceBody = new client_node_1.V1Namespace();
|
|
5182
|
+
metadata = {
|
|
5183
|
+
name: namespace,
|
|
5184
|
+
labels: __assign(__assign({ customerName: context.fullConfig.customerName, appName: context.fullConfig.appName, environment: context.environment.shortName, components: Object.keys(context.fullConfig.components).join("_"), buildTypes: Object.values(context.fullConfig.components)
|
|
5185
|
+
.map(function (config) { return config.build.type; })
|
|
5186
|
+
.join("_") }, Object.fromEntries(Object.entries(context.fullConfig.components).map(function (_a) {
|
|
5187
|
+
var componentName = _a[0], config = _a[1];
|
|
5188
|
+
return [
|
|
5189
|
+
"buildType_" + componentName,
|
|
5190
|
+
config.build.type,
|
|
5191
|
+
];
|
|
5192
|
+
}))), ((_b = (_a = context.fullConfig.meta) === null || _a === void 0 ? void 0 : _a.labels) !== null && _b !== void 0 ? _b : {}))
|
|
5193
|
+
};
|
|
5194
|
+
namespaceBody.metadata = metadata;
|
|
5195
|
+
k8sApi = (0, k8sApi_1.getk8sApi)();
|
|
5196
|
+
_f.label = 1;
|
|
5197
|
+
case 1:
|
|
5198
|
+
_f.trys.push([1, 4, , 8]);
|
|
5199
|
+
return [4 /*yield*/, k8sApi.readNamespace(namespace)];
|
|
5200
|
+
case 2:
|
|
5201
|
+
_f.sent();
|
|
5202
|
+
return [4 /*yield*/, k8sApi.patchNamespace(namespace, namespaceBody, undefined, undefined, undefined, undefined, { headers: { "content-type": "application/merge-patch+json" } } // see https://github.com/kubernetes-client/javascript/issues/443
|
|
5203
|
+
)];
|
|
5204
|
+
case 3:
|
|
5205
|
+
_f.sent(); // update meta data
|
|
5206
|
+
return [3 /*break*/, 8];
|
|
5207
|
+
case 4:
|
|
5208
|
+
e_1 = _f.sent();
|
|
5209
|
+
if (!(((_d = (_c = e_1.response) === null || _c === void 0 ? void 0 : _c.body) === null || _d === void 0 ? void 0 : _d.reason) === "NotFound")) return [3 /*break*/, 6];
|
|
5210
|
+
return [4 /*yield*/, k8sApi.createNamespace(namespaceBody)];
|
|
5211
|
+
case 5:
|
|
5212
|
+
_f.sent();
|
|
5213
|
+
return [3 /*break*/, 7];
|
|
5214
|
+
case 6:
|
|
5215
|
+
console.error((_e = e_1.response) === null || _e === void 0 ? void 0 : _e.body);
|
|
5216
|
+
throw e_1;
|
|
5217
|
+
case 7: return [3 /*break*/, 8];
|
|
5218
|
+
case 8: return [2 /*return*/, namespace];
|
|
5219
|
+
}
|
|
5220
|
+
});
|
|
5221
|
+
});
|
|
5222
|
+
}
|
|
5223
|
+
exports["default"] = default_1;
|
|
5224
|
+
//# sourceMappingURL=ensureNamespace.js.map
|
|
5225
|
+
|
|
5226
|
+
/***/ }),
|
|
5227
|
+
|
|
5228
|
+
/***/ 43605:
|
|
5138
5229
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
5139
5230
|
|
|
5140
5231
|
"use strict";
|
|
@@ -6025,7 +6116,9 @@ var migrateSecrets = function (vorpal, newConfig, oldEnv) { return __awaiter(voi
|
|
|
6025
6116
|
case 0: return [4 /*yield*/, (0, pipeline_1.getEnvironment)(newConfig, componentName, newEnv)];
|
|
6026
6117
|
case 1:
|
|
6027
6118
|
environment = _a.sent();
|
|
6028
|
-
return [4 /*yield*/, (0, gitlab_1.upsertAllVariables)(vorpal, (0, lodash_1.pick)(secrets_1, environment.secretEnvVarKeys
|
|
6119
|
+
return [4 /*yield*/, (0, gitlab_1.upsertAllVariables)(vorpal, (0, lodash_1.pick)(secrets_1, environment.secretEnvVarKeys
|
|
6120
|
+
.filter(function (k) { return !k.hidden; })
|
|
6121
|
+
.map(function (k) { return k.key; })), newEnv, componentName)];
|
|
6029
6122
|
case 2:
|
|
6030
6123
|
_a.sent();
|
|
6031
6124
|
return [2 /*return*/];
|
|
@@ -130122,7 +130215,7 @@ module.exports = (stack, options) => {
|
|
|
130122
130215
|
|
|
130123
130216
|
"use strict";
|
|
130124
130217
|
|
|
130125
|
-
var restoreCursor = __nccwpck_require__(
|
|
130218
|
+
var restoreCursor = __nccwpck_require__(17301);
|
|
130126
130219
|
var hidden = false;
|
|
130127
130220
|
|
|
130128
130221
|
exports.show = function () {
|
|
@@ -130149,6 +130242,62 @@ exports.toggle = function (force) {
|
|
|
130149
130242
|
};
|
|
130150
130243
|
|
|
130151
130244
|
|
|
130245
|
+
/***/ }),
|
|
130246
|
+
|
|
130247
|
+
/***/ 17677:
|
|
130248
|
+
/***/ ((module) => {
|
|
130249
|
+
|
|
130250
|
+
"use strict";
|
|
130251
|
+
|
|
130252
|
+
module.exports = function (fn, errMsg) {
|
|
130253
|
+
if (typeof fn !== 'function') {
|
|
130254
|
+
throw new TypeError('Expected a function');
|
|
130255
|
+
}
|
|
130256
|
+
|
|
130257
|
+
var ret;
|
|
130258
|
+
var called = false;
|
|
130259
|
+
var fnName = fn.displayName || fn.name || (/function ([^\(]+)/.exec(fn.toString()) || [])[1];
|
|
130260
|
+
|
|
130261
|
+
var onetime = function () {
|
|
130262
|
+
if (called) {
|
|
130263
|
+
if (errMsg === true) {
|
|
130264
|
+
fnName = fnName ? fnName + '()' : 'Function';
|
|
130265
|
+
throw new Error(fnName + ' can only be called once.');
|
|
130266
|
+
}
|
|
130267
|
+
|
|
130268
|
+
return ret;
|
|
130269
|
+
}
|
|
130270
|
+
|
|
130271
|
+
called = true;
|
|
130272
|
+
ret = fn.apply(this, arguments);
|
|
130273
|
+
fn = null;
|
|
130274
|
+
|
|
130275
|
+
return ret;
|
|
130276
|
+
};
|
|
130277
|
+
|
|
130278
|
+
onetime.displayName = fnName;
|
|
130279
|
+
|
|
130280
|
+
return onetime;
|
|
130281
|
+
};
|
|
130282
|
+
|
|
130283
|
+
|
|
130284
|
+
/***/ }),
|
|
130285
|
+
|
|
130286
|
+
/***/ 17301:
|
|
130287
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
130288
|
+
|
|
130289
|
+
"use strict";
|
|
130290
|
+
|
|
130291
|
+
var onetime = __nccwpck_require__(17677);
|
|
130292
|
+
var exitHook = __nccwpck_require__(24793);
|
|
130293
|
+
|
|
130294
|
+
module.exports = onetime(function () {
|
|
130295
|
+
exitHook(function () {
|
|
130296
|
+
process.stdout.write('\u001b[?25h');
|
|
130297
|
+
});
|
|
130298
|
+
});
|
|
130299
|
+
|
|
130300
|
+
|
|
130152
130301
|
/***/ }),
|
|
130153
130302
|
|
|
130154
130303
|
/***/ 89992:
|
|
@@ -178742,60 +178891,6 @@ module.exports = () => {
|
|
|
178742
178891
|
};
|
|
178743
178892
|
|
|
178744
178893
|
|
|
178745
|
-
/***/ }),
|
|
178746
|
-
|
|
178747
|
-
/***/ 48504:
|
|
178748
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
178749
|
-
|
|
178750
|
-
"use strict";
|
|
178751
|
-
|
|
178752
|
-
var numberIsNan = __nccwpck_require__(68955);
|
|
178753
|
-
|
|
178754
|
-
module.exports = function (x) {
|
|
178755
|
-
if (numberIsNan(x)) {
|
|
178756
|
-
return false;
|
|
178757
|
-
}
|
|
178758
|
-
|
|
178759
|
-
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
|
|
178760
|
-
|
|
178761
|
-
// code points are derived from:
|
|
178762
|
-
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
|
178763
|
-
if (x >= 0x1100 && (
|
|
178764
|
-
x <= 0x115f || // Hangul Jamo
|
|
178765
|
-
0x2329 === x || // LEFT-POINTING ANGLE BRACKET
|
|
178766
|
-
0x232a === x || // RIGHT-POINTING ANGLE BRACKET
|
|
178767
|
-
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
178768
|
-
(0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
|
|
178769
|
-
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
178770
|
-
0x3250 <= x && x <= 0x4dbf ||
|
|
178771
|
-
// CJK Unified Ideographs .. Yi Radicals
|
|
178772
|
-
0x4e00 <= x && x <= 0xa4c6 ||
|
|
178773
|
-
// Hangul Jamo Extended-A
|
|
178774
|
-
0xa960 <= x && x <= 0xa97c ||
|
|
178775
|
-
// Hangul Syllables
|
|
178776
|
-
0xac00 <= x && x <= 0xd7a3 ||
|
|
178777
|
-
// CJK Compatibility Ideographs
|
|
178778
|
-
0xf900 <= x && x <= 0xfaff ||
|
|
178779
|
-
// Vertical Forms
|
|
178780
|
-
0xfe10 <= x && x <= 0xfe19 ||
|
|
178781
|
-
// CJK Compatibility Forms .. Small Form Variants
|
|
178782
|
-
0xfe30 <= x && x <= 0xfe6b ||
|
|
178783
|
-
// Halfwidth and Fullwidth Forms
|
|
178784
|
-
0xff01 <= x && x <= 0xff60 ||
|
|
178785
|
-
0xffe0 <= x && x <= 0xffe6 ||
|
|
178786
|
-
// Kana Supplement
|
|
178787
|
-
0x1b000 <= x && x <= 0x1b001 ||
|
|
178788
|
-
// Enclosed Ideographic Supplement
|
|
178789
|
-
0x1f200 <= x && x <= 0x1f251 ||
|
|
178790
|
-
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
178791
|
-
0x20000 <= x && x <= 0x3fffd)) {
|
|
178792
|
-
return true;
|
|
178793
|
-
}
|
|
178794
|
-
|
|
178795
|
-
return false;
|
|
178796
|
-
}
|
|
178797
|
-
|
|
178798
|
-
|
|
178799
178894
|
/***/ }),
|
|
178800
178895
|
|
|
178801
178896
|
/***/ 86878:
|
|
@@ -210081,158 +210176,6 @@ module.exports = Keyv;
|
|
|
210081
210176
|
}.call(this));
|
|
210082
210177
|
|
|
210083
210178
|
|
|
210084
|
-
/***/ }),
|
|
210085
|
-
|
|
210086
|
-
/***/ 12860:
|
|
210087
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
210088
|
-
|
|
210089
|
-
"use strict";
|
|
210090
|
-
|
|
210091
|
-
var ansiEscapes = __nccwpck_require__(11598);
|
|
210092
|
-
var cliCursor = __nccwpck_require__(22701);
|
|
210093
|
-
|
|
210094
|
-
function main(stream) {
|
|
210095
|
-
var prevLineCount = 0;
|
|
210096
|
-
|
|
210097
|
-
var render = function () {
|
|
210098
|
-
cliCursor.hide();
|
|
210099
|
-
var out = [].join.call(arguments, ' ') + '\n';
|
|
210100
|
-
stream.write(ansiEscapes.eraseLines(prevLineCount) + out);
|
|
210101
|
-
prevLineCount = out.split('\n').length;
|
|
210102
|
-
};
|
|
210103
|
-
|
|
210104
|
-
render.clear = function () {
|
|
210105
|
-
stream.write(ansiEscapes.eraseLines(prevLineCount));
|
|
210106
|
-
prevLineCount = 0;
|
|
210107
|
-
};
|
|
210108
|
-
|
|
210109
|
-
render.done = function () {
|
|
210110
|
-
prevLineCount = 0;
|
|
210111
|
-
cliCursor.show();
|
|
210112
|
-
};
|
|
210113
|
-
|
|
210114
|
-
return render;
|
|
210115
|
-
}
|
|
210116
|
-
|
|
210117
|
-
module.exports = main(process.stdout);
|
|
210118
|
-
module.exports.stderr = main(process.stderr);
|
|
210119
|
-
module.exports.create = main;
|
|
210120
|
-
|
|
210121
|
-
|
|
210122
|
-
/***/ }),
|
|
210123
|
-
|
|
210124
|
-
/***/ 11598:
|
|
210125
|
-
/***/ ((module) => {
|
|
210126
|
-
|
|
210127
|
-
"use strict";
|
|
210128
|
-
|
|
210129
|
-
var ESC = '\u001b[';
|
|
210130
|
-
var x = module.exports;
|
|
210131
|
-
|
|
210132
|
-
x.cursorTo = function (x, y) {
|
|
210133
|
-
if (arguments.length === 0) {
|
|
210134
|
-
return ESC + 'H';
|
|
210135
|
-
}
|
|
210136
|
-
|
|
210137
|
-
if (arguments.length === 1) {
|
|
210138
|
-
return ESC + (x + 1) + 'G';
|
|
210139
|
-
}
|
|
210140
|
-
|
|
210141
|
-
return ESC + (y + 1) + ';' + (x + 1) + 'H';
|
|
210142
|
-
};
|
|
210143
|
-
|
|
210144
|
-
x.cursorMove = function (x, y) {
|
|
210145
|
-
var ret = '';
|
|
210146
|
-
|
|
210147
|
-
if (x < 0) {
|
|
210148
|
-
ret += ESC + (-x) + 'D';
|
|
210149
|
-
} else if (x > 0) {
|
|
210150
|
-
ret += ESC + x + 'C';
|
|
210151
|
-
}
|
|
210152
|
-
|
|
210153
|
-
if (y < 0) {
|
|
210154
|
-
ret += ESC + (-y) + 'A';
|
|
210155
|
-
} else if (y > 0) {
|
|
210156
|
-
ret += ESC + y + 'B';
|
|
210157
|
-
}
|
|
210158
|
-
|
|
210159
|
-
return ret;
|
|
210160
|
-
};
|
|
210161
|
-
|
|
210162
|
-
x.cursorUp = function (count) {
|
|
210163
|
-
return ESC + (typeof count === 'number' ? count : 1) + 'A';
|
|
210164
|
-
};
|
|
210165
|
-
|
|
210166
|
-
x.cursorDown = function (count) {
|
|
210167
|
-
return ESC + (typeof count === 'number' ? count : 1) + 'B';
|
|
210168
|
-
};
|
|
210169
|
-
|
|
210170
|
-
x.cursorForward = function (count) {
|
|
210171
|
-
return ESC + (typeof count === 'number' ? count : 1) + 'C';
|
|
210172
|
-
};
|
|
210173
|
-
|
|
210174
|
-
x.cursorBackward = function (count) {
|
|
210175
|
-
return ESC + (typeof count === 'number' ? count : 1) + 'D';
|
|
210176
|
-
};
|
|
210177
|
-
|
|
210178
|
-
x.cursorLeft = ESC + '1000D';
|
|
210179
|
-
x.cursorSavePosition = ESC + 's';
|
|
210180
|
-
x.cursorRestorePosition = ESC + 'u';
|
|
210181
|
-
x.cursorGetPosition = ESC + '6n';
|
|
210182
|
-
x.cursorNextLine = ESC + 'E';
|
|
210183
|
-
x.cursorPrevLine = ESC + 'F';
|
|
210184
|
-
x.cursorHide = ESC + '?25l';
|
|
210185
|
-
x.cursorShow = ESC + '?25h';
|
|
210186
|
-
|
|
210187
|
-
x.eraseLines = function (count) {
|
|
210188
|
-
var clear = '';
|
|
210189
|
-
|
|
210190
|
-
for (var i = 0; i < count; i++) {
|
|
210191
|
-
clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : '');
|
|
210192
|
-
}
|
|
210193
|
-
|
|
210194
|
-
return clear;
|
|
210195
|
-
};
|
|
210196
|
-
|
|
210197
|
-
x.eraseEndLine = ESC + 'K';
|
|
210198
|
-
x.eraseStartLine = ESC + '1K';
|
|
210199
|
-
x.eraseLine = ESC + '2K';
|
|
210200
|
-
x.eraseDown = ESC + 'J';
|
|
210201
|
-
x.eraseUp = ESC + '1J';
|
|
210202
|
-
x.eraseScreen = ESC + '2J';
|
|
210203
|
-
x.scrollUp = ESC + 'S';
|
|
210204
|
-
x.scrollDown = ESC + 'T';
|
|
210205
|
-
|
|
210206
|
-
x.clearScreen = '\u001bc';
|
|
210207
|
-
x.beep = '\u0007';
|
|
210208
|
-
|
|
210209
|
-
x.image = function (buf, opts) {
|
|
210210
|
-
opts = opts || {};
|
|
210211
|
-
|
|
210212
|
-
var ret = '\u001b]1337;File=inline=1';
|
|
210213
|
-
|
|
210214
|
-
if (opts.width) {
|
|
210215
|
-
ret += ';width=' + opts.width;
|
|
210216
|
-
}
|
|
210217
|
-
|
|
210218
|
-
if (opts.height) {
|
|
210219
|
-
ret += ';height=' + opts.height;
|
|
210220
|
-
}
|
|
210221
|
-
|
|
210222
|
-
if (opts.preserveAspectRatio === false) {
|
|
210223
|
-
ret += ';preserveAspectRatio=0';
|
|
210224
|
-
}
|
|
210225
|
-
|
|
210226
|
-
return ret + ':' + buf.toString('base64') + '\u0007';
|
|
210227
|
-
};
|
|
210228
|
-
|
|
210229
|
-
x.iTerm = {};
|
|
210230
|
-
|
|
210231
|
-
x.iTerm.setCwd = function (cwd) {
|
|
210232
|
-
return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007';
|
|
210233
|
-
};
|
|
210234
|
-
|
|
210235
|
-
|
|
210236
210179
|
/***/ }),
|
|
210237
210180
|
|
|
210238
210181
|
/***/ 64633:
|
|
@@ -212236,27 +212179,6 @@ function populateMaps (extensions, types) {
|
|
|
212236
212179
|
}
|
|
212237
212180
|
|
|
212238
212181
|
|
|
212239
|
-
/***/ }),
|
|
212240
|
-
|
|
212241
|
-
/***/ 43471:
|
|
212242
|
-
/***/ ((module) => {
|
|
212243
|
-
|
|
212244
|
-
"use strict";
|
|
212245
|
-
|
|
212246
|
-
|
|
212247
|
-
const mimicFn = (to, from) => {
|
|
212248
|
-
for (const prop of Reflect.ownKeys(from)) {
|
|
212249
|
-
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
|
|
212250
|
-
}
|
|
212251
|
-
|
|
212252
|
-
return to;
|
|
212253
|
-
};
|
|
212254
|
-
|
|
212255
|
-
module.exports = mimicFn;
|
|
212256
|
-
// TODO: Remove this for the next major release
|
|
212257
|
-
module.exports["default"] = mimicFn;
|
|
212258
|
-
|
|
212259
|
-
|
|
212260
212182
|
/***/ }),
|
|
212261
212183
|
|
|
212262
212184
|
/***/ 21963:
|
|
@@ -220390,7 +220312,7 @@ function onceStrict (fn) {
|
|
|
220390
220312
|
|
|
220391
220313
|
"use strict";
|
|
220392
220314
|
|
|
220393
|
-
const mimicFn = __nccwpck_require__(
|
|
220315
|
+
const mimicFn = __nccwpck_require__(60283);
|
|
220394
220316
|
|
|
220395
220317
|
const calledFunctions = new WeakMap();
|
|
220396
220318
|
|
|
@@ -220435,6 +220357,27 @@ module.exports.callCount = function_ => {
|
|
|
220435
220357
|
};
|
|
220436
220358
|
|
|
220437
220359
|
|
|
220360
|
+
/***/ }),
|
|
220361
|
+
|
|
220362
|
+
/***/ 60283:
|
|
220363
|
+
/***/ ((module) => {
|
|
220364
|
+
|
|
220365
|
+
"use strict";
|
|
220366
|
+
|
|
220367
|
+
|
|
220368
|
+
const mimicFn = (to, from) => {
|
|
220369
|
+
for (const prop of Reflect.ownKeys(from)) {
|
|
220370
|
+
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
|
|
220371
|
+
}
|
|
220372
|
+
|
|
220373
|
+
return to;
|
|
220374
|
+
};
|
|
220375
|
+
|
|
220376
|
+
module.exports = mimicFn;
|
|
220377
|
+
// TODO: Remove this for the next major release
|
|
220378
|
+
module.exports["default"] = mimicFn;
|
|
220379
|
+
|
|
220380
|
+
|
|
220438
220381
|
/***/ }),
|
|
220439
220382
|
|
|
220440
220383
|
/***/ 14247:
|
|
@@ -304117,7 +304060,7 @@ module.exports = QuickLRU;
|
|
|
304117
304060
|
var readline = __nccwpck_require__(14521);
|
|
304118
304061
|
var MuteStream = __nccwpck_require__(84778);
|
|
304119
304062
|
var codePointAt = __nccwpck_require__(62257);
|
|
304120
|
-
var isFullwidthCodePoint = __nccwpck_require__(
|
|
304063
|
+
var isFullwidthCodePoint = __nccwpck_require__(29535);
|
|
304121
304064
|
|
|
304122
304065
|
var Interface = module.exports = {};
|
|
304123
304066
|
|
|
@@ -304236,6 +304179,60 @@ function stripVTControlCharacters (str) {
|
|
|
304236
304179
|
}
|
|
304237
304180
|
|
|
304238
304181
|
|
|
304182
|
+
/***/ }),
|
|
304183
|
+
|
|
304184
|
+
/***/ 29535:
|
|
304185
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
304186
|
+
|
|
304187
|
+
"use strict";
|
|
304188
|
+
|
|
304189
|
+
var numberIsNan = __nccwpck_require__(68955);
|
|
304190
|
+
|
|
304191
|
+
module.exports = function (x) {
|
|
304192
|
+
if (numberIsNan(x)) {
|
|
304193
|
+
return false;
|
|
304194
|
+
}
|
|
304195
|
+
|
|
304196
|
+
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
|
|
304197
|
+
|
|
304198
|
+
// code points are derived from:
|
|
304199
|
+
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
|
304200
|
+
if (x >= 0x1100 && (
|
|
304201
|
+
x <= 0x115f || // Hangul Jamo
|
|
304202
|
+
0x2329 === x || // LEFT-POINTING ANGLE BRACKET
|
|
304203
|
+
0x232a === x || // RIGHT-POINTING ANGLE BRACKET
|
|
304204
|
+
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
304205
|
+
(0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
|
|
304206
|
+
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
304207
|
+
0x3250 <= x && x <= 0x4dbf ||
|
|
304208
|
+
// CJK Unified Ideographs .. Yi Radicals
|
|
304209
|
+
0x4e00 <= x && x <= 0xa4c6 ||
|
|
304210
|
+
// Hangul Jamo Extended-A
|
|
304211
|
+
0xa960 <= x && x <= 0xa97c ||
|
|
304212
|
+
// Hangul Syllables
|
|
304213
|
+
0xac00 <= x && x <= 0xd7a3 ||
|
|
304214
|
+
// CJK Compatibility Ideographs
|
|
304215
|
+
0xf900 <= x && x <= 0xfaff ||
|
|
304216
|
+
// Vertical Forms
|
|
304217
|
+
0xfe10 <= x && x <= 0xfe19 ||
|
|
304218
|
+
// CJK Compatibility Forms .. Small Form Variants
|
|
304219
|
+
0xfe30 <= x && x <= 0xfe6b ||
|
|
304220
|
+
// Halfwidth and Fullwidth Forms
|
|
304221
|
+
0xff01 <= x && x <= 0xff60 ||
|
|
304222
|
+
0xffe0 <= x && x <= 0xffe6 ||
|
|
304223
|
+
// Kana Supplement
|
|
304224
|
+
0x1b000 <= x && x <= 0x1b001 ||
|
|
304225
|
+
// Enclosed Ideographic Supplement
|
|
304226
|
+
0x1f200 <= x && x <= 0x1f251 ||
|
|
304227
|
+
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
304228
|
+
0x20000 <= x && x <= 0x3fffd)) {
|
|
304229
|
+
return true;
|
|
304230
|
+
}
|
|
304231
|
+
|
|
304232
|
+
return false;
|
|
304233
|
+
}
|
|
304234
|
+
|
|
304235
|
+
|
|
304239
304236
|
/***/ }),
|
|
304240
304237
|
|
|
304241
304238
|
/***/ 12757:
|
|
@@ -307905,62 +307902,6 @@ class Response extends Readable {
|
|
|
307905
307902
|
module.exports = Response;
|
|
307906
307903
|
|
|
307907
307904
|
|
|
307908
|
-
/***/ }),
|
|
307909
|
-
|
|
307910
|
-
/***/ 74390:
|
|
307911
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
307912
|
-
|
|
307913
|
-
"use strict";
|
|
307914
|
-
|
|
307915
|
-
var onetime = __nccwpck_require__(38197);
|
|
307916
|
-
var exitHook = __nccwpck_require__(24793);
|
|
307917
|
-
|
|
307918
|
-
module.exports = onetime(function () {
|
|
307919
|
-
exitHook(function () {
|
|
307920
|
-
process.stdout.write('\u001b[?25h');
|
|
307921
|
-
});
|
|
307922
|
-
});
|
|
307923
|
-
|
|
307924
|
-
|
|
307925
|
-
/***/ }),
|
|
307926
|
-
|
|
307927
|
-
/***/ 38197:
|
|
307928
|
-
/***/ ((module) => {
|
|
307929
|
-
|
|
307930
|
-
"use strict";
|
|
307931
|
-
|
|
307932
|
-
module.exports = function (fn, errMsg) {
|
|
307933
|
-
if (typeof fn !== 'function') {
|
|
307934
|
-
throw new TypeError('Expected a function');
|
|
307935
|
-
}
|
|
307936
|
-
|
|
307937
|
-
var ret;
|
|
307938
|
-
var called = false;
|
|
307939
|
-
var fnName = fn.displayName || fn.name || (/function ([^\(]+)/.exec(fn.toString()) || [])[1];
|
|
307940
|
-
|
|
307941
|
-
var onetime = function () {
|
|
307942
|
-
if (called) {
|
|
307943
|
-
if (errMsg === true) {
|
|
307944
|
-
fnName = fnName ? fnName + '()' : 'Function';
|
|
307945
|
-
throw new Error(fnName + ' can only be called once.');
|
|
307946
|
-
}
|
|
307947
|
-
|
|
307948
|
-
return ret;
|
|
307949
|
-
}
|
|
307950
|
-
|
|
307951
|
-
called = true;
|
|
307952
|
-
ret = fn.apply(this, arguments);
|
|
307953
|
-
fn = null;
|
|
307954
|
-
|
|
307955
|
-
return ret;
|
|
307956
|
-
};
|
|
307957
|
-
|
|
307958
|
-
onetime.displayName = fnName;
|
|
307959
|
-
|
|
307960
|
-
return onetime;
|
|
307961
|
-
};
|
|
307962
|
-
|
|
307963
|
-
|
|
307964
307905
|
/***/ }),
|
|
307965
307906
|
|
|
307966
307907
|
/***/ 6716:
|
|
@@ -342300,7 +342241,7 @@ var inquirer = __nccwpck_require__(8622);
|
|
|
342300
342241
|
var EventEmitter = (__nccwpck_require__(82361).EventEmitter);
|
|
342301
342242
|
var chalk = __nccwpck_require__(48173);
|
|
342302
342243
|
var util = __nccwpck_require__(29821);
|
|
342303
|
-
var logUpdate = __nccwpck_require__(
|
|
342244
|
+
var logUpdate = __nccwpck_require__(75758);
|
|
342304
342245
|
|
|
342305
342246
|
var UI = function (_EventEmitter) {
|
|
342306
342247
|
_inherits(UI, _EventEmitter);
|
|
@@ -344706,6 +344647,120 @@ Object.defineProperty(vorpal, 'activeCommand', {
|
|
|
344706
344647
|
}
|
|
344707
344648
|
});
|
|
344708
344649
|
|
|
344650
|
+
/***/ }),
|
|
344651
|
+
|
|
344652
|
+
/***/ 37374:
|
|
344653
|
+
/***/ ((module) => {
|
|
344654
|
+
|
|
344655
|
+
"use strict";
|
|
344656
|
+
|
|
344657
|
+
var ESC = '\u001b[';
|
|
344658
|
+
var x = module.exports;
|
|
344659
|
+
|
|
344660
|
+
x.cursorTo = function (x, y) {
|
|
344661
|
+
if (arguments.length === 0) {
|
|
344662
|
+
return ESC + 'H';
|
|
344663
|
+
}
|
|
344664
|
+
|
|
344665
|
+
if (arguments.length === 1) {
|
|
344666
|
+
return ESC + (x + 1) + 'G';
|
|
344667
|
+
}
|
|
344668
|
+
|
|
344669
|
+
return ESC + (y + 1) + ';' + (x + 1) + 'H';
|
|
344670
|
+
};
|
|
344671
|
+
|
|
344672
|
+
x.cursorMove = function (x, y) {
|
|
344673
|
+
var ret = '';
|
|
344674
|
+
|
|
344675
|
+
if (x < 0) {
|
|
344676
|
+
ret += ESC + (-x) + 'D';
|
|
344677
|
+
} else if (x > 0) {
|
|
344678
|
+
ret += ESC + x + 'C';
|
|
344679
|
+
}
|
|
344680
|
+
|
|
344681
|
+
if (y < 0) {
|
|
344682
|
+
ret += ESC + (-y) + 'A';
|
|
344683
|
+
} else if (y > 0) {
|
|
344684
|
+
ret += ESC + y + 'B';
|
|
344685
|
+
}
|
|
344686
|
+
|
|
344687
|
+
return ret;
|
|
344688
|
+
};
|
|
344689
|
+
|
|
344690
|
+
x.cursorUp = function (count) {
|
|
344691
|
+
return ESC + (typeof count === 'number' ? count : 1) + 'A';
|
|
344692
|
+
};
|
|
344693
|
+
|
|
344694
|
+
x.cursorDown = function (count) {
|
|
344695
|
+
return ESC + (typeof count === 'number' ? count : 1) + 'B';
|
|
344696
|
+
};
|
|
344697
|
+
|
|
344698
|
+
x.cursorForward = function (count) {
|
|
344699
|
+
return ESC + (typeof count === 'number' ? count : 1) + 'C';
|
|
344700
|
+
};
|
|
344701
|
+
|
|
344702
|
+
x.cursorBackward = function (count) {
|
|
344703
|
+
return ESC + (typeof count === 'number' ? count : 1) + 'D';
|
|
344704
|
+
};
|
|
344705
|
+
|
|
344706
|
+
x.cursorLeft = ESC + '1000D';
|
|
344707
|
+
x.cursorSavePosition = ESC + 's';
|
|
344708
|
+
x.cursorRestorePosition = ESC + 'u';
|
|
344709
|
+
x.cursorGetPosition = ESC + '6n';
|
|
344710
|
+
x.cursorNextLine = ESC + 'E';
|
|
344711
|
+
x.cursorPrevLine = ESC + 'F';
|
|
344712
|
+
x.cursorHide = ESC + '?25l';
|
|
344713
|
+
x.cursorShow = ESC + '?25h';
|
|
344714
|
+
|
|
344715
|
+
x.eraseLines = function (count) {
|
|
344716
|
+
var clear = '';
|
|
344717
|
+
|
|
344718
|
+
for (var i = 0; i < count; i++) {
|
|
344719
|
+
clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : '');
|
|
344720
|
+
}
|
|
344721
|
+
|
|
344722
|
+
return clear;
|
|
344723
|
+
};
|
|
344724
|
+
|
|
344725
|
+
x.eraseEndLine = ESC + 'K';
|
|
344726
|
+
x.eraseStartLine = ESC + '1K';
|
|
344727
|
+
x.eraseLine = ESC + '2K';
|
|
344728
|
+
x.eraseDown = ESC + 'J';
|
|
344729
|
+
x.eraseUp = ESC + '1J';
|
|
344730
|
+
x.eraseScreen = ESC + '2J';
|
|
344731
|
+
x.scrollUp = ESC + 'S';
|
|
344732
|
+
x.scrollDown = ESC + 'T';
|
|
344733
|
+
|
|
344734
|
+
x.clearScreen = '\u001bc';
|
|
344735
|
+
x.beep = '\u0007';
|
|
344736
|
+
|
|
344737
|
+
x.image = function (buf, opts) {
|
|
344738
|
+
opts = opts || {};
|
|
344739
|
+
|
|
344740
|
+
var ret = '\u001b]1337;File=inline=1';
|
|
344741
|
+
|
|
344742
|
+
if (opts.width) {
|
|
344743
|
+
ret += ';width=' + opts.width;
|
|
344744
|
+
}
|
|
344745
|
+
|
|
344746
|
+
if (opts.height) {
|
|
344747
|
+
ret += ';height=' + opts.height;
|
|
344748
|
+
}
|
|
344749
|
+
|
|
344750
|
+
if (opts.preserveAspectRatio === false) {
|
|
344751
|
+
ret += ';preserveAspectRatio=0';
|
|
344752
|
+
}
|
|
344753
|
+
|
|
344754
|
+
return ret + ':' + buf.toString('base64') + '\u0007';
|
|
344755
|
+
};
|
|
344756
|
+
|
|
344757
|
+
x.iTerm = {};
|
|
344758
|
+
|
|
344759
|
+
x.iTerm.setCwd = function (cwd) {
|
|
344760
|
+
return '\u001b]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007';
|
|
344761
|
+
};
|
|
344762
|
+
|
|
344763
|
+
|
|
344709
344764
|
/***/ }),
|
|
344710
344765
|
|
|
344711
344766
|
/***/ 96901:
|
|
@@ -344916,6 +344971,98 @@ module.exports.stripColor = stripAnsi;
|
|
|
344916
344971
|
module.exports.supportsColor = supportsColor;
|
|
344917
344972
|
|
|
344918
344973
|
|
|
344974
|
+
/***/ }),
|
|
344975
|
+
|
|
344976
|
+
/***/ 26666:
|
|
344977
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
344978
|
+
|
|
344979
|
+
"use strict";
|
|
344980
|
+
|
|
344981
|
+
var numberIsNan = __nccwpck_require__(68955);
|
|
344982
|
+
|
|
344983
|
+
module.exports = function (x) {
|
|
344984
|
+
if (numberIsNan(x)) {
|
|
344985
|
+
return false;
|
|
344986
|
+
}
|
|
344987
|
+
|
|
344988
|
+
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
|
|
344989
|
+
|
|
344990
|
+
// code points are derived from:
|
|
344991
|
+
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
|
344992
|
+
if (x >= 0x1100 && (
|
|
344993
|
+
x <= 0x115f || // Hangul Jamo
|
|
344994
|
+
0x2329 === x || // LEFT-POINTING ANGLE BRACKET
|
|
344995
|
+
0x232a === x || // RIGHT-POINTING ANGLE BRACKET
|
|
344996
|
+
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
344997
|
+
(0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
|
|
344998
|
+
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
344999
|
+
0x3250 <= x && x <= 0x4dbf ||
|
|
345000
|
+
// CJK Unified Ideographs .. Yi Radicals
|
|
345001
|
+
0x4e00 <= x && x <= 0xa4c6 ||
|
|
345002
|
+
// Hangul Jamo Extended-A
|
|
345003
|
+
0xa960 <= x && x <= 0xa97c ||
|
|
345004
|
+
// Hangul Syllables
|
|
345005
|
+
0xac00 <= x && x <= 0xd7a3 ||
|
|
345006
|
+
// CJK Compatibility Ideographs
|
|
345007
|
+
0xf900 <= x && x <= 0xfaff ||
|
|
345008
|
+
// Vertical Forms
|
|
345009
|
+
0xfe10 <= x && x <= 0xfe19 ||
|
|
345010
|
+
// CJK Compatibility Forms .. Small Form Variants
|
|
345011
|
+
0xfe30 <= x && x <= 0xfe6b ||
|
|
345012
|
+
// Halfwidth and Fullwidth Forms
|
|
345013
|
+
0xff01 <= x && x <= 0xff60 ||
|
|
345014
|
+
0xffe0 <= x && x <= 0xffe6 ||
|
|
345015
|
+
// Kana Supplement
|
|
345016
|
+
0x1b000 <= x && x <= 0x1b001 ||
|
|
345017
|
+
// Enclosed Ideographic Supplement
|
|
345018
|
+
0x1f200 <= x && x <= 0x1f251 ||
|
|
345019
|
+
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
345020
|
+
0x20000 <= x && x <= 0x3fffd)) {
|
|
345021
|
+
return true;
|
|
345022
|
+
}
|
|
345023
|
+
|
|
345024
|
+
return false;
|
|
345025
|
+
}
|
|
345026
|
+
|
|
345027
|
+
|
|
345028
|
+
/***/ }),
|
|
345029
|
+
|
|
345030
|
+
/***/ 75758:
|
|
345031
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
345032
|
+
|
|
345033
|
+
"use strict";
|
|
345034
|
+
|
|
345035
|
+
var ansiEscapes = __nccwpck_require__(37374);
|
|
345036
|
+
var cliCursor = __nccwpck_require__(22701);
|
|
345037
|
+
|
|
345038
|
+
function main(stream) {
|
|
345039
|
+
var prevLineCount = 0;
|
|
345040
|
+
|
|
345041
|
+
var render = function () {
|
|
345042
|
+
cliCursor.hide();
|
|
345043
|
+
var out = [].join.call(arguments, ' ') + '\n';
|
|
345044
|
+
stream.write(ansiEscapes.eraseLines(prevLineCount) + out);
|
|
345045
|
+
prevLineCount = out.split('\n').length;
|
|
345046
|
+
};
|
|
345047
|
+
|
|
345048
|
+
render.clear = function () {
|
|
345049
|
+
stream.write(ansiEscapes.eraseLines(prevLineCount));
|
|
345050
|
+
prevLineCount = 0;
|
|
345051
|
+
};
|
|
345052
|
+
|
|
345053
|
+
render.done = function () {
|
|
345054
|
+
prevLineCount = 0;
|
|
345055
|
+
cliCursor.show();
|
|
345056
|
+
};
|
|
345057
|
+
|
|
345058
|
+
return render;
|
|
345059
|
+
}
|
|
345060
|
+
|
|
345061
|
+
module.exports = main(process.stdout);
|
|
345062
|
+
module.exports.stderr = main(process.stderr);
|
|
345063
|
+
module.exports.create = main;
|
|
345064
|
+
|
|
345065
|
+
|
|
344919
345066
|
/***/ }),
|
|
344920
345067
|
|
|
344921
345068
|
/***/ 61389:
|
|
@@ -344925,7 +345072,7 @@ module.exports.supportsColor = supportsColor;
|
|
|
344925
345072
|
|
|
344926
345073
|
var stripAnsi = __nccwpck_require__(87668);
|
|
344927
345074
|
var codePointAt = __nccwpck_require__(62257);
|
|
344928
|
-
var isFullwidthCodePoint = __nccwpck_require__(
|
|
345075
|
+
var isFullwidthCodePoint = __nccwpck_require__(26666);
|
|
344929
345076
|
|
|
344930
345077
|
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
|
|
344931
345078
|
module.exports = function (str) {
|
|
@@ -350144,6 +350291,7 @@ var createCustomBuildJobs = function (context) {
|
|
|
350144
350291
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
350145
350292
|
image: buildConfig.jobImage,
|
|
350146
350293
|
variables: __assign({}, RUNNER_BUILD_VARIABLES),
|
|
350294
|
+
cache: buildConfig.jobCache,
|
|
350147
350295
|
services: buildConfig.jobServices,
|
|
350148
350296
|
script: __spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
|
|
350149
350297
|
artifacts: {
|
|
@@ -350304,18 +350452,22 @@ var requiresDockerBuild = function (context) {
|
|
|
350304
350452
|
return false;
|
|
350305
350453
|
};
|
|
350306
350454
|
exports.requiresDockerBuild = requiresDockerBuild;
|
|
350455
|
+
var getDockerBaseVariables = function () {
|
|
350456
|
+
return {
|
|
350457
|
+
DOCKER_HOST: "tcp://0.0.0.0:2375",
|
|
350458
|
+
DOCKER_TLS_CERTDIR: "",
|
|
350459
|
+
DOCKER_DRIVER: "overlay2",
|
|
350460
|
+
DOCKER_BUILDKIT: "1"
|
|
350461
|
+
};
|
|
350462
|
+
};
|
|
350307
350463
|
var getDockerBuildVariables = function (context) {
|
|
350308
350464
|
var _a, _b, _c, _d;
|
|
350309
|
-
return __assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
|
|
350310
|
-
DOCKER_BUILDKIT: "1",
|
|
350465
|
+
return __assign(__assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
|
|
350311
350466
|
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"),
|
|
350312
350467
|
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"),
|
|
350313
350468
|
APP_DIR: context.componentConfig.dir,
|
|
350314
|
-
|
|
350315
|
-
|
|
350316
|
-
DOCKER_DIR: ".",
|
|
350317
|
-
DOCKER_DRIVER: "overlay2"
|
|
350318
|
-
}), (0, exports.getDockerImageVariables)(context));
|
|
350469
|
+
DOCKER_DIR: "."
|
|
350470
|
+
}), getDockerBaseVariables()), (0, exports.getDockerImageVariables)(context));
|
|
350319
350471
|
};
|
|
350320
350472
|
exports.getDockerBuildVariables = getDockerBuildVariables;
|
|
350321
350473
|
exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
|
|
@@ -350326,7 +350478,7 @@ var getDockerJobBaseProps = function (context) {
|
|
|
350326
350478
|
name: "docker:20-dind",
|
|
350327
350479
|
command: ["--tls=false"]
|
|
350328
350480
|
}],
|
|
350329
|
-
variables: (
|
|
350481
|
+
variables: getDockerBaseVariables()
|
|
350330
350482
|
};
|
|
350331
350483
|
};
|
|
350332
350484
|
exports.getDockerJobBaseProps = getDockerJobBaseProps;
|
|
@@ -350339,7 +350491,9 @@ var createDockerBuildJobBase = function (context, _a) {
|
|
|
350339
350491
|
stage: "build"
|
|
350340
350492
|
}, (0, exports.getDockerJobBaseProps)(context)), {
|
|
350341
350493
|
script: script || []
|
|
350342
|
-
}),
|
|
350494
|
+
}), {
|
|
350495
|
+
variables: (0, exports.getDockerBuildVariables)(context)
|
|
350496
|
+
}, def);
|
|
350343
350497
|
};
|
|
350344
350498
|
exports.createDockerBuildJobBase = createDockerBuildJobBase;
|
|
350345
350499
|
exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
|
|
@@ -350425,7 +350579,13 @@ exports.BUILD_TYPES = {
|
|
|
350425
350579
|
rails: {
|
|
350426
350580
|
jobs: rails_1.createRailsJobs,
|
|
350427
350581
|
defaults: function () {
|
|
350428
|
-
return {
|
|
350582
|
+
return {
|
|
350583
|
+
startCommand: "/cnb/process/web",
|
|
350584
|
+
cnbBuilder: {
|
|
350585
|
+
image: "heroku/buildpacks:20",
|
|
350586
|
+
packVersion: "0.28.0"
|
|
350587
|
+
}
|
|
350588
|
+
};
|
|
350429
350589
|
}
|
|
350430
350590
|
}
|
|
350431
350591
|
};
|
|
@@ -350955,31 +351115,52 @@ exports.getYarnInstall = getYarnInstall;
|
|
|
350955
351115
|
"use strict";
|
|
350956
351116
|
|
|
350957
351117
|
|
|
350958
|
-
var
|
|
350959
|
-
|
|
350960
|
-
|
|
350961
|
-
|
|
350962
|
-
|
|
351118
|
+
var __read = this && this.__read || function (o, n) {
|
|
351119
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
351120
|
+
if (!m) return o;
|
|
351121
|
+
var i = m.call(o),
|
|
351122
|
+
r,
|
|
351123
|
+
ar = [],
|
|
351124
|
+
e;
|
|
351125
|
+
try {
|
|
351126
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
351127
|
+
} catch (error) {
|
|
351128
|
+
e = {
|
|
351129
|
+
error: error
|
|
351130
|
+
};
|
|
351131
|
+
} finally {
|
|
351132
|
+
try {
|
|
351133
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
351134
|
+
} finally {
|
|
351135
|
+
if (e) throw e.error;
|
|
350963
351136
|
}
|
|
350964
|
-
|
|
350965
|
-
|
|
350966
|
-
return __assign.apply(this, arguments);
|
|
351137
|
+
}
|
|
351138
|
+
return ar;
|
|
350967
351139
|
};
|
|
350968
351140
|
exports.__esModule = true;
|
|
350969
351141
|
exports.createRailsBuildJobs = void 0;
|
|
351142
|
+
var types_1 = __nccwpck_require__(71197);
|
|
350970
351143
|
var docker_1 = __nccwpck_require__(33219);
|
|
350971
351144
|
var createRailsBuildJobs = function (context) {
|
|
351145
|
+
var _a, _b, _c;
|
|
351146
|
+
var buildConfig = context.componentConfig.build;
|
|
351147
|
+
if (!(0, types_1.isOfBuildType)(buildConfig, "rails")) {
|
|
351148
|
+
// should not happen
|
|
351149
|
+
throw new Error("build type is not rails");
|
|
351150
|
+
}
|
|
351151
|
+
var cnbConf = buildConfig.cnbBuilder;
|
|
351152
|
+
var packEnvArgs = Object.entries((_a = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
|
|
351153
|
+
var _b = __read(_a, 2),
|
|
351154
|
+
k = _b[0],
|
|
351155
|
+
v = _b[1];
|
|
351156
|
+
return "--env '".concat(k).concat(v ? "=".concat(v) : "", "'");
|
|
351157
|
+
}).join(" ");
|
|
350972
351158
|
return [(0, docker_1.createDockerBuildJobBase)(context, {
|
|
350973
|
-
variables:
|
|
350974
|
-
CNB_BUILDER: "heroku/buildpacks:18",
|
|
350975
|
-
CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH",
|
|
350976
|
-
CNB_EXTRA_ARGS: "",
|
|
350977
|
-
CNB_PACK_VERSION: "0.20.0"
|
|
350978
|
-
}, context.componentConfig.build.extraVars),
|
|
351159
|
+
variables: context.componentConfig.build.extraVars,
|
|
350979
351160
|
// custom script
|
|
350980
|
-
script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v
|
|
351161
|
+
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",
|
|
350981
351162
|
// replace private git ssh gem sources with https to make bundler with credentials via env var work
|
|
350982
|
-
"sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock", "
|
|
351163
|
+
"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 : "")]
|
|
350983
351164
|
})];
|
|
350984
351165
|
};
|
|
350985
351166
|
exports.createRailsBuildJobs = createRailsBuildJobs;
|
|
@@ -351103,9 +351284,8 @@ var createRailsTestJobs = function (context) {
|
|
|
351103
351284
|
var bundlerCache = {
|
|
351104
351285
|
key: {
|
|
351105
351286
|
files: ["Gemfile.lock"],
|
|
351106
|
-
prefix: "$CI_JOB_IMAGE"
|
|
351287
|
+
prefix: "$CI_JOB_IMAGE"
|
|
351107
351288
|
},
|
|
351108
|
-
|
|
351109
351289
|
paths: [bundlerCacheDir]
|
|
351110
351290
|
};
|
|
351111
351291
|
var auditJob = buildConfig.audit !== false ? __assign(__assign({
|
|
@@ -351326,7 +351506,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351326
351506
|
|
|
351327
351507
|
exports.__esModule = true;
|
|
351328
351508
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351329
|
-
exports.PIPELINE_IMAGE_TAG = "
|
|
351509
|
+
exports.PIPELINE_IMAGE_TAG = "hidden-secrets-da086bf2" || 0;
|
|
351330
351510
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351331
351511
|
|
|
351332
351512
|
/***/ }),
|
|
@@ -351521,6 +351701,7 @@ var getEnvironment = function (config, componentName, env, commitInfo) {
|
|
|
351521
351701
|
url: url
|
|
351522
351702
|
},
|
|
351523
351703
|
fullName: envContext.fullName,
|
|
351704
|
+
slugPrefix: envContext.environmentSlugPrefix,
|
|
351524
351705
|
slug: envContext.environmentSlug,
|
|
351525
351706
|
shortName: env,
|
|
351526
351707
|
envVars: envVars,
|
|
@@ -351544,20 +351725,22 @@ exports.__esModule = true;
|
|
|
351544
351725
|
exports.getEnvironmentContext = void 0;
|
|
351545
351726
|
var getEnvConfig_1 = __nccwpck_require__(25706);
|
|
351546
351727
|
var getEnvType_1 = __nccwpck_require__(94811);
|
|
351547
|
-
var
|
|
351728
|
+
var getEnvironmentSlugPrefix = function (envConfig, env, commitInfo) {
|
|
351548
351729
|
var envType = (0, getEnvType_1.getEnvType)(env, envConfig);
|
|
351549
|
-
return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug
|
|
351730
|
+
return envType === "review" && commitInfo ? "".concat(env, "-").concat(commitInfo.reviewSlug) : "".concat(env);
|
|
351550
351731
|
};
|
|
351551
351732
|
var getEnvironmentContext = function (config, env, componentName, commitInfo) {
|
|
351552
351733
|
var envConfigRaw = (0, getEnvConfig_1.getEnvConfig)(config, componentName, env);
|
|
351553
351734
|
var envType = (0, getEnvType_1.getEnvType)(env, envConfigRaw);
|
|
351554
|
-
var
|
|
351735
|
+
var environmentSlugPrefix = getEnvironmentSlugPrefix(envConfigRaw, env, commitInfo);
|
|
351736
|
+
var environmentSlug = "".concat(environmentSlugPrefix, "-").concat(componentName);
|
|
351555
351737
|
var gitlabEnvironmentName = envType === "review" && commitInfo ? "".concat(env, "/").concat(commitInfo.refName, "/").concat(componentName) : "".concat(env, "/").concat(componentName);
|
|
351556
351738
|
var fullName = "".concat(config.customerName, "-").concat(config.appName, "-").concat(environmentSlug);
|
|
351557
351739
|
return {
|
|
351558
351740
|
envConfigRaw: envConfigRaw,
|
|
351559
351741
|
deployConfigRaw: envConfigRaw.deploy,
|
|
351560
351742
|
buildConfigRaw: envConfigRaw.build,
|
|
351743
|
+
environmentSlugPrefix: environmentSlugPrefix,
|
|
351561
351744
|
environmentSlug: environmentSlug,
|
|
351562
351745
|
gitlabEnvironmentName: gitlabEnvironmentName,
|
|
351563
351746
|
fullName: fullName,
|
|
@@ -351780,8 +351963,13 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
|
|
|
351780
351963
|
}
|
|
351781
351964
|
publicEnvVarsRaw = (_e = (_d = envConfigRaw.vars) === null || _d === void 0 ? void 0 : _d.public) !== null && _e !== void 0 ? _e : {};
|
|
351782
351965
|
additionalSecretKeys = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(environmentContext) : [];
|
|
351783
|
-
secretEnvVarKeys = __spreadArray(__spreadArray([], __read((_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.secret) !== null && _g !== void 0 ? _g : [])
|
|
351784
|
-
|
|
351966
|
+
secretEnvVarKeys = __spreadArray(__spreadArray([], __read(((_g = (_f = envConfigRaw.vars) === null || _f === void 0 ? void 0 : _f.secret) !== null && _g !== void 0 ? _g : []).map(function (key) {
|
|
351967
|
+
return {
|
|
351968
|
+
key: key
|
|
351969
|
+
};
|
|
351970
|
+
})), false), __read(additionalSecretKeys), false);
|
|
351971
|
+
secretEnvVars = Object.fromEntries(secretEnvVarKeys.map(function (_a) {
|
|
351972
|
+
var key = _a.key;
|
|
351785
351973
|
return [key, "$".concat((0, exports.getSecretVarName)(env, componentName, key))];
|
|
351786
351974
|
}));
|
|
351787
351975
|
legacyFromComponents = (_j = (_h = envConfigRaw.vars) === null || _h === void 0 ? void 0 : _h.fromComponents) !== null && _j !== void 0 ? _j : {};
|
|
@@ -352385,7 +352573,7 @@ var getBaseDeploymentJob = function (context) {
|
|
|
352385
352573
|
return {
|
|
352386
352574
|
name: exports.DEPLOY_JOB_NAME,
|
|
352387
352575
|
envMode: "stagePerEnv",
|
|
352388
|
-
|
|
352576
|
+
needs: context.componentConfig.deploy ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) {
|
|
352389
352577
|
return {
|
|
352390
352578
|
componentName: c,
|
|
352391
352579
|
job: exports.DEPLOY_JOB_NAME,
|
|
@@ -352590,7 +352778,8 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
352590
352778
|
var customConfig = service !== true ? service : undefined;
|
|
352591
352779
|
var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
|
|
352592
352780
|
var argsString = (0, createArgsString_1.createArgsString)(__assign(__assign({
|
|
352593
|
-
|
|
352781
|
+
// command as empty string resets it to default (uses the image's entrypoint)
|
|
352782
|
+
command: command ? '"' + command.split(" ").join(",") + '"' : '""'
|
|
352594
352783
|
}, commonDeployArgs), {
|
|
352595
352784
|
"env-vars-file": "____envvars.yaml",
|
|
352596
352785
|
"min-instances": (_b = customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances) !== null && _b !== void 0 ? _b : 0,
|
|
@@ -352760,15 +352949,15 @@ var jobName_1 = __nccwpck_require__(77311);
|
|
|
352760
352949
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
352761
352950
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
352762
352951
|
var getCloudSqlVariables = function (_a) {
|
|
352763
|
-
var _b, _c, _d;
|
|
352952
|
+
var _b, _c, _d, _e;
|
|
352764
352953
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
352765
|
-
|
|
352954
|
+
environmentSlugPrefix = _a.environmentSlugPrefix,
|
|
352766
352955
|
env = _a.env,
|
|
352767
352956
|
componentName = _a.componentName,
|
|
352768
352957
|
fullConfig = _a.fullConfig;
|
|
352769
352958
|
if (deployConfigRaw && deployConfigRaw.cloudSql) {
|
|
352770
|
-
var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName),
|
|
352771
|
-
var additionalQueryParamsString = Object.entries((
|
|
352959
|
+
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("-");
|
|
352960
|
+
var additionalQueryParamsString = Object.entries((_d = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _d !== void 0 ? _d : {}).map(function (_a) {
|
|
352772
352961
|
var _b = __read(_a, 2),
|
|
352773
352962
|
key = _b[0],
|
|
352774
352963
|
value = _b[1];
|
|
@@ -352777,7 +352966,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
352777
352966
|
return {
|
|
352778
352967
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
352779
352968
|
DB_NAME: DB_NAME,
|
|
352780
|
-
DB_USER: (
|
|
352969
|
+
DB_USER: (_e = deployConfigRaw.cloudSql.dbUser) !== null && _e !== void 0 ? _e : "postgres",
|
|
352781
352970
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
352782
352971
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
352783
352972
|
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)
|
|
@@ -352800,7 +352989,15 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
352800
352989
|
return {};
|
|
352801
352990
|
},
|
|
352802
352991
|
additionalSecretKeys: function (ctx) {
|
|
352803
|
-
return __spreadArray([
|
|
352992
|
+
return __spreadArray([{
|
|
352993
|
+
key: exports.GCLOUD_DEPLOY_CREDENTIALS_KEY,
|
|
352994
|
+
hidden: true
|
|
352995
|
+
}, {
|
|
352996
|
+
key: exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX,
|
|
352997
|
+
hidden: true
|
|
352998
|
+
}], __read(ctx.deployConfigRaw && ctx.deployConfigRaw.cloudSql ? [{
|
|
352999
|
+
key: "DB_PASSWORD"
|
|
353000
|
+
}] : []), false);
|
|
352804
353001
|
},
|
|
352805
353002
|
getAdditionalEnvVars: function (ctx) {
|
|
352806
353003
|
var _a;
|
|
@@ -353198,7 +353395,11 @@ var additionalKubernetesSecretKeys = function (_a) {
|
|
|
353198
353395
|
keys.push("POSTGRESQL_PASSWORD");
|
|
353199
353396
|
keys.push("cloudsqlProxyCredentials");
|
|
353200
353397
|
}
|
|
353201
|
-
return keys
|
|
353398
|
+
return keys.map(function (key) {
|
|
353399
|
+
return {
|
|
353400
|
+
key: key
|
|
353401
|
+
};
|
|
353402
|
+
});
|
|
353202
353403
|
};
|
|
353203
353404
|
exports.additionalKubernetesSecretKeys = additionalKubernetesSecretKeys;
|
|
353204
353405
|
|
|
@@ -353298,7 +353499,7 @@ var base_1 = __nccwpck_require__(89177);
|
|
|
353298
353499
|
var types_1 = __nccwpck_require__(63109);
|
|
353299
353500
|
var kubeValues_1 = __nccwpck_require__(1061);
|
|
353300
353501
|
var createKubernetesDeployJobs = function (context) {
|
|
353301
|
-
var _a, _b;
|
|
353502
|
+
var _a, _b, _c;
|
|
353302
353503
|
var deployConfig = context.componentConfig.deploy;
|
|
353303
353504
|
if (deployConfig === false) {
|
|
353304
353505
|
return [];
|
|
@@ -353322,10 +353523,10 @@ var createKubernetesDeployJobs = function (context) {
|
|
|
353322
353523
|
quotingType: "'",
|
|
353323
353524
|
forceQuotes: true
|
|
353324
353525
|
}),
|
|
353325
|
-
HELM_GITLAB_CHART_NAME: "the-panter-chart",
|
|
353326
|
-
HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((
|
|
353526
|
+
HELM_GITLAB_CHART_NAME: (_a = deployConfig.chartName) !== null && _a !== void 0 ? _a : "/helm-charts/the-panter-chart",
|
|
353527
|
+
HELM_ARGS: __spreadArray(__spreadArray([], __read(deployConfig.debug ? ["--debug"] : []), false), __read((_b = deployConfig.additionalHelmArgs) !== null && _b !== void 0 ? _b : []), false).join(" "),
|
|
353327
353528
|
COMPONENT_NAME: context.componentName,
|
|
353328
|
-
BUILD_ID: (
|
|
353529
|
+
BUILD_ID: (_c = context.commitInfo) === null || _c === void 0 ? void 0 : _c.buildId
|
|
353329
353530
|
})
|
|
353330
353531
|
};
|
|
353331
353532
|
var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
|
|
@@ -353556,33 +353757,36 @@ var kubeEnv_1 = __nccwpck_require__(19449);
|
|
|
353556
353757
|
var mongodb_1 = __nccwpck_require__(77601);
|
|
353557
353758
|
var processSecretsAsFiles_1 = __nccwpck_require__(45187);
|
|
353558
353759
|
var createAppConfig = function (context, application) {
|
|
353559
|
-
var _a, _b, _c;
|
|
353560
353760
|
if (application === false) {
|
|
353561
353761
|
return {
|
|
353562
353762
|
enabled: false
|
|
353563
353763
|
};
|
|
353564
353764
|
}
|
|
353765
|
+
var _a = application !== null && application !== void 0 ? application : {},
|
|
353766
|
+
healthRoute = _a.healthRoute,
|
|
353767
|
+
command = _a.command,
|
|
353768
|
+
rest = __rest(_a, ["healthRoute", "command"]);
|
|
353565
353769
|
return (0, utils_1.mergeWithMergingArrays)({
|
|
353566
353770
|
host: context.environment.host,
|
|
353567
|
-
command: context.componentConfig.build.startCommand,
|
|
353771
|
+
command: command !== null && command !== void 0 ? command : context.componentConfig.build.startCommand,
|
|
353568
353772
|
livenessProbe: {
|
|
353569
353773
|
httpGet: {
|
|
353570
|
-
path:
|
|
353774
|
+
path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
|
|
353571
353775
|
}
|
|
353572
353776
|
},
|
|
353573
353777
|
readinessProbe: {
|
|
353574
353778
|
httpGet: {
|
|
353575
|
-
path:
|
|
353779
|
+
path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
|
|
353576
353780
|
}
|
|
353577
353781
|
},
|
|
353578
353782
|
startupProbe: {
|
|
353579
353783
|
httpGet: {
|
|
353580
|
-
path:
|
|
353784
|
+
path: healthRoute !== null && healthRoute !== void 0 ? healthRoute : "__health"
|
|
353581
353785
|
}
|
|
353582
353786
|
}
|
|
353583
353787
|
},
|
|
353584
353788
|
// default
|
|
353585
|
-
|
|
353789
|
+
rest // merge rest in
|
|
353586
353790
|
);
|
|
353587
353791
|
};
|
|
353588
353792
|
|
|
@@ -354193,32 +354397,404 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
354193
354397
|
}
|
|
354194
354398
|
};
|
|
354195
354399
|
exports.__esModule = true;
|
|
354196
|
-
exports.getBaseCommitInfo = void 0;
|
|
354197
|
-
var getBuildId_1 = __nccwpck_require__(60630);
|
|
354198
|
-
var getBaseCommitInfo = function () {
|
|
354400
|
+
exports.getBaseCommitInfo = void 0;
|
|
354401
|
+
var getBuildId_1 = __nccwpck_require__(60630);
|
|
354402
|
+
var getBaseCommitInfo = function () {
|
|
354403
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
354404
|
+
var _a;
|
|
354405
|
+
var _b;
|
|
354406
|
+
return __generator(this, function (_c) {
|
|
354407
|
+
switch (_c.label) {
|
|
354408
|
+
case 0:
|
|
354409
|
+
_a = {
|
|
354410
|
+
refName: (_b = process.env.CI_COMMIT_REF_NAME) !== null && _b !== void 0 ? _b : "unknown",
|
|
354411
|
+
reviewSlug: process.env.CI_MERGE_REQUEST_IID ? "mr".concat(process.env.CI_MERGE_REQUEST_IID) : "unknown",
|
|
354412
|
+
buildTime: new Date().toISOString()
|
|
354413
|
+
};
|
|
354414
|
+
return [4 /*yield*/, (0, getBuildId_1.getBuildId)()];
|
|
354415
|
+
case 1:
|
|
354416
|
+
return [2 /*return*/, (_a.buildId = _c.sent(), _a)];
|
|
354417
|
+
}
|
|
354418
|
+
});
|
|
354419
|
+
});
|
|
354420
|
+
};
|
|
354421
|
+
exports.getBaseCommitInfo = getBaseCommitInfo;
|
|
354422
|
+
|
|
354423
|
+
/***/ }),
|
|
354424
|
+
|
|
354425
|
+
/***/ 17052:
|
|
354426
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
354427
|
+
|
|
354428
|
+
"use strict";
|
|
354429
|
+
|
|
354430
|
+
|
|
354431
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
354432
|
+
function adopt(value) {
|
|
354433
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
354434
|
+
resolve(value);
|
|
354435
|
+
});
|
|
354436
|
+
}
|
|
354437
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
354438
|
+
function fulfilled(value) {
|
|
354439
|
+
try {
|
|
354440
|
+
step(generator.next(value));
|
|
354441
|
+
} catch (e) {
|
|
354442
|
+
reject(e);
|
|
354443
|
+
}
|
|
354444
|
+
}
|
|
354445
|
+
function rejected(value) {
|
|
354446
|
+
try {
|
|
354447
|
+
step(generator["throw"](value));
|
|
354448
|
+
} catch (e) {
|
|
354449
|
+
reject(e);
|
|
354450
|
+
}
|
|
354451
|
+
}
|
|
354452
|
+
function step(result) {
|
|
354453
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
354454
|
+
}
|
|
354455
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
354456
|
+
});
|
|
354457
|
+
};
|
|
354458
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
354459
|
+
var _ = {
|
|
354460
|
+
label: 0,
|
|
354461
|
+
sent: function () {
|
|
354462
|
+
if (t[0] & 1) throw t[1];
|
|
354463
|
+
return t[1];
|
|
354464
|
+
},
|
|
354465
|
+
trys: [],
|
|
354466
|
+
ops: []
|
|
354467
|
+
},
|
|
354468
|
+
f,
|
|
354469
|
+
y,
|
|
354470
|
+
t,
|
|
354471
|
+
g;
|
|
354472
|
+
return g = {
|
|
354473
|
+
next: verb(0),
|
|
354474
|
+
"throw": verb(1),
|
|
354475
|
+
"return": verb(2)
|
|
354476
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
354477
|
+
return this;
|
|
354478
|
+
}), g;
|
|
354479
|
+
function verb(n) {
|
|
354480
|
+
return function (v) {
|
|
354481
|
+
return step([n, v]);
|
|
354482
|
+
};
|
|
354483
|
+
}
|
|
354484
|
+
function step(op) {
|
|
354485
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
354486
|
+
while (_) try {
|
|
354487
|
+
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;
|
|
354488
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
354489
|
+
switch (op[0]) {
|
|
354490
|
+
case 0:
|
|
354491
|
+
case 1:
|
|
354492
|
+
t = op;
|
|
354493
|
+
break;
|
|
354494
|
+
case 4:
|
|
354495
|
+
_.label++;
|
|
354496
|
+
return {
|
|
354497
|
+
value: op[1],
|
|
354498
|
+
done: false
|
|
354499
|
+
};
|
|
354500
|
+
case 5:
|
|
354501
|
+
_.label++;
|
|
354502
|
+
y = op[1];
|
|
354503
|
+
op = [0];
|
|
354504
|
+
continue;
|
|
354505
|
+
case 7:
|
|
354506
|
+
op = _.ops.pop();
|
|
354507
|
+
_.trys.pop();
|
|
354508
|
+
continue;
|
|
354509
|
+
default:
|
|
354510
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
354511
|
+
_ = 0;
|
|
354512
|
+
continue;
|
|
354513
|
+
}
|
|
354514
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
354515
|
+
_.label = op[1];
|
|
354516
|
+
break;
|
|
354517
|
+
}
|
|
354518
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
354519
|
+
_.label = t[1];
|
|
354520
|
+
t = op;
|
|
354521
|
+
break;
|
|
354522
|
+
}
|
|
354523
|
+
if (t && _.label < t[2]) {
|
|
354524
|
+
_.label = t[2];
|
|
354525
|
+
_.ops.push(op);
|
|
354526
|
+
break;
|
|
354527
|
+
}
|
|
354528
|
+
if (t[2]) _.ops.pop();
|
|
354529
|
+
_.trys.pop();
|
|
354530
|
+
continue;
|
|
354531
|
+
}
|
|
354532
|
+
op = body.call(thisArg, _);
|
|
354533
|
+
} catch (e) {
|
|
354534
|
+
op = [6, e];
|
|
354535
|
+
y = 0;
|
|
354536
|
+
} finally {
|
|
354537
|
+
f = t = 0;
|
|
354538
|
+
}
|
|
354539
|
+
if (op[0] & 5) throw op[1];
|
|
354540
|
+
return {
|
|
354541
|
+
value: op[0] ? op[1] : void 0,
|
|
354542
|
+
done: true
|
|
354543
|
+
};
|
|
354544
|
+
}
|
|
354545
|
+
};
|
|
354546
|
+
exports.__esModule = true;
|
|
354547
|
+
exports.createAllJobs = void 0;
|
|
354548
|
+
var config_1 = __nccwpck_require__(33138);
|
|
354549
|
+
var createJobsForComponent_1 = __nccwpck_require__(80962);
|
|
354550
|
+
var createAllJobs = function (config, trigger) {
|
|
354551
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
354552
|
+
var _a, _b;
|
|
354553
|
+
return __generator(this, function (_c) {
|
|
354554
|
+
switch (_c.label) {
|
|
354555
|
+
case 0:
|
|
354556
|
+
_b = (_a = Object).fromEntries;
|
|
354557
|
+
return [4 /*yield*/, Promise.all(Object.keys(config.components).map(function (componentName) {
|
|
354558
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
354559
|
+
var envs, _a, _b, _c;
|
|
354560
|
+
return __generator(this, function (_d) {
|
|
354561
|
+
switch (_d.label) {
|
|
354562
|
+
case 0:
|
|
354563
|
+
envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
354564
|
+
_a = [componentName];
|
|
354565
|
+
_c = (_b = Object).fromEntries;
|
|
354566
|
+
return [4 /*yield*/, Promise.all(envs.map(function (env) {
|
|
354567
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
354568
|
+
var _a;
|
|
354569
|
+
return __generator(this, function (_b) {
|
|
354570
|
+
switch (_b.label) {
|
|
354571
|
+
case 0:
|
|
354572
|
+
_a = [env];
|
|
354573
|
+
return [4 /*yield*/, (0, createJobsForComponent_1.createJobsForComponent)(config, componentName, env, trigger)];
|
|
354574
|
+
case 1:
|
|
354575
|
+
return [2 /*return*/, _a.concat([_b.sent()])];
|
|
354576
|
+
}
|
|
354577
|
+
});
|
|
354578
|
+
});
|
|
354579
|
+
}))];
|
|
354580
|
+
case 1:
|
|
354581
|
+
return [2 /*return*/, _a.concat([_c.apply(_b, [_d.sent()])])];
|
|
354582
|
+
}
|
|
354583
|
+
});
|
|
354584
|
+
});
|
|
354585
|
+
}))];
|
|
354586
|
+
case 1:
|
|
354587
|
+
return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
|
354588
|
+
}
|
|
354589
|
+
});
|
|
354590
|
+
});
|
|
354591
|
+
};
|
|
354592
|
+
exports.createAllJobs = createAllJobs;
|
|
354593
|
+
|
|
354594
|
+
/***/ }),
|
|
354595
|
+
|
|
354596
|
+
/***/ 78974:
|
|
354597
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
354598
|
+
|
|
354599
|
+
"use strict";
|
|
354600
|
+
|
|
354601
|
+
|
|
354602
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
354603
|
+
function adopt(value) {
|
|
354604
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
354605
|
+
resolve(value);
|
|
354606
|
+
});
|
|
354607
|
+
}
|
|
354608
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
354609
|
+
function fulfilled(value) {
|
|
354610
|
+
try {
|
|
354611
|
+
step(generator.next(value));
|
|
354612
|
+
} catch (e) {
|
|
354613
|
+
reject(e);
|
|
354614
|
+
}
|
|
354615
|
+
}
|
|
354616
|
+
function rejected(value) {
|
|
354617
|
+
try {
|
|
354618
|
+
step(generator["throw"](value));
|
|
354619
|
+
} catch (e) {
|
|
354620
|
+
reject(e);
|
|
354621
|
+
}
|
|
354622
|
+
}
|
|
354623
|
+
function step(result) {
|
|
354624
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
354625
|
+
}
|
|
354626
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
354627
|
+
});
|
|
354628
|
+
};
|
|
354629
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
354630
|
+
var _ = {
|
|
354631
|
+
label: 0,
|
|
354632
|
+
sent: function () {
|
|
354633
|
+
if (t[0] & 1) throw t[1];
|
|
354634
|
+
return t[1];
|
|
354635
|
+
},
|
|
354636
|
+
trys: [],
|
|
354637
|
+
ops: []
|
|
354638
|
+
},
|
|
354639
|
+
f,
|
|
354640
|
+
y,
|
|
354641
|
+
t,
|
|
354642
|
+
g;
|
|
354643
|
+
return g = {
|
|
354644
|
+
next: verb(0),
|
|
354645
|
+
"throw": verb(1),
|
|
354646
|
+
"return": verb(2)
|
|
354647
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
354648
|
+
return this;
|
|
354649
|
+
}), g;
|
|
354650
|
+
function verb(n) {
|
|
354651
|
+
return function (v) {
|
|
354652
|
+
return step([n, v]);
|
|
354653
|
+
};
|
|
354654
|
+
}
|
|
354655
|
+
function step(op) {
|
|
354656
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
354657
|
+
while (_) try {
|
|
354658
|
+
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;
|
|
354659
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
354660
|
+
switch (op[0]) {
|
|
354661
|
+
case 0:
|
|
354662
|
+
case 1:
|
|
354663
|
+
t = op;
|
|
354664
|
+
break;
|
|
354665
|
+
case 4:
|
|
354666
|
+
_.label++;
|
|
354667
|
+
return {
|
|
354668
|
+
value: op[1],
|
|
354669
|
+
done: false
|
|
354670
|
+
};
|
|
354671
|
+
case 5:
|
|
354672
|
+
_.label++;
|
|
354673
|
+
y = op[1];
|
|
354674
|
+
op = [0];
|
|
354675
|
+
continue;
|
|
354676
|
+
case 7:
|
|
354677
|
+
op = _.ops.pop();
|
|
354678
|
+
_.trys.pop();
|
|
354679
|
+
continue;
|
|
354680
|
+
default:
|
|
354681
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
354682
|
+
_ = 0;
|
|
354683
|
+
continue;
|
|
354684
|
+
}
|
|
354685
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
354686
|
+
_.label = op[1];
|
|
354687
|
+
break;
|
|
354688
|
+
}
|
|
354689
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
354690
|
+
_.label = t[1];
|
|
354691
|
+
t = op;
|
|
354692
|
+
break;
|
|
354693
|
+
}
|
|
354694
|
+
if (t && _.label < t[2]) {
|
|
354695
|
+
_.label = t[2];
|
|
354696
|
+
_.ops.push(op);
|
|
354697
|
+
break;
|
|
354698
|
+
}
|
|
354699
|
+
if (t[2]) _.ops.pop();
|
|
354700
|
+
_.trys.pop();
|
|
354701
|
+
continue;
|
|
354702
|
+
}
|
|
354703
|
+
op = body.call(thisArg, _);
|
|
354704
|
+
} catch (e) {
|
|
354705
|
+
op = [6, e];
|
|
354706
|
+
y = 0;
|
|
354707
|
+
} finally {
|
|
354708
|
+
f = t = 0;
|
|
354709
|
+
}
|
|
354710
|
+
if (op[0] & 5) throw op[1];
|
|
354711
|
+
return {
|
|
354712
|
+
value: op[0] ? op[1] : void 0,
|
|
354713
|
+
done: true
|
|
354714
|
+
};
|
|
354715
|
+
}
|
|
354716
|
+
};
|
|
354717
|
+
var __read = this && this.__read || function (o, n) {
|
|
354718
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
354719
|
+
if (!m) return o;
|
|
354720
|
+
var i = m.call(o),
|
|
354721
|
+
r,
|
|
354722
|
+
ar = [],
|
|
354723
|
+
e;
|
|
354724
|
+
try {
|
|
354725
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
354726
|
+
} catch (error) {
|
|
354727
|
+
e = {
|
|
354728
|
+
error: error
|
|
354729
|
+
};
|
|
354730
|
+
} finally {
|
|
354731
|
+
try {
|
|
354732
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
354733
|
+
} finally {
|
|
354734
|
+
if (e) throw e.error;
|
|
354735
|
+
}
|
|
354736
|
+
}
|
|
354737
|
+
return ar;
|
|
354738
|
+
};
|
|
354739
|
+
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
354740
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
354741
|
+
if (ar || !(i in from)) {
|
|
354742
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
354743
|
+
ar[i] = from[i];
|
|
354744
|
+
}
|
|
354745
|
+
}
|
|
354746
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
354747
|
+
};
|
|
354748
|
+
exports.__esModule = true;
|
|
354749
|
+
exports.createChildPipeline = void 0;
|
|
354750
|
+
var config_1 = __nccwpck_require__(33138);
|
|
354751
|
+
var rules_1 = __nccwpck_require__(42020);
|
|
354752
|
+
var runner_1 = __nccwpck_require__(55071);
|
|
354753
|
+
var jobs_1 = __nccwpck_require__(62339);
|
|
354754
|
+
var createAllJobs_1 = __nccwpck_require__(17052);
|
|
354755
|
+
var createGitlabJobs_1 = __nccwpck_require__(63920);
|
|
354756
|
+
var createChildPipeline = function (type, trigger, config) {
|
|
354199
354757
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
354758
|
+
var jobs, allEnvs, stages, pipeline;
|
|
354200
354759
|
var _a;
|
|
354201
|
-
|
|
354202
|
-
|
|
354203
|
-
switch (_c.label) {
|
|
354760
|
+
return __generator(this, function (_b) {
|
|
354761
|
+
switch (_b.label) {
|
|
354204
354762
|
case 0:
|
|
354763
|
+
return [4 /*yield*/, (0, createAllJobs_1.createAllJobs)(config, trigger)];
|
|
354764
|
+
case 1:
|
|
354765
|
+
jobs = _b.sent();
|
|
354766
|
+
allEnvs = (0, config_1.getAllEnvsInAllComponents)(config);
|
|
354767
|
+
stages = jobs_1.BASE_STAGES.reduce(function (acc, baseStage) {
|
|
354768
|
+
return __spreadArray(__spreadArray(__spreadArray([], __read(acc), false), [baseStage], false), __read(allEnvs.map(function (e) {
|
|
354769
|
+
return "".concat(baseStage, " ").concat(e);
|
|
354770
|
+
})), false);
|
|
354771
|
+
}, []);
|
|
354772
|
+
if (!(type === "gitlab")) return [3 /*break*/, 3];
|
|
354205
354773
|
_a = {
|
|
354206
|
-
|
|
354207
|
-
|
|
354208
|
-
|
|
354774
|
+
image: (0, runner_1.getRunnerImage)("jobs-default"),
|
|
354775
|
+
variables: {
|
|
354776
|
+
FF_USE_FASTZIP: "true"
|
|
354777
|
+
},
|
|
354778
|
+
workflow: {
|
|
354779
|
+
rules: rules_1.RULES_ALWAYS
|
|
354780
|
+
},
|
|
354781
|
+
stages: stages
|
|
354209
354782
|
};
|
|
354210
|
-
return [4 /*yield*/, (0,
|
|
354211
|
-
case
|
|
354212
|
-
|
|
354783
|
+
return [4 /*yield*/, (0, createGitlabJobs_1.createGitlabJobs)(jobs)];
|
|
354784
|
+
case 2:
|
|
354785
|
+
pipeline = (_a.jobs = _b.sent(), _a);
|
|
354786
|
+
return [2 /*return*/, pipeline];
|
|
354787
|
+
case 3:
|
|
354788
|
+
throw new Error("".concat(type, " is not supported"));
|
|
354213
354789
|
}
|
|
354214
354790
|
});
|
|
354215
354791
|
});
|
|
354216
354792
|
};
|
|
354217
|
-
exports.
|
|
354793
|
+
exports.createChildPipeline = createChildPipeline;
|
|
354218
354794
|
|
|
354219
354795
|
/***/ }),
|
|
354220
354796
|
|
|
354221
|
-
/***/
|
|
354797
|
+
/***/ 80962:
|
|
354222
354798
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
354223
354799
|
|
|
354224
354800
|
"use strict";
|
|
@@ -354349,6 +354925,14 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
354349
354925
|
};
|
|
354350
354926
|
}
|
|
354351
354927
|
};
|
|
354928
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
354929
|
+
var t = {};
|
|
354930
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
354931
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
354932
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
354933
|
+
}
|
|
354934
|
+
return t;
|
|
354935
|
+
};
|
|
354352
354936
|
var __read = this && this.__read || function (o, n) {
|
|
354353
354937
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
354354
354938
|
if (!m) return o;
|
|
@@ -354381,69 +354965,67 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
354381
354965
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
354382
354966
|
};
|
|
354383
354967
|
exports.__esModule = true;
|
|
354384
|
-
exports.
|
|
354385
|
-
var
|
|
354386
|
-
var
|
|
354387
|
-
var
|
|
354388
|
-
var
|
|
354389
|
-
var
|
|
354390
|
-
var
|
|
354968
|
+
exports.createJobsForComponent = void 0;
|
|
354969
|
+
var lodash_1 = __nccwpck_require__(23255);
|
|
354970
|
+
var build_1 = __nccwpck_require__(73760);
|
|
354971
|
+
var context_1 = __nccwpck_require__(22041);
|
|
354972
|
+
var deploy_1 = __nccwpck_require__(90223);
|
|
354973
|
+
var getCommitInfo_1 = __nccwpck_require__(5923);
|
|
354974
|
+
var packageManager_1 = __nccwpck_require__(69168);
|
|
354975
|
+
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
354976
|
+
return jobs.map(function (_a) {
|
|
354977
|
+
var _b;
|
|
354978
|
+
var variables = _a.variables,
|
|
354979
|
+
job = __rest(_a, ["variables"]);
|
|
354980
|
+
return __assign({
|
|
354981
|
+
variables: __assign(__assign({}, (_b = context.environment.envVars) !== null && _b !== void 0 ? _b : {}), variables !== null && variables !== void 0 ? variables : {})
|
|
354982
|
+
}, job);
|
|
354983
|
+
});
|
|
354984
|
+
};
|
|
354985
|
+
var getCustomJobs = function (context) {
|
|
354986
|
+
if (!context.componentConfig.customJobs) {
|
|
354987
|
+
return [];
|
|
354988
|
+
}
|
|
354989
|
+
var rawJobs = (0, lodash_1.isFunction)(context.componentConfig.customJobs) ? context.componentConfig.customJobs(context) : context.componentConfig.customJobs;
|
|
354990
|
+
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
354991
|
+
};
|
|
354992
|
+
var createRawJobs = function (context) {
|
|
354993
|
+
if (context.componentConfig.deploy === false) {
|
|
354994
|
+
return [];
|
|
354995
|
+
}
|
|
354996
|
+
var buildJobs = build_1.BUILD_TYPES[context.componentConfig.build.type].jobs(context);
|
|
354997
|
+
var deployJobs = deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context);
|
|
354998
|
+
var customJobs = getCustomJobs(context);
|
|
354999
|
+
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
355000
|
+
};
|
|
355001
|
+
var createJobsForComponent = function (config, componentName, env, trigger) {
|
|
354391
355002
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
354392
|
-
var
|
|
354393
|
-
return __generator(this, function (
|
|
354394
|
-
switch (
|
|
355003
|
+
var commitInfo, _a, packageManagerInfo, context;
|
|
355004
|
+
return __generator(this, function (_b) {
|
|
355005
|
+
switch (_b.label) {
|
|
354395
355006
|
case 0:
|
|
354396
|
-
|
|
354397
|
-
return [4 /*yield*/,
|
|
354398
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
354399
|
-
var envs, _a, _b;
|
|
354400
|
-
return __generator(this, function (_c) {
|
|
354401
|
-
switch (_c.label) {
|
|
354402
|
-
case 0:
|
|
354403
|
-
envs = (0, config_1.getAllEnvsByTrigger)(config, componentName, trigger);
|
|
354404
|
-
_a = [{}];
|
|
354405
|
-
return [4 /*yield*/, acc];
|
|
354406
|
-
case 1:
|
|
354407
|
-
_b = [__assign.apply(void 0, _a.concat([_c.sent()]))];
|
|
354408
|
-
return [4 /*yield*/, (0, createJobs_1.createJobs)(type, envs, config, componentName, trigger)];
|
|
354409
|
-
case 2:
|
|
354410
|
-
return [2 /*return*/, __assign.apply(void 0, _b.concat([_c.sent()]))];
|
|
354411
|
-
}
|
|
354412
|
-
});
|
|
354413
|
-
});
|
|
354414
|
-
}, Promise.resolve({}))];
|
|
355007
|
+
_a = [{}];
|
|
355008
|
+
return [4 /*yield*/, (0, getCommitInfo_1.getBaseCommitInfo)()];
|
|
354415
355009
|
case 1:
|
|
354416
|
-
|
|
354417
|
-
|
|
354418
|
-
|
|
354419
|
-
|
|
354420
|
-
|
|
354421
|
-
|
|
354422
|
-
|
|
354423
|
-
|
|
354424
|
-
|
|
354425
|
-
|
|
354426
|
-
variables: {
|
|
354427
|
-
FF_USE_FASTZIP: "true"
|
|
354428
|
-
},
|
|
354429
|
-
workflow: {
|
|
354430
|
-
rules: rules_1.RULES_ALWAYS
|
|
354431
|
-
},
|
|
354432
|
-
stages: stages,
|
|
354433
|
-
jobs: jobs
|
|
354434
|
-
};
|
|
354435
|
-
return [2 /*return*/, pipeline];
|
|
354436
|
-
}
|
|
354437
|
-
throw new Error("".concat(type, " is not supported"));
|
|
355010
|
+
commitInfo = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), {
|
|
355011
|
+
trigger: trigger
|
|
355012
|
+
}]);
|
|
355013
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(config, componentName)];
|
|
355014
|
+
case 2:
|
|
355015
|
+
packageManagerInfo = _b.sent();
|
|
355016
|
+
return [4 /*yield*/, (0, context_1.createContext)(config, componentName, env, commitInfo, packageManagerInfo)];
|
|
355017
|
+
case 3:
|
|
355018
|
+
context = _b.sent();
|
|
355019
|
+
return [2 /*return*/, createRawJobs(context)];
|
|
354438
355020
|
}
|
|
354439
355021
|
});
|
|
354440
355022
|
});
|
|
354441
355023
|
};
|
|
354442
|
-
exports.
|
|
355024
|
+
exports.createJobsForComponent = createJobsForComponent;
|
|
354443
355025
|
|
|
354444
355026
|
/***/ }),
|
|
354445
355027
|
|
|
354446
|
-
/***/
|
|
355028
|
+
/***/ 63920:
|
|
354447
355029
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
354448
355030
|
|
|
354449
355031
|
"use strict";
|
|
@@ -354614,211 +355196,99 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
354614
355196
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
354615
355197
|
};
|
|
354616
355198
|
exports.__esModule = true;
|
|
354617
|
-
exports.
|
|
355199
|
+
exports.createGitlabJobs = exports.makeGitlabJob = void 0;
|
|
354618
355200
|
var lodash_1 = __nccwpck_require__(23255);
|
|
354619
|
-
var
|
|
354620
|
-
var context_1 = __nccwpck_require__(22041);
|
|
354621
|
-
var deploy_1 = __nccwpck_require__(90223);
|
|
354622
|
-
var utils_1 = __nccwpck_require__(37461);
|
|
354623
|
-
var getCommitInfo_1 = __nccwpck_require__(5923);
|
|
354624
|
-
var makeGitlabJob_1 = __nccwpck_require__(15715);
|
|
354625
|
-
var packageManager_1 = __nccwpck_require__(69168);
|
|
354626
|
-
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
354627
|
-
return jobs.map(function (_a) {
|
|
354628
|
-
var _b;
|
|
354629
|
-
var variables = _a.variables,
|
|
354630
|
-
job = __rest(_a, ["variables"]);
|
|
354631
|
-
return __assign({
|
|
354632
|
-
variables: __assign(__assign({}, (_b = context.environment.envVars) !== null && _b !== void 0 ? _b : {}), variables !== null && variables !== void 0 ? variables : {})
|
|
354633
|
-
}, job);
|
|
354634
|
-
});
|
|
354635
|
-
};
|
|
354636
|
-
var getCustomJobs = function (context) {
|
|
354637
|
-
if (!context.componentConfig.customJobs) {
|
|
354638
|
-
return [];
|
|
354639
|
-
}
|
|
354640
|
-
var rawJobs = (0, lodash_1.isFunction)(context.componentConfig.customJobs) ? context.componentConfig.customJobs(context) : context.componentConfig.customJobs;
|
|
354641
|
-
return injectDefaultVarsInCustomJobs(context, rawJobs);
|
|
354642
|
-
};
|
|
354643
|
-
var createRawJobs = function (context) {
|
|
354644
|
-
if (context.componentConfig.deploy === false) {
|
|
354645
|
-
return [];
|
|
354646
|
-
}
|
|
354647
|
-
var buildJobs = build_1.BUILD_TYPES[context.componentConfig.build.type].jobs(context);
|
|
354648
|
-
var deployJobs = deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context);
|
|
354649
|
-
var customJobs = getCustomJobs(context);
|
|
354650
|
-
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
354651
|
-
};
|
|
355201
|
+
var defaults_1 = __nccwpck_require__(87383);
|
|
354652
355202
|
var getFullJobName = function (name, componentName, env) {
|
|
354653
355203
|
if (env) {
|
|
354654
355204
|
return "".concat(componentName, " ").concat(name, " | ").concat(env, " ");
|
|
354655
355205
|
}
|
|
354656
355206
|
return "".concat(componentName, " ").concat(name);
|
|
354657
355207
|
};
|
|
354658
|
-
var getFullReferencedJobName = function (referencedJobName, componentName, env,
|
|
354659
|
-
var
|
|
355208
|
+
var getFullReferencedJobName = function (referencedJobName, componentName, env, allJobs) {
|
|
355209
|
+
var _a, _b;
|
|
355210
|
+
var referencedJob = (_b = (_a = allJobs[componentName]) === null || _a === void 0 ? void 0 : _a[env]) === null || _b === void 0 ? void 0 : _b.find(function (j) {
|
|
354660
355211
|
return j.name === referencedJobName;
|
|
354661
355212
|
});
|
|
354662
355213
|
if (!referencedJob) {
|
|
354663
|
-
throw new Error("unknown job referenced: "
|
|
355214
|
+
throw new Error("unknown job referenced: '".concat(referencedJobName, "' from '").concat(env, ":").concat(componentName, "'"));
|
|
354664
355215
|
}
|
|
354665
355216
|
var envToSet = referencedJob.envMode !== "none" ? env : null;
|
|
354666
355217
|
return getFullJobName(referencedJobName, componentName, envToSet);
|
|
354667
355218
|
};
|
|
354668
|
-
// replaces references to other jobs with the full name
|
|
354669
|
-
// the full name contains the componentname and the env name (if any)
|
|
354670
|
-
var replaceReferences = function (job, componentName, env, allRawJobs) {
|
|
354671
|
-
var _a, _b, _c;
|
|
354672
|
-
var stage = job.envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
354673
|
-
var needsFromNeeds = (_a = job.needs) === null || _a === void 0 ? void 0 : _a.map(function (n) {
|
|
354674
|
-
return (0, lodash_1.isObject)(n) ? {
|
|
354675
|
-
job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
|
|
354676
|
-
artifacts: n.artifacts
|
|
354677
|
-
} : getFullReferencedJobName(n, componentName, env, allRawJobs);
|
|
354678
|
-
});
|
|
354679
|
-
var needsFromOtherComponents = (_b = job.needsOtherComponent) === null || _b === void 0 ? void 0 : _b.map(function (other) {
|
|
354680
|
-
return {
|
|
354681
|
-
artifacts: other.artifacts,
|
|
354682
|
-
job: getFullReferencedJobName(other.job, other.componentName, env, allRawJobs)
|
|
354683
|
-
};
|
|
354684
|
-
});
|
|
354685
|
-
var needs = __spreadArray(__spreadArray([], __read(needsFromNeeds !== null && needsFromNeeds !== void 0 ? needsFromNeeds : []), false), __read(needsFromOtherComponents !== null && needsFromOtherComponents !== void 0 ? needsFromOtherComponents : []), false);
|
|
354686
|
-
return __assign(__assign({}, job), {
|
|
354687
|
-
stage: stage,
|
|
354688
|
-
needs: needs,
|
|
354689
|
-
environment: ((_c = job.environment) === null || _c === void 0 ? void 0 : _c.on_stop) ? __assign(__assign({}, job.environment), {
|
|
354690
|
-
on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allRawJobs)
|
|
354691
|
-
}) : job.environment
|
|
354692
|
-
});
|
|
354693
|
-
};
|
|
354694
|
-
// this can be removed once https://gitlab.com/gitlab-org/gitlab/-/issues/220758 is resolved
|
|
354695
|
-
var addStageNeeds = function (jobs) {
|
|
354696
|
-
// when a job defines needsStages, we add these as needs
|
|
354697
|
-
return jobs.map(function (job) {
|
|
354698
|
-
var _a;
|
|
354699
|
-
if (!job.needsStages || job.needsStages.length === 0) {
|
|
354700
|
-
return job;
|
|
354701
|
-
}
|
|
354702
|
-
var neededJobs = jobs.map(function (j) {
|
|
354703
|
-
var _a, _b;
|
|
354704
|
-
var neededStage = (_a = job.needsStages) === null || _a === void 0 ? void 0 : _a.find(function (s) {
|
|
354705
|
-
return j.stage === s.stage;
|
|
354706
|
-
});
|
|
354707
|
-
if (neededStage) {
|
|
354708
|
-
return {
|
|
354709
|
-
job: j.name,
|
|
354710
|
-
artifacts: (_b = neededStage.artifacts) !== null && _b !== void 0 ? _b : false
|
|
354711
|
-
};
|
|
354712
|
-
}
|
|
354713
|
-
}).filter(utils_1.notNil);
|
|
354714
|
-
return __assign(__assign({}, job), {
|
|
354715
|
-
needs: __spreadArray(__spreadArray([], __read((_a = job.needs) !== null && _a !== void 0 ? _a : []), false), __read(neededJobs), false)
|
|
354716
|
-
});
|
|
354717
|
-
});
|
|
354718
|
-
};
|
|
354719
|
-
var createJobs = function (type, envs, config, componentName, trigger) {
|
|
354720
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
354721
|
-
var commitInfo, _a, packageManagerInfo;
|
|
354722
|
-
return __generator(this, function (_b) {
|
|
354723
|
-
switch (_b.label) {
|
|
354724
|
-
case 0:
|
|
354725
|
-
_a = [{}];
|
|
354726
|
-
return [4 /*yield*/, (0, getCommitInfo_1.getBaseCommitInfo)()];
|
|
354727
|
-
case 1:
|
|
354728
|
-
commitInfo = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), {
|
|
354729
|
-
trigger: trigger
|
|
354730
|
-
}]);
|
|
354731
|
-
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(config, componentName)];
|
|
354732
|
-
case 2:
|
|
354733
|
-
packageManagerInfo = _b.sent();
|
|
354734
|
-
return [2 /*return*/, envs.reduce(function (acc, env) {
|
|
354735
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
354736
|
-
var context, jobs, result, _a, _b, _c, _d, _e;
|
|
354737
|
-
return __generator(this, function (_f) {
|
|
354738
|
-
switch (_f.label) {
|
|
354739
|
-
case 0:
|
|
354740
|
-
return [4 /*yield*/, (0, context_1.createContext)(config, componentName, env, commitInfo, packageManagerInfo)];
|
|
354741
|
-
case 1:
|
|
354742
|
-
context = _f.sent();
|
|
354743
|
-
jobs = addStageNeeds(createRawJobs(context));
|
|
354744
|
-
_a = [{}];
|
|
354745
|
-
return [4 /*yield*/, acc];
|
|
354746
|
-
case 2:
|
|
354747
|
-
_b = [__assign.apply(void 0, _a.concat([_f.sent()]))];
|
|
354748
|
-
_d = (_c = jobs).reduce;
|
|
354749
|
-
_e = [function (acc, job) {
|
|
354750
|
-
var _a;
|
|
354751
|
-
var jobWithResolvedReferences = replaceReferences(job, componentName, env, jobs);
|
|
354752
|
-
var jobName = getFullJobName(job.name, componentName, job.envMode !== "none" ? env : undefined);
|
|
354753
|
-
if (type === "gitlab") {
|
|
354754
|
-
return __assign(__assign({}, acc), (_a = {}, _a[jobName] = (0, makeGitlabJob_1.makeGitlabJob)(jobWithResolvedReferences), _a));
|
|
354755
|
-
}
|
|
354756
|
-
throw new Error("not supported");
|
|
354757
|
-
}];
|
|
354758
|
-
return [4 /*yield*/, Promise.resolve({})];
|
|
354759
|
-
case 3:
|
|
354760
|
-
result = __assign.apply(void 0, _b.concat([_d.apply(_c, _e.concat([_f.sent()]))]));
|
|
354761
|
-
return [2 /*return*/, result];
|
|
354762
|
-
}
|
|
354763
|
-
});
|
|
354764
|
-
});
|
|
354765
|
-
}, {})];
|
|
354766
|
-
}
|
|
354767
|
-
});
|
|
354768
|
-
});
|
|
354769
|
-
};
|
|
354770
|
-
exports.createJobs = createJobs;
|
|
354771
|
-
|
|
354772
|
-
/***/ }),
|
|
354773
|
-
|
|
354774
|
-
/***/ 15715:
|
|
354775
|
-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
354776
|
-
|
|
354777
|
-
"use strict";
|
|
354778
|
-
|
|
354779
|
-
|
|
354780
|
-
var __assign = this && this.__assign || function () {
|
|
354781
|
-
__assign = Object.assign || function (t) {
|
|
354782
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
354783
|
-
s = arguments[i];
|
|
354784
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
354785
|
-
}
|
|
354786
|
-
return t;
|
|
354787
|
-
};
|
|
354788
|
-
return __assign.apply(this, arguments);
|
|
354789
|
-
};
|
|
354790
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
354791
|
-
var t = {};
|
|
354792
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
354793
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
354794
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
354795
|
-
}
|
|
354796
|
-
return t;
|
|
354797
|
-
};
|
|
354798
|
-
exports.__esModule = true;
|
|
354799
|
-
exports.makeGitlabJob = void 0;
|
|
354800
|
-
var lodash_1 = __nccwpck_require__(23255);
|
|
354801
|
-
var defaults_1 = __nccwpck_require__(87383);
|
|
354802
355219
|
var getJobName = function (need) {
|
|
354803
355220
|
return (0, lodash_1.isObject)(need) ? need.job : need;
|
|
354804
355221
|
};
|
|
354805
|
-
var makeGitlabJob = function (_a) {
|
|
355222
|
+
var makeGitlabJob = function (componentName, env, _a, allJobs) {
|
|
355223
|
+
var _b;
|
|
354806
355224
|
var envMode = _a.envMode,
|
|
354807
355225
|
needsStages = _a.needsStages,
|
|
354808
355226
|
needsOtherComponent = _a.needsOtherComponent,
|
|
354809
355227
|
name = _a.name,
|
|
354810
355228
|
needs = _a.needs,
|
|
354811
|
-
|
|
354812
|
-
|
|
355229
|
+
job = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
|
|
355230
|
+
var stage = envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
355231
|
+
var needsFromStages = needsStages === null || needsStages === void 0 ? void 0 : needsStages.flatMap(function (n) {
|
|
355232
|
+
var _a, _b, _c, _d;
|
|
355233
|
+
var referencedComponentName = componentName;
|
|
355234
|
+
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) {
|
|
355235
|
+
return j.stage === n.stage;
|
|
355236
|
+
})) === null || _c === void 0 ? void 0 : _c.map(function (j) {
|
|
355237
|
+
return j.name;
|
|
355238
|
+
})) !== null && _d !== void 0 ? _d : [];
|
|
355239
|
+
return allJobNamesFromThatStage.map(function (job) {
|
|
355240
|
+
var _a;
|
|
355241
|
+
return {
|
|
355242
|
+
job: job,
|
|
355243
|
+
artifacts: (_a = n.artifacts) !== null && _a !== void 0 ? _a : false,
|
|
355244
|
+
componentName: referencedComponentName
|
|
355245
|
+
};
|
|
355246
|
+
});
|
|
355247
|
+
});
|
|
355248
|
+
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);
|
|
355249
|
+
var gitlabNeeds = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
|
|
355250
|
+
var _a;
|
|
355251
|
+
return (0, lodash_1.isObject)(n) ? {
|
|
355252
|
+
job: getFullReferencedJobName(n.job, (_a = n.componentName) !== null && _a !== void 0 ? _a : componentName, env, allJobs),
|
|
355253
|
+
artifacts: n.artifacts
|
|
355254
|
+
} : getFullReferencedJobName(n, componentName, env, allJobs);
|
|
355255
|
+
}).sort(function (a, b) {
|
|
355256
|
+
return getJobName(a).localeCompare(getJobName(b));
|
|
355257
|
+
});
|
|
355258
|
+
var fullJobName = getFullJobName(name, componentName, envMode !== "none" ? env : undefined);
|
|
355259
|
+
var gitlabJob = __assign(__assign({}, job), {
|
|
355260
|
+
stage: stage,
|
|
355261
|
+
environment: ((_b = job.environment) === null || _b === void 0 ? void 0 : _b.on_stop) ? __assign(__assign({}, job.environment), {
|
|
355262
|
+
on_stop: getFullReferencedJobName(job.environment.on_stop, componentName, env, allJobs)
|
|
355263
|
+
}) : job.environment,
|
|
354813
355264
|
// sort in a predictable manner for snapshot tests
|
|
354814
|
-
needs:
|
|
354815
|
-
return getJobName(a).localeCompare(getJobName(b));
|
|
354816
|
-
}),
|
|
355265
|
+
needs: gitlabNeeds,
|
|
354817
355266
|
retry: defaults_1.BASE_RETRY,
|
|
354818
355267
|
interruptible: true
|
|
354819
355268
|
});
|
|
355269
|
+
return [fullJobName, gitlabJob];
|
|
354820
355270
|
};
|
|
354821
355271
|
exports.makeGitlabJob = makeGitlabJob;
|
|
355272
|
+
var createGitlabJobs = function (allJobs) {
|
|
355273
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
355274
|
+
return __generator(this, function (_a) {
|
|
355275
|
+
return [2 /*return*/, Object.keys(allJobs).reduce(function (accForComponents, componentName) {
|
|
355276
|
+
var componentJobs = allJobs[componentName];
|
|
355277
|
+
return __assign(__assign({}, accForComponents), Object.keys(componentJobs).reduce(function (accForEnvs, env) {
|
|
355278
|
+
var jobs = componentJobs[env];
|
|
355279
|
+
return __assign(__assign({}, accForEnvs), jobs.reduce(function (accForJobs, job) {
|
|
355280
|
+
var _a;
|
|
355281
|
+
var _b = __read((0, exports.makeGitlabJob)(componentName, env, job, allJobs), 2),
|
|
355282
|
+
fullJobName = _b[0],
|
|
355283
|
+
gitlabJob = _b[1];
|
|
355284
|
+
return __assign(__assign({}, accForJobs), (_a = {}, _a[fullJobName] = gitlabJob, _a));
|
|
355285
|
+
}, {}));
|
|
355286
|
+
}, {}));
|
|
355287
|
+
}, {})];
|
|
355288
|
+
});
|
|
355289
|
+
});
|
|
355290
|
+
};
|
|
355291
|
+
exports.createGitlabJobs = createGitlabJobs;
|
|
354822
355292
|
|
|
354823
355293
|
/***/ }),
|
|
354824
355294
|
|
|
@@ -354845,7 +355315,7 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
|
354845
355315
|
};
|
|
354846
355316
|
exports.__esModule = true;
|
|
354847
355317
|
__exportStar(__nccwpck_require__(78974), exports);
|
|
354848
|
-
__exportStar(__nccwpck_require__(
|
|
355318
|
+
__exportStar(__nccwpck_require__(80962), exports);
|
|
354849
355319
|
|
|
354850
355320
|
/***/ }),
|
|
354851
355321
|
|