@catladder/cli 0.0.0-main-b35071da → 0.0.0-main-c5b17545
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/commandCloudSqlProxy.js +5 -43
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/bundles/catenv/index.js +4 -4
- package/dist/bundles/cli/index.js +9 -47
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +7 -28
|
@@ -35,21 +35,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
-
if (ar || !(i in from)) {
|
|
41
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
-
ar[i] = from[i];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
-
};
|
|
47
38
|
exports.__esModule = true;
|
|
48
39
|
var pipeline_1 = require("@catladder/pipeline");
|
|
49
40
|
var pipeline_2 = require("@catladder/pipeline");
|
|
50
41
|
var child_process_promise_1 = require("child-process-promise");
|
|
51
|
-
var fs_extra_1 = require("fs-extra");
|
|
52
|
-
var tmp_promise_1 = require("tmp-promise");
|
|
53
42
|
var getProjectConfig_1 = require("../../../../config/getProjectConfig");
|
|
54
43
|
var autocompletions_1 = require("./utils/autocompletions");
|
|
55
44
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -65,8 +54,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
65
54
|
.action(function (_a) {
|
|
66
55
|
var envComponent = _a.envComponent;
|
|
67
56
|
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort
|
|
69
|
-
var _this = this;
|
|
57
|
+
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort;
|
|
70
58
|
return __generator(this, function (_c) {
|
|
71
59
|
switch (_c.label) {
|
|
72
60
|
case 0:
|
|
@@ -104,37 +92,11 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
104
92
|
this.log("");
|
|
105
93
|
this.log("POSTGRESQL_URL=postgresql://".concat(DB_USER, ":").concat(DB_PASSWORD, "@localhost:").concat(localPort, "/").concat(DB_NAME, "?schema=public"));
|
|
106
94
|
this.log("");
|
|
107
|
-
return [4 /*yield*/, (0,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return [4 /*yield*/, (0, tmp_promise_1.withFile)(function (_a) {
|
|
111
|
-
var tmpFilePath = _a.path;
|
|
112
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
113
|
-
return __generator(this, function (_b) {
|
|
114
|
-
switch (_b.label) {
|
|
115
|
-
case 0:
|
|
116
|
-
if (!cloudsqlProxyCredentials) return [3 /*break*/, 2];
|
|
117
|
-
return [4 /*yield*/, (0, fs_extra_1.writeFile)(tmpFilePath, cloudsqlProxyCredentials)];
|
|
118
|
-
case 1:
|
|
119
|
-
_b.sent();
|
|
120
|
-
_b.label = 2;
|
|
121
|
-
case 2: return [4 /*yield*/, (0, child_process_promise_1.spawn)("cloud_sql_proxy", __spreadArray([
|
|
122
|
-
"-instances",
|
|
123
|
-
"".concat(instanceName, "=tcp:").concat(localPort)
|
|
124
|
-
], (cloudsqlProxyCredentials
|
|
125
|
-
? ["-credential_file", tmpFilePath]
|
|
126
|
-
: []), true), {
|
|
127
|
-
stdio: "inherit",
|
|
128
|
-
shell: true
|
|
129
|
-
})];
|
|
130
|
-
case 3:
|
|
131
|
-
_b.sent();
|
|
132
|
-
return [2 /*return*/];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
95
|
+
return [4 /*yield*/, (0, child_process_promise_1.spawn)("cloud_sql_proxy", ["-instances", "".concat(instanceName, "=tcp:").concat(localPort)], {
|
|
96
|
+
stdio: "inherit",
|
|
97
|
+
shell: true
|
|
136
98
|
})];
|
|
137
|
-
case
|
|
99
|
+
case 8:
|
|
138
100
|
_c.sent();
|
|
139
101
|
return [2 /*return*/];
|
|
140
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandCloudSqlProxy.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandCloudSqlProxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commandCloudSqlProxy.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandCloudSqlProxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAyE;AACzE,gDAAqD;AACrD,+DAA8C;AAI9C,wEAK6C;AAC7C,2DAA2D;AAQ3D,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CAAC,wCAAwC,EAAE,uBAAuB,CAAC,CAAA;qBAC1E,YAAY,CAAA;gBAAC,qBAAM,IAAA,kCAAgB,GAAE,EAAA;oBAFxC,sBAAA,cAEgB,SAAwB,EAAC;qBACtC,MAAM,CAAC,UAAgB,EAAgB;wBAAd,YAAY,kBAAA;;;;;;oCAC9B,KAAyB,IAAA,8BAAW,EAAC,YAAY,CAAC,EAAhD,GAAG,SAAA,EAAE,aAAa,mBAAA,CAA+B;oCAEzC,qBAAM,IAAA,6CAA0B,EAAC,GAAG,EAAE,aAAa,CAAC,EAAA;;oCAA9D,OAAO,GAAG,SAAoD;oCAGpE,IAAI,GAAG,KAAK,QAAQ,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,aAAa,CACtB,EAAA;;gBAJK,OAAO,GAAG,SAIf;gBAEK,WAAW,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC;gBACnC,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC;gBAE3B,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;gBAEpD,sBAAO;wBACL,YAAY,EACV,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB;wBAChE,WAAW,aAAA;wBACX,OAAO,SAAA;wBACP,OAAO,SAAA;qBACR,EAAC;;;KACH,CAAC"}
|
|
@@ -40107,7 +40107,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40107
40107
|
|
|
40108
40108
|
exports.__esModule = true;
|
|
40109
40109
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40110
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
40110
|
+
exports.PIPELINE_IMAGE_TAG = "main-c5b17545" || 0;
|
|
40111
40111
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40112
40112
|
|
|
40113
40113
|
/***/ }),
|
|
@@ -41447,7 +41447,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41447
41447
|
});
|
|
41448
41448
|
return jobsWithSchedule.map(function (_a) {
|
|
41449
41449
|
var schedulerName = _a.schedulerName;
|
|
41450
|
-
return
|
|
41450
|
+
return ["gcloud scheduler jobs delete ".concat(schedulerName, " ").concat(argsString)];
|
|
41451
41451
|
}).flat();
|
|
41452
41452
|
};
|
|
41453
41453
|
var getDeleteJobsScripts = function () {
|
|
@@ -41487,7 +41487,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41487
41487
|
variables: {
|
|
41488
41488
|
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
|
|
41489
41489
|
},
|
|
41490
|
-
script: stopScripts
|
|
41490
|
+
script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
|
|
41491
41491
|
})];
|
|
41492
41492
|
};
|
|
41493
41493
|
exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
|
|
@@ -44620,7 +44620,7 @@ var sanitizeForBashVariable = function (name) {
|
|
|
44620
44620
|
};
|
|
44621
44621
|
exports.sanitizeForBashVariable = sanitizeForBashVariable;
|
|
44622
44622
|
var repeatOnFailure = function (command, options) {
|
|
44623
|
-
return "\n until ".concat(command, "
|
|
44623
|
+
return "\n until ".concat(command, "\n do\n echo \"Trying again.\"\n sleep ").concat(options.pauseInSeconds, "\n done\n ");
|
|
44624
44624
|
};
|
|
44625
44625
|
exports.repeatOnFailure = repeatOnFailure;
|
|
44626
44626
|
|
|
@@ -1453,21 +1453,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
1453
1453
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1454
1454
|
}
|
|
1455
1455
|
};
|
|
1456
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
1457
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1458
|
-
if (ar || !(i in from)) {
|
|
1459
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1460
|
-
ar[i] = from[i];
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1464
|
-
};
|
|
1465
1456
|
exports.__esModule = true;
|
|
1466
1457
|
var pipeline_1 = __nccwpck_require__(25355);
|
|
1467
1458
|
var pipeline_2 = __nccwpck_require__(25355);
|
|
1468
1459
|
var child_process_promise_1 = __nccwpck_require__(75763);
|
|
1469
|
-
var fs_extra_1 = __nccwpck_require__(85501);
|
|
1470
|
-
var tmp_promise_1 = __nccwpck_require__(68841);
|
|
1471
1460
|
var getProjectConfig_1 = __nccwpck_require__(24146);
|
|
1472
1461
|
var autocompletions_1 = __nccwpck_require__(41373);
|
|
1473
1462
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1483,8 +1472,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1483
1472
|
.action(function (_a) {
|
|
1484
1473
|
var envComponent = _a.envComponent;
|
|
1485
1474
|
return __awaiter(this, void 0, void 0, function () {
|
|
1486
|
-
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort
|
|
1487
|
-
var _this = this;
|
|
1475
|
+
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort;
|
|
1488
1476
|
return __generator(this, function (_c) {
|
|
1489
1477
|
switch (_c.label) {
|
|
1490
1478
|
case 0:
|
|
@@ -1522,37 +1510,11 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
1522
1510
|
this.log("");
|
|
1523
1511
|
this.log("POSTGRESQL_URL=postgresql://".concat(DB_USER, ":").concat(DB_PASSWORD, "@localhost:").concat(localPort, "/").concat(DB_NAME, "?schema=public"));
|
|
1524
1512
|
this.log("");
|
|
1525
|
-
return [4 /*yield*/, (0,
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
return [4 /*yield*/, (0, tmp_promise_1.withFile)(function (_a) {
|
|
1529
|
-
var tmpFilePath = _a.path;
|
|
1530
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
1531
|
-
return __generator(this, function (_b) {
|
|
1532
|
-
switch (_b.label) {
|
|
1533
|
-
case 0:
|
|
1534
|
-
if (!cloudsqlProxyCredentials) return [3 /*break*/, 2];
|
|
1535
|
-
return [4 /*yield*/, (0, fs_extra_1.writeFile)(tmpFilePath, cloudsqlProxyCredentials)];
|
|
1536
|
-
case 1:
|
|
1537
|
-
_b.sent();
|
|
1538
|
-
_b.label = 2;
|
|
1539
|
-
case 2: return [4 /*yield*/, (0, child_process_promise_1.spawn)("cloud_sql_proxy", __spreadArray([
|
|
1540
|
-
"-instances",
|
|
1541
|
-
"".concat(instanceName, "=tcp:").concat(localPort)
|
|
1542
|
-
], (cloudsqlProxyCredentials
|
|
1543
|
-
? ["-credential_file", tmpFilePath]
|
|
1544
|
-
: []), true), {
|
|
1545
|
-
stdio: "inherit",
|
|
1546
|
-
shell: true
|
|
1547
|
-
})];
|
|
1548
|
-
case 3:
|
|
1549
|
-
_b.sent();
|
|
1550
|
-
return [2 /*return*/];
|
|
1551
|
-
}
|
|
1552
|
-
});
|
|
1553
|
-
});
|
|
1513
|
+
return [4 /*yield*/, (0, child_process_promise_1.spawn)("cloud_sql_proxy", ["-instances", "".concat(instanceName, "=tcp:").concat(localPort)], {
|
|
1514
|
+
stdio: "inherit",
|
|
1515
|
+
shell: true
|
|
1554
1516
|
})];
|
|
1555
|
-
case
|
|
1517
|
+
case 8:
|
|
1556
1518
|
_c.sent();
|
|
1557
1519
|
return [2 /*return*/];
|
|
1558
1520
|
}
|
|
@@ -351430,7 +351392,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
351430
351392
|
|
|
351431
351393
|
exports.__esModule = true;
|
|
351432
351394
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
351433
|
-
exports.PIPELINE_IMAGE_TAG = "main-
|
|
351395
|
+
exports.PIPELINE_IMAGE_TAG = "main-c5b17545" || 0;
|
|
351434
351396
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
351435
351397
|
|
|
351436
351398
|
/***/ }),
|
|
@@ -352770,7 +352732,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
352770
352732
|
});
|
|
352771
352733
|
return jobsWithSchedule.map(function (_a) {
|
|
352772
352734
|
var schedulerName = _a.schedulerName;
|
|
352773
|
-
return
|
|
352735
|
+
return ["gcloud scheduler jobs delete ".concat(schedulerName, " ").concat(argsString)];
|
|
352774
352736
|
}).flat();
|
|
352775
352737
|
};
|
|
352776
352738
|
var getDeleteJobsScripts = function () {
|
|
@@ -352810,7 +352772,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
352810
352772
|
variables: {
|
|
352811
352773
|
CLOUDSDK_CORE_DISABLE_PROMPTS: "1"
|
|
352812
352774
|
},
|
|
352813
|
-
script: stopScripts
|
|
352775
|
+
script: (0, gitlab_1.allowFailureInScripts)(stopScripts)
|
|
352814
352776
|
})];
|
|
352815
352777
|
};
|
|
352816
352778
|
exports.createGoogleCloudRunDeployJobs = createGoogleCloudRunDeployJobs;
|
|
@@ -355943,7 +355905,7 @@ var sanitizeForBashVariable = function (name) {
|
|
|
355943
355905
|
};
|
|
355944
355906
|
exports.sanitizeForBashVariable = sanitizeForBashVariable;
|
|
355945
355907
|
var repeatOnFailure = function (command, options) {
|
|
355946
|
-
return "\n until ".concat(command, "
|
|
355908
|
+
return "\n until ".concat(command, "\n do\n echo \"Trying again.\"\n sleep ").concat(options.pauseInSeconds, "\n done\n ");
|
|
355947
355909
|
};
|
|
355948
355910
|
exports.repeatOnFailure = repeatOnFailure;
|
|
355949
355911
|
|