@catladder/cli 0.0.0-refactor-needs-c896b98e → 0.0.0-refactor-args-52277d47
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/cloudSQL/commandRestoreDb.js +42 -26
- package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +1 -1
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +9 -6
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/bundles/catenv/index.js +138 -58
- package/dist/bundles/cli/index.js +189 -90
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/cloudSQL/commandRestoreDb.ts +17 -2
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +6 -2
|
@@ -159,7 +159,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
159
159
|
.command("cloud-sql-restore-db", "restore a db from one source to another target")
|
|
160
160
|
.action(function restoreDb() {
|
|
161
161
|
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
-
var sourceInstance, sourceProxy, targetProxy, sourcePort, targetPort, sourceLocalPort, sourcePassword, sourceDbName, targetInstance, targetLocalPort, targetPassword, targetDbName, shouldContinue, targetPSQL, copyDBScript;
|
|
162
|
+
var sourceInstance, sourceProxy, targetProxy, sourcePort, targetPort, sourceLocalPort, sourceUsername, sourcePassword, sourceDbName, targetInstance, targetLocalPort, targetUsername, targetPassword, targetDbName, shouldContinue, targetPSQL, copyDBScript;
|
|
163
163
|
return __generator(this, function (_a) {
|
|
164
164
|
switch (_a.label) {
|
|
165
165
|
case 0: return [4 /*yield*/, this.prompt({
|
|
@@ -188,82 +188,98 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
188
188
|
_a.label = 5;
|
|
189
189
|
case 5: return [4 /*yield*/, this.prompt({
|
|
190
190
|
type: "input",
|
|
191
|
-
name: "
|
|
192
|
-
|
|
191
|
+
name: "sourceUsername",
|
|
192
|
+
"default": "postgres",
|
|
193
|
+
message: "Source Username? 🤔 "
|
|
193
194
|
})];
|
|
194
195
|
case 6:
|
|
196
|
+
sourceUsername = (_a.sent()).sourceUsername;
|
|
197
|
+
return [4 /*yield*/, this.prompt({
|
|
198
|
+
type: "input",
|
|
199
|
+
name: "sourcePassword",
|
|
200
|
+
message: "Source Password? 🤔 "
|
|
201
|
+
})];
|
|
202
|
+
case 7:
|
|
195
203
|
sourcePassword = (_a.sent()).sourcePassword;
|
|
196
204
|
return [4 /*yield*/, this.prompt({
|
|
197
205
|
type: "input",
|
|
198
206
|
name: "sourceDbName",
|
|
199
207
|
message: "Source DB name? 🤔 "
|
|
200
208
|
})];
|
|
201
|
-
case
|
|
209
|
+
case 8:
|
|
202
210
|
sourceDbName = (_a.sent()).sourceDbName;
|
|
203
211
|
return [4 /*yield*/, this.prompt({
|
|
204
212
|
type: "input",
|
|
205
213
|
name: "targetInstance",
|
|
206
214
|
message: "Targe INSTANCE (connection string or 'local')? 🤔 "
|
|
207
215
|
})];
|
|
208
|
-
case
|
|
216
|
+
case 9:
|
|
209
217
|
targetInstance = (_a.sent()).targetInstance;
|
|
210
|
-
if (!(targetInstance === "local")) return [3 /*break*/,
|
|
218
|
+
if (!(targetInstance === "local")) return [3 /*break*/, 11];
|
|
211
219
|
return [4 /*yield*/, this.prompt({
|
|
212
220
|
type: "number",
|
|
213
221
|
name: "targetLocalPort",
|
|
214
222
|
"default": 5432,
|
|
215
223
|
message: "Local Port for target? 🤔 "
|
|
216
224
|
})];
|
|
217
|
-
case
|
|
225
|
+
case 10:
|
|
218
226
|
targetLocalPort = (_a.sent()).targetLocalPort;
|
|
219
227
|
targetPort = targetLocalPort;
|
|
220
|
-
return [3 /*break*/,
|
|
221
|
-
case
|
|
228
|
+
return [3 /*break*/, 13];
|
|
229
|
+
case 11:
|
|
222
230
|
targetPort = 54499;
|
|
223
231
|
return [4 /*yield*/, createProxy(targetInstance, targetPort)];
|
|
224
|
-
case
|
|
232
|
+
case 12:
|
|
225
233
|
targetProxy = _a.sent();
|
|
226
|
-
_a.label =
|
|
227
|
-
case
|
|
234
|
+
_a.label = 13;
|
|
235
|
+
case 13: return [4 /*yield*/, this.prompt({
|
|
228
236
|
type: "input",
|
|
229
|
-
name: "
|
|
230
|
-
|
|
237
|
+
name: "targetUsername",
|
|
238
|
+
"default": "postgres",
|
|
239
|
+
message: "Target Username? 🤔 "
|
|
231
240
|
})];
|
|
232
|
-
case
|
|
241
|
+
case 14:
|
|
242
|
+
targetUsername = (_a.sent()).targetUsername;
|
|
243
|
+
return [4 /*yield*/, this.prompt({
|
|
244
|
+
type: "input",
|
|
245
|
+
name: "targetPassword",
|
|
246
|
+
message: "Target Password? 🤔 "
|
|
247
|
+
})];
|
|
248
|
+
case 15:
|
|
233
249
|
targetPassword = (_a.sent()).targetPassword;
|
|
234
250
|
return [4 /*yield*/, this.prompt({
|
|
235
251
|
type: "input",
|
|
236
252
|
name: "targetDbName",
|
|
237
253
|
message: "Target DB name? 🤔 "
|
|
238
254
|
})];
|
|
239
|
-
case
|
|
255
|
+
case 16:
|
|
240
256
|
targetDbName = (_a.sent()).targetDbName;
|
|
241
257
|
return [4 /*yield*/, this.prompt({
|
|
242
258
|
type: "confirm",
|
|
243
259
|
name: "shouldContinue",
|
|
244
260
|
message: "This will drop ".concat(targetInstance, "/").concat(targetDbName, " and replace it with ").concat(sourceInstance, "/").concat(sourceDbName, ". Continue? \uD83E\uDD14 ")
|
|
245
261
|
})];
|
|
246
|
-
case
|
|
262
|
+
case 17:
|
|
247
263
|
shouldContinue = (_a.sent()).shouldContinue;
|
|
248
264
|
if (!shouldContinue) {
|
|
249
265
|
return [2 /*return*/];
|
|
250
266
|
}
|
|
251
267
|
targetPSQL = function (command) {
|
|
252
|
-
return "PGPASSWORD=".concat(targetPassword, " psql -p ").concat(targetPort, " --host=localhost --user=
|
|
268
|
+
return "PGPASSWORD=".concat(targetPassword, " psql -p ").concat(targetPort, " --host=localhost --user=").concat(targetUsername, " -q ").concat(command);
|
|
253
269
|
};
|
|
254
|
-
copyDBScript = "\n set -e\n \n \n\n dumptmp=$(mktemp /tmp/dump.XXXXXX)\n\n echo \"Dumping file to $dumptmp\"\n pg_dump --dbname=postgres://
|
|
255
|
-
_a.label =
|
|
256
|
-
case
|
|
257
|
-
_a.trys.push([
|
|
270
|
+
copyDBScript = "\n set -e\n \n \n\n dumptmp=$(mktemp /tmp/dump.XXXXXX)\n\n echo \"Dumping file to $dumptmp\"\n pg_dump --dbname=postgres://".concat(sourceUsername, ":").concat(sourcePassword, "@localhost:").concat(sourcePort, "/").concat(sourceDbName, " --no-owner --no-privileges > $dumptmp\n echo \"dump done\"\n ").concat(targetPSQL("-c 'drop database \"".concat(targetDbName, "\" WITH (FORCE)' 1> /dev/null || true")), "\n ").concat(targetPSQL("-c 'create database \"".concat(targetDbName, "\"' 1> /dev/null")), "\n echo \"Restoring dump...\"\n ").concat(targetPSQL("\"".concat(targetDbName, "\" < $dumptmp 1> /dev/null")), "\n \n\n echo \"Clean up...\"\n set +e\n rm $dumptmp\n echo \"\n\uD83D\uDC31 Done!\"\n ");
|
|
271
|
+
_a.label = 18;
|
|
272
|
+
case 18:
|
|
273
|
+
_a.trys.push([18, , 20, 21]);
|
|
258
274
|
return [4 /*yield*/, (0, child_process_promise_1.spawn)(copyDBScript, [], { shell: "bash", stdio: "inherit" })];
|
|
259
|
-
case
|
|
275
|
+
case 19:
|
|
260
276
|
_a.sent();
|
|
261
|
-
return [3 /*break*/,
|
|
262
|
-
case
|
|
277
|
+
return [3 /*break*/, 21];
|
|
278
|
+
case 20:
|
|
263
279
|
sourceProxy === null || sourceProxy === void 0 ? void 0 : sourceProxy.stop();
|
|
264
280
|
targetProxy === null || targetProxy === void 0 ? void 0 : targetProxy.stop();
|
|
265
281
|
return [7 /*endfinally*/];
|
|
266
|
-
case
|
|
282
|
+
case 21: return [2 /*return*/];
|
|
267
283
|
}
|
|
268
284
|
});
|
|
269
285
|
});
|
|
@@ -1466,7 +1482,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1466
1482
|
.action(function (_a) {
|
|
1467
1483
|
var envComponent = _a.envComponent;
|
|
1468
1484
|
return __awaiter(this, void 0, void 0, function () {
|
|
1469
|
-
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, instanceName, localPort, cloudsqlProxyCredentials;
|
|
1485
|
+
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort, cloudsqlProxyCredentials;
|
|
1470
1486
|
var _this = this;
|
|
1471
1487
|
return __generator(this, function (_c) {
|
|
1472
1488
|
switch (_c.label) {
|
|
@@ -1491,7 +1507,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1491
1507
|
return [3 /*break*/, 6];
|
|
1492
1508
|
case 5: throw new Error("unsupported environment");
|
|
1493
1509
|
case 6:
|
|
1494
|
-
DB_PASSWORD = proxyInfo.DB_PASSWORD, DB_NAME = proxyInfo.DB_NAME, instanceName = proxyInfo.instanceName;
|
|
1510
|
+
DB_PASSWORD = proxyInfo.DB_PASSWORD, DB_NAME = proxyInfo.DB_NAME, DB_USER = proxyInfo.DB_USER, instanceName = proxyInfo.instanceName;
|
|
1495
1511
|
return [4 /*yield*/, this.prompt({
|
|
1496
1512
|
type: "number",
|
|
1497
1513
|
name: "localPort",
|
|
@@ -1503,7 +1519,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1503
1519
|
this.log("");
|
|
1504
1520
|
this.log("postgres-PW: ".concat(DB_PASSWORD));
|
|
1505
1521
|
this.log("");
|
|
1506
|
-
this.log("POSTGRESQL_URL=postgresql://
|
|
1522
|
+
this.log("POSTGRESQL_URL=postgresql://".concat(DB_USER, ":").concat(DB_PASSWORD, "@localhost:").concat(localPort, "/").concat(DB_NAME, "?schema=public"));
|
|
1507
1523
|
this.log("");
|
|
1508
1524
|
return [4 /*yield*/, (0, getProjectConfig_1.getGitlabVar)(this, env, componentName, "cloudsqlProxyCredentials")];
|
|
1509
1525
|
case 8:
|
|
@@ -1570,13 +1586,14 @@ var getProxyInfoForKubernetes = function (context) { return __awaiter(void 0, vo
|
|
|
1570
1586
|
return [2 /*return*/, {
|
|
1571
1587
|
instanceName: instanceName,
|
|
1572
1588
|
DB_PASSWORD: DB_PASSWORD,
|
|
1573
|
-
DB_NAME: DB_NAME
|
|
1589
|
+
DB_NAME: DB_NAME,
|
|
1590
|
+
DB_USER: "postgres"
|
|
1574
1591
|
}];
|
|
1575
1592
|
}
|
|
1576
1593
|
});
|
|
1577
1594
|
}); };
|
|
1578
1595
|
var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1579
|
-
var envVars, DB_PASSWORD, DB_NAME;
|
|
1596
|
+
var envVars, DB_PASSWORD, DB_USER, DB_NAME;
|
|
1580
1597
|
return __generator(this, function (_a) {
|
|
1581
1598
|
switch (_a.label) {
|
|
1582
1599
|
case 0:
|
|
@@ -1588,11 +1605,13 @@ var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void
|
|
|
1588
1605
|
case 1:
|
|
1589
1606
|
envVars = _a.sent();
|
|
1590
1607
|
DB_PASSWORD = envVars === null || envVars === void 0 ? void 0 : envVars.DB_PASSWORD;
|
|
1608
|
+
DB_USER = envVars === null || envVars === void 0 ? void 0 : envVars.DB_USER;
|
|
1591
1609
|
DB_NAME = context.environment.envVars.DB_NAME;
|
|
1592
1610
|
return [2 /*return*/, {
|
|
1593
1611
|
instanceName: context.componentConfig.deploy.cloudSql.instanceConnectionName,
|
|
1594
1612
|
DB_PASSWORD: DB_PASSWORD,
|
|
1595
|
-
DB_NAME: DB_NAME
|
|
1613
|
+
DB_NAME: DB_NAME,
|
|
1614
|
+
DB_USER: DB_USER
|
|
1596
1615
|
}];
|
|
1597
1616
|
}
|
|
1598
1617
|
});
|
|
@@ -350421,9 +350440,15 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
350421
350440
|
}
|
|
350422
350441
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
350423
350442
|
};
|
|
350443
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
350444
|
+
return mod && mod.__esModule ? mod : {
|
|
350445
|
+
"default": mod
|
|
350446
|
+
};
|
|
350447
|
+
};
|
|
350424
350448
|
exports.__esModule = true;
|
|
350425
350449
|
exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
350426
350450
|
var path_1 = __nccwpck_require__(71017);
|
|
350451
|
+
var slugify_1 = __importDefault(__nccwpck_require__(44035));
|
|
350427
350452
|
var getYarnCache = function (context, policy) {
|
|
350428
350453
|
var _a;
|
|
350429
350454
|
if (policy === void 0) {
|
|
@@ -350435,7 +350460,7 @@ var getYarnCache = function (context, policy) {
|
|
|
350435
350460
|
policy: policy,
|
|
350436
350461
|
paths: [".yarn"]
|
|
350437
350462
|
} : {
|
|
350438
|
-
key: context.componentConfig.dir + "-yarn",
|
|
350463
|
+
key: (0, slugify_1["default"])(context.componentConfig.dir) + "-yarn",
|
|
350439
350464
|
policy: policy,
|
|
350440
350465
|
paths: [(0, path_1.join)(context.componentConfig.dir, ".yarn")]
|
|
350441
350466
|
}];
|
|
@@ -350447,9 +350472,11 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
350447
350472
|
policy = "pull-push";
|
|
350448
350473
|
}
|
|
350449
350474
|
var componentIsInWorkspace = (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace;
|
|
350475
|
+
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
|
|
350476
|
+
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
350450
350477
|
return [{
|
|
350451
350478
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
350452
|
-
key: componentIsInWorkspace ? "node-modules-workspace" : context.componentConfig.dir + "-node-modules",
|
|
350479
|
+
key: componentIsInWorkspace ? "node-modules-workspace" : (0, slugify_1["default"])(context.componentConfig.dir) + "-node-modules",
|
|
350453
350480
|
policy: policy,
|
|
350454
350481
|
paths: __spreadArray([], __read(componentIsInWorkspace ? __spreadArray(["node_modules"], __read((_c = (_b = context.packageManagerInfo) === null || _b === void 0 ? void 0 : _b.workspaces.map(function (w) {
|
|
350455
350482
|
return (0, path_1.join)(w.location, "node_modules");
|
|
@@ -350949,8 +350976,9 @@ var createRailsTestJobs = function (context) {
|
|
|
350949
350976
|
var bundlerCache = {
|
|
350950
350977
|
key: {
|
|
350951
350978
|
files: ["Gemfile.lock"],
|
|
350952
|
-
prefix: "$CI_JOB_IMAGE"
|
|
350979
|
+
prefix: "$CI_JOB_IMAGE" // a changed image might have different OS libraries which no longer work with the cached gems
|
|
350953
350980
|
},
|
|
350981
|
+
|
|
350954
350982
|
paths: [bundlerCacheDir]
|
|
350955
350983
|
};
|
|
350956
350984
|
var auditJob = buildConfig.audit !== false ? __assign(__assign({
|
|
@@ -351171,7 +351199,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351171
351199
|
|
|
351172
351200
|
exports.__esModule = true;
|
|
351173
351201
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351174
|
-
exports.PIPELINE_IMAGE_TAG = "refactor-
|
|
351202
|
+
exports.PIPELINE_IMAGE_TAG = "refactor-args-52277d47" || 0;
|
|
351175
351203
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351176
351204
|
|
|
351177
351205
|
/***/ }),
|
|
@@ -352228,7 +352256,7 @@ var getBaseDeploymentJob = function (context) {
|
|
|
352228
352256
|
return {
|
|
352229
352257
|
name: exports.DEPLOY_JOB_NAME,
|
|
352230
352258
|
envMode: "stagePerEnv",
|
|
352231
|
-
|
|
352259
|
+
needsOtherComponent: context.componentConfig.deploy ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) {
|
|
352232
352260
|
return {
|
|
352233
352261
|
componentName: c,
|
|
352234
352262
|
job: exports.DEPLOY_JOB_NAME,
|
|
@@ -352354,6 +352382,7 @@ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(22607);
|
|
|
352354
352382
|
var database_1 = __nccwpck_require__(41384);
|
|
352355
352383
|
var gitlab_1 = __nccwpck_require__(84997);
|
|
352356
352384
|
var jobName_1 = __nccwpck_require__(77311);
|
|
352385
|
+
var createArgsString_1 = __nccwpck_require__(8686);
|
|
352357
352386
|
var setExtraVarsScripts = function (deployConfig) {
|
|
352358
352387
|
return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
|
|
352359
352388
|
};
|
|
@@ -352379,9 +352408,12 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
352379
352408
|
value = _b[1];
|
|
352380
352409
|
return "".concat(key, "=").concat(value);
|
|
352381
352410
|
}).join(",");
|
|
352382
|
-
var commonArgs =
|
|
352411
|
+
var commonArgs = (0, createArgsString_1.createArgsString)({
|
|
352412
|
+
project: deployConfig.projectId,
|
|
352413
|
+
region: deployConfig.region
|
|
352414
|
+
});
|
|
352383
352415
|
var cloudRunArgs = deployConfig.cloudSql ? "--set-cloudsql-instances=".concat(deployConfig.cloudSql.instanceConnectionName) : "";
|
|
352384
|
-
var commonDeployArgs = "--image
|
|
352416
|
+
var commonDeployArgs = "--image=".concat(gcloudImageName, " ").concat(commonArgs, " ").concat(cloudRunArgs, " --labels=").concat(labelsString);
|
|
352385
352417
|
var serviceName = context.environment.fullName.toLowerCase();
|
|
352386
352418
|
var getFullJobName = function (name) {
|
|
352387
352419
|
return (0, jobName_1.getCloudRunJobName)(context.environment.fullName, name);
|
|
@@ -352421,16 +352453,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
352421
352453
|
"max-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances,
|
|
352422
352454
|
"no-cpu-throttling": customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling
|
|
352423
352455
|
};
|
|
352424
|
-
var argsString =
|
|
352425
|
-
var _b = __read(_a, 2),
|
|
352426
|
-
value = _b[1];
|
|
352427
|
-
return !(0, lodash_1.isNil)(value);
|
|
352428
|
-
}).map(function (_a) {
|
|
352429
|
-
var _b = __read(_a, 2),
|
|
352430
|
-
key = _b[0],
|
|
352431
|
-
value = _b[1];
|
|
352432
|
-
return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
|
|
352433
|
-
}).join(" ");
|
|
352456
|
+
var argsString = (0, createArgsString_1.createArgsString)(args);
|
|
352434
352457
|
return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml ").concat(argsString);
|
|
352435
352458
|
};
|
|
352436
352459
|
var getJobCreateScriptsForJob = function (jobName, job) {
|
|
@@ -352574,7 +352597,7 @@ var jobName_1 = __nccwpck_require__(77311);
|
|
|
352574
352597
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
352575
352598
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
352576
352599
|
var getCloudSqlVariables = function (_a) {
|
|
352577
|
-
var _b, _c;
|
|
352600
|
+
var _b, _c, _d;
|
|
352578
352601
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
352579
352602
|
environmentSlug = _a.environmentSlug,
|
|
352580
352603
|
env = _a.env,
|
|
@@ -352591,7 +352614,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
352591
352614
|
return {
|
|
352592
352615
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
352593
352616
|
DB_NAME: DB_NAME,
|
|
352594
|
-
DB_USER: "postgres",
|
|
352617
|
+
DB_USER: (_d = deployConfigRaw.cloudSql.dbUser) !== null && _d !== void 0 ? _d : "postgres",
|
|
352595
352618
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
352596
352619
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
352597
352620
|
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)
|
|
@@ -352636,6 +352659,63 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
352636
352659
|
|
|
352637
352660
|
/***/ }),
|
|
352638
352661
|
|
|
352662
|
+
/***/ 8686:
|
|
352663
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
352664
|
+
|
|
352665
|
+
"use strict";
|
|
352666
|
+
|
|
352667
|
+
|
|
352668
|
+
var __read = this && this.__read || function (o, n) {
|
|
352669
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
352670
|
+
if (!m) return o;
|
|
352671
|
+
var i = m.call(o),
|
|
352672
|
+
r,
|
|
352673
|
+
ar = [],
|
|
352674
|
+
e;
|
|
352675
|
+
try {
|
|
352676
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
352677
|
+
} catch (error) {
|
|
352678
|
+
e = {
|
|
352679
|
+
error: error
|
|
352680
|
+
};
|
|
352681
|
+
} finally {
|
|
352682
|
+
try {
|
|
352683
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
352684
|
+
} finally {
|
|
352685
|
+
if (e) throw e.error;
|
|
352686
|
+
}
|
|
352687
|
+
}
|
|
352688
|
+
return ar;
|
|
352689
|
+
};
|
|
352690
|
+
exports.__esModule = true;
|
|
352691
|
+
exports.createArgsString = void 0;
|
|
352692
|
+
var lodash_1 = __nccwpck_require__(23255);
|
|
352693
|
+
/**
|
|
352694
|
+
* creates arguments string:
|
|
352695
|
+
*
|
|
352696
|
+
* --key=value
|
|
352697
|
+
*
|
|
352698
|
+
* - undefined or null values will get removed completly
|
|
352699
|
+
* - true will just be "--key"
|
|
352700
|
+
* @param args args record
|
|
352701
|
+
* @returns
|
|
352702
|
+
*/
|
|
352703
|
+
var createArgsString = function (args) {
|
|
352704
|
+
return Object.entries(args).filter(function (_a) {
|
|
352705
|
+
var _b = __read(_a, 2),
|
|
352706
|
+
value = _b[1];
|
|
352707
|
+
return !(0, lodash_1.isNil)(value);
|
|
352708
|
+
}).map(function (_a) {
|
|
352709
|
+
var _b = __read(_a, 2),
|
|
352710
|
+
key = _b[0],
|
|
352711
|
+
value = _b[1];
|
|
352712
|
+
return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
|
|
352713
|
+
}).join(" ");
|
|
352714
|
+
};
|
|
352715
|
+
exports.createArgsString = createArgsString;
|
|
352716
|
+
|
|
352717
|
+
/***/ }),
|
|
352718
|
+
|
|
352639
352719
|
/***/ 41384:
|
|
352640
352720
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
352641
352721
|
|
|
@@ -353257,6 +353337,16 @@ exports.createKubeEnv = createKubeEnv;
|
|
|
353257
353337
|
"use strict";
|
|
353258
353338
|
|
|
353259
353339
|
|
|
353340
|
+
var __assign = this && this.__assign || function () {
|
|
353341
|
+
__assign = Object.assign || function (t) {
|
|
353342
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
353343
|
+
s = arguments[i];
|
|
353344
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
353345
|
+
}
|
|
353346
|
+
return t;
|
|
353347
|
+
};
|
|
353348
|
+
return __assign.apply(this, arguments);
|
|
353349
|
+
};
|
|
353260
353350
|
var __rest = this && this.__rest || function (s, e) {
|
|
353261
353351
|
var t = {};
|
|
353262
353352
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -353265,6 +353355,28 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
353265
353355
|
}
|
|
353266
353356
|
return t;
|
|
353267
353357
|
};
|
|
353358
|
+
var __read = this && this.__read || function (o, n) {
|
|
353359
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
353360
|
+
if (!m) return o;
|
|
353361
|
+
var i = m.call(o),
|
|
353362
|
+
r,
|
|
353363
|
+
ar = [],
|
|
353364
|
+
e;
|
|
353365
|
+
try {
|
|
353366
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
353367
|
+
} catch (error) {
|
|
353368
|
+
e = {
|
|
353369
|
+
error: error
|
|
353370
|
+
};
|
|
353371
|
+
} finally {
|
|
353372
|
+
try {
|
|
353373
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
353374
|
+
} finally {
|
|
353375
|
+
if (e) throw e.error;
|
|
353376
|
+
}
|
|
353377
|
+
}
|
|
353378
|
+
return ar;
|
|
353379
|
+
};
|
|
353268
353380
|
exports.__esModule = true;
|
|
353269
353381
|
exports.createKubeValues = void 0;
|
|
353270
353382
|
var lodash_1 = __nccwpck_require__(23255);
|
|
@@ -353305,6 +353417,14 @@ var createAppConfig = function (context, application) {
|
|
|
353305
353417
|
);
|
|
353306
353418
|
};
|
|
353307
353419
|
|
|
353420
|
+
var removeFalsy = function (record) {
|
|
353421
|
+
if (!record) return undefined;
|
|
353422
|
+
return Object.fromEntries(Object.entries(record).filter(function (_a) {
|
|
353423
|
+
var _b = __read(_a, 2),
|
|
353424
|
+
value = _b[1];
|
|
353425
|
+
return value !== false;
|
|
353426
|
+
}));
|
|
353427
|
+
};
|
|
353308
353428
|
var createKubeValues = function (context) {
|
|
353309
353429
|
var _a, _b;
|
|
353310
353430
|
var deployConfig = context.componentConfig.deploy;
|
|
@@ -353321,13 +353441,18 @@ var createKubeValues = function (context) {
|
|
|
353321
353441
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
353322
353442
|
var _c = values !== null && values !== void 0 ? values : {},
|
|
353323
353443
|
application = _c.application,
|
|
353324
|
-
|
|
353444
|
+
jobs = _c.jobs,
|
|
353445
|
+
cronjobs = _c.cronjobs,
|
|
353446
|
+
rest = __rest(_c, ["application", "jobs", "cronjobs"]);
|
|
353325
353447
|
var env = (0, kubeEnv_1.createKubeEnv)(context);
|
|
353326
353448
|
var defaultKubeValues = (0, lodash_1.merge)({
|
|
353327
353449
|
env: env,
|
|
353328
353450
|
application: createAppConfig(context, application)
|
|
353329
353451
|
}, (0, cloudSql_1.hasKubernetesCloudSQL)(context) ? (0, cloudSql_1.createCloudsqlBaseConfig)(context) : {}, ((_b = (_a = deployConfig.values) === null || _a === void 0 ? void 0 : _a.mongodb) === null || _b === void 0 ? void 0 : _b.enabled) ? (0, mongodb_1.createMongodbBaseConfig)(context) : {});
|
|
353330
|
-
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues,
|
|
353452
|
+
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
353453
|
+
jobs: removeFalsy(jobs),
|
|
353454
|
+
cronjobs: removeFalsy(cronjobs)
|
|
353455
|
+
}, rest)));
|
|
353331
353456
|
return kubeValues;
|
|
353332
353457
|
};
|
|
353333
353458
|
exports.createKubeValues = createKubeValues;
|
|
@@ -354376,14 +354501,19 @@ var getFullReferencedJobName = function (referencedJobName, componentName, env,
|
|
|
354376
354501
|
var replaceReferences = function (job, componentName, env, allRawJobs) {
|
|
354377
354502
|
var _a, _b, _c;
|
|
354378
354503
|
var stage = job.envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
354379
|
-
var
|
|
354380
|
-
var needs = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
|
|
354381
|
-
var _a;
|
|
354504
|
+
var needsFromNeeds = (_a = job.needs) === null || _a === void 0 ? void 0 : _a.map(function (n) {
|
|
354382
354505
|
return (0, lodash_1.isObject)(n) ? {
|
|
354383
|
-
job: getFullReferencedJobName(n.job,
|
|
354506
|
+
job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
|
|
354384
354507
|
artifacts: n.artifacts
|
|
354385
354508
|
} : getFullReferencedJobName(n, componentName, env, allRawJobs);
|
|
354386
354509
|
});
|
|
354510
|
+
var needsFromOtherComponents = (_b = job.needsOtherComponent) === null || _b === void 0 ? void 0 : _b.map(function (other) {
|
|
354511
|
+
return {
|
|
354512
|
+
artifacts: other.artifacts,
|
|
354513
|
+
job: getFullReferencedJobName(other.job, other.componentName, env, allRawJobs)
|
|
354514
|
+
};
|
|
354515
|
+
});
|
|
354516
|
+
var needs = __spreadArray(__spreadArray([], __read(needsFromNeeds !== null && needsFromNeeds !== void 0 ? needsFromNeeds : []), false), __read(needsFromOtherComponents !== null && needsFromOtherComponents !== void 0 ? needsFromOtherComponents : []), false);
|
|
354387
354517
|
return __assign(__assign({}, job), {
|
|
354388
354518
|
stage: stage,
|
|
354389
354519
|
needs: needs,
|
|
@@ -354496,37 +354626,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
354496
354626
|
}
|
|
354497
354627
|
return t;
|
|
354498
354628
|
};
|
|
354499
|
-
var __read = this && this.__read || function (o, n) {
|
|
354500
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
354501
|
-
if (!m) return o;
|
|
354502
|
-
var i = m.call(o),
|
|
354503
|
-
r,
|
|
354504
|
-
ar = [],
|
|
354505
|
-
e;
|
|
354506
|
-
try {
|
|
354507
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
354508
|
-
} catch (error) {
|
|
354509
|
-
e = {
|
|
354510
|
-
error: error
|
|
354511
|
-
};
|
|
354512
|
-
} finally {
|
|
354513
|
-
try {
|
|
354514
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
354515
|
-
} finally {
|
|
354516
|
-
if (e) throw e.error;
|
|
354517
|
-
}
|
|
354518
|
-
}
|
|
354519
|
-
return ar;
|
|
354520
|
-
};
|
|
354521
|
-
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
354522
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
354523
|
-
if (ar || !(i in from)) {
|
|
354524
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
354525
|
-
ar[i] = from[i];
|
|
354526
|
-
}
|
|
354527
|
-
}
|
|
354528
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
354529
|
-
};
|
|
354530
354629
|
exports.__esModule = true;
|
|
354531
354630
|
exports.makeGitlabJob = void 0;
|
|
354532
354631
|
var lodash_1 = __nccwpck_require__(23255);
|
|
@@ -354543,9 +354642,9 @@ var makeGitlabJob = function (_a) {
|
|
|
354543
354642
|
rest = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
|
|
354544
354643
|
return __assign(__assign({}, rest), {
|
|
354545
354644
|
// sort in a predictable manner for snapshot tests
|
|
354546
|
-
needs: needs ?
|
|
354645
|
+
needs: needs === null || needs === void 0 ? void 0 : needs.sort(function (a, b) {
|
|
354547
354646
|
return getJobName(a).localeCompare(getJobName(b));
|
|
354548
|
-
})
|
|
354647
|
+
}),
|
|
354549
354648
|
retry: defaults_1.BASE_RETRY,
|
|
354550
354649
|
interruptible: true
|
|
354551
354650
|
});
|