@catladder/cli 0.0.0-fix-add-openssl-dep-5500a6f2 → 0.0.0-fix-octal-fa642ad4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/apps/cli/cli.js +2 -0
  2. package/dist/apps/cli/cli.js.map +1 -1
  3. package/dist/apps/cli/commands/{project/commandCopyDB.d.ts → cloudSQL/commandRestoreDb.d.ts} +0 -0
  4. package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js +176 -0
  5. package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +1 -0
  6. package/dist/apps/cli/commands/cloudSQL/index.d.ts +3 -0
  7. package/dist/apps/cli/commands/{project/commandCopyDB.js → cloudSQL/index.js} +9 -39
  8. package/dist/apps/cli/commands/cloudSQL/index.js.map +1 -0
  9. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +1 -1
  10. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -1
  11. package/dist/apps/cli/commands/project/index.js +0 -2
  12. package/dist/apps/cli/commands/project/index.js.map +1 -1
  13. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +1 -1
  14. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -1
  15. package/dist/apps/cli/verify/migration/oldGitlabCi.js +1 -1
  16. package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -1
  17. package/dist/bundles/catenv/index.js +291 -24
  18. package/dist/bundles/cli/index.js +536 -116
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +2 -2
  21. package/src/apps/cli/cli.ts +2 -0
  22. package/src/apps/cli/commands/cloudSQL/commandRestoreDb.ts +154 -0
  23. package/src/apps/cli/commands/cloudSQL/index.ts +8 -0
  24. package/src/apps/cli/commands/project/commandGetMyTotalWorktime.ts +1 -1
  25. package/src/apps/cli/commands/project/index.ts +1 -2
  26. package/src/apps/cli/commands/theStuffThatReallyMatters/index.ts +1 -1
  27. package/src/apps/cli/verify/migration/oldGitlabCi.ts +1 -1
  28. package/dist/apps/cli/commands/project/commandCopyDB.js.map +0 -1
  29. package/src/apps/cli/commands/project/commandCopyDB.ts +0 -92
@@ -52,6 +52,7 @@ var packageInfos_1 = __importDefault(__nccwpck_require__(71628));
52
52
  var portForward_1 = __nccwpck_require__(34353);
53
53
  var general_1 = __importDefault(__nccwpck_require__(3605));
54
54
  var mongodb_1 = __importDefault(__nccwpck_require__(52934));
55
+ var cloudSQL_1 = __importDefault(__nccwpck_require__(6675));
55
56
  var project_1 = __importDefault(__nccwpck_require__(44143));
56
57
  var theStuffThatReallyMatters_1 = __importDefault(__nccwpck_require__(36265));
57
58
  var verify_1 = __nccwpck_require__(98434);
@@ -76,6 +77,7 @@ exports["default"] = (function () { return __awaiter(void 0, void 0, void 0, fun
76
77
  (0, verify_1.verify)(vorpal);
77
78
  (0, general_1["default"])(vorpal);
78
79
  (0, project_1["default"])(vorpal);
80
+ (0, cloudSQL_1["default"])(vorpal);
79
81
  (0, mongodb_1["default"])(vorpal);
80
82
  (0, theStuffThatReallyMatters_1["default"])(vorpal);
81
83
  process.on("exit", function () {
@@ -89,6 +91,246 @@ exports["default"] = (function () { return __awaiter(void 0, void 0, void 0, fun
89
91
 
90
92
  /***/ }),
91
93
 
94
+ /***/ 61833:
95
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
96
+
97
+ "use strict";
98
+
99
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
100
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
101
+ return new (P || (P = Promise))(function (resolve, reject) {
102
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
103
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
104
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
105
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
106
+ });
107
+ };
108
+ var __generator = (this && this.__generator) || function (thisArg, body) {
109
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
110
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
111
+ function verb(n) { return function (v) { return step([n, v]); }; }
112
+ function step(op) {
113
+ if (f) throw new TypeError("Generator is already executing.");
114
+ while (_) try {
115
+ 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;
116
+ if (y = 0, t) op = [op[0] & 2, t.value];
117
+ switch (op[0]) {
118
+ case 0: case 1: t = op; break;
119
+ case 4: _.label++; return { value: op[1], done: false };
120
+ case 5: _.label++; y = op[1]; op = [0]; continue;
121
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
122
+ default:
123
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
124
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
125
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
126
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
127
+ if (t[2]) _.ops.pop();
128
+ _.trys.pop(); continue;
129
+ }
130
+ op = body.call(thisArg, _);
131
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
132
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
133
+ }
134
+ };
135
+ exports.__esModule = true;
136
+ var child_process_promise_1 = __nccwpck_require__(75763);
137
+ var createProxy = function (instance, port) { return __awaiter(void 0, void 0, void 0, function () {
138
+ var proxy, stop;
139
+ return __generator(this, function (_a) {
140
+ switch (_a.label) {
141
+ case 0:
142
+ proxy = (0, child_process_promise_1.spawn)("cloud_sql_proxy -instances ".concat(instance, "=tcp:").concat(port), [], { shell: "bash" });
143
+ // wait until it starts
144
+ return [4 /*yield*/, (0, child_process_promise_1.spawn)("echo -n \"Waiting for proxy\"\n until echo > /dev/tcp/localhost/".concat(port, "; do\n sleep 0.2\n echo -n \".\"\n done 2>/dev/null"), [], { shell: "bash" })];
145
+ case 1:
146
+ // wait until it starts
147
+ _a.sent();
148
+ stop = function () { return proxy.childProcess.kill(); };
149
+ process.on("beforeExit", stop);
150
+ return [2 /*return*/, {
151
+ stop: stop
152
+ }];
153
+ }
154
+ });
155
+ }); };
156
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
157
+ return __generator(this, function (_a) {
158
+ return [2 /*return*/, vorpal
159
+ .command("cloud-sql-restore-db", "restore a db from one source to another target")
160
+ .action(function restoreDb() {
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;
163
+ return __generator(this, function (_a) {
164
+ switch (_a.label) {
165
+ case 0: return [4 /*yield*/, this.prompt({
166
+ type: "input",
167
+ name: "sourceInstance",
168
+ message: "Source instance (connection string or 'local')? 🤔 "
169
+ })];
170
+ case 1:
171
+ sourceInstance = (_a.sent()).sourceInstance;
172
+ if (!(sourceInstance === "local")) return [3 /*break*/, 3];
173
+ return [4 /*yield*/, this.prompt({
174
+ type: "number",
175
+ name: "sourceLocalPort",
176
+ "default": 5432,
177
+ message: "Local Port for source? 🤔 "
178
+ })];
179
+ case 2:
180
+ sourceLocalPort = (_a.sent()).sourceLocalPort;
181
+ sourcePort = sourceLocalPort;
182
+ return [3 /*break*/, 5];
183
+ case 3:
184
+ sourcePort = 54399;
185
+ return [4 /*yield*/, createProxy(sourceInstance, sourcePort)];
186
+ case 4:
187
+ sourceProxy = _a.sent();
188
+ _a.label = 5;
189
+ case 5: return [4 /*yield*/, this.prompt({
190
+ type: "input",
191
+ name: "sourcePassword",
192
+ message: "Source Password? 🤔 "
193
+ })];
194
+ case 6:
195
+ sourcePassword = (_a.sent()).sourcePassword;
196
+ return [4 /*yield*/, this.prompt({
197
+ type: "input",
198
+ name: "sourceDbName",
199
+ message: "Source DB name? 🤔 "
200
+ })];
201
+ case 7:
202
+ sourceDbName = (_a.sent()).sourceDbName;
203
+ return [4 /*yield*/, this.prompt({
204
+ type: "input",
205
+ name: "targetInstance",
206
+ message: "Targe INSTANCE (connection string or 'local')? 🤔 "
207
+ })];
208
+ case 8:
209
+ targetInstance = (_a.sent()).targetInstance;
210
+ if (!(targetInstance === "local")) return [3 /*break*/, 10];
211
+ return [4 /*yield*/, this.prompt({
212
+ type: "number",
213
+ name: "targetLocalPort",
214
+ "default": 5432,
215
+ message: "Local Port for target? 🤔 "
216
+ })];
217
+ case 9:
218
+ targetLocalPort = (_a.sent()).targetLocalPort;
219
+ targetPort = targetLocalPort;
220
+ return [3 /*break*/, 12];
221
+ case 10:
222
+ targetPort = 54499;
223
+ return [4 /*yield*/, createProxy(targetInstance, targetPort)];
224
+ case 11:
225
+ targetProxy = _a.sent();
226
+ _a.label = 12;
227
+ case 12: return [4 /*yield*/, this.prompt({
228
+ type: "input",
229
+ name: "targetPassword",
230
+ message: "Target Password? 🤔 "
231
+ })];
232
+ case 13:
233
+ targetPassword = (_a.sent()).targetPassword;
234
+ return [4 /*yield*/, this.prompt({
235
+ type: "input",
236
+ name: "targetDbName",
237
+ message: "Target DB name? 🤔 "
238
+ })];
239
+ case 14:
240
+ targetDbName = (_a.sent()).targetDbName;
241
+ return [4 /*yield*/, this.prompt({
242
+ type: "confirm",
243
+ name: "shouldContinue",
244
+ message: "This will drop ".concat(targetInstance, "/").concat(targetDbName, " and replace it with ").concat(sourceInstance, "/").concat(sourceDbName, ". Continue? \uD83E\uDD14 ")
245
+ })];
246
+ case 15:
247
+ shouldContinue = (_a.sent()).shouldContinue;
248
+ if (!shouldContinue) {
249
+ return [2 /*return*/];
250
+ }
251
+ targetPSQL = function (command) {
252
+ return "PGPASSWORD=".concat(targetPassword, " psql -p ").concat(targetPort, " --host=localhost --user=postgres -q ").concat(command);
253
+ };
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://postgres:".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 ");
255
+ _a.label = 16;
256
+ case 16:
257
+ _a.trys.push([16, , 18, 19]);
258
+ return [4 /*yield*/, (0, child_process_promise_1.spawn)(copyDBScript, [], { shell: "bash", stdio: "inherit" })];
259
+ case 17:
260
+ _a.sent();
261
+ return [3 /*break*/, 19];
262
+ case 18:
263
+ sourceProxy === null || sourceProxy === void 0 ? void 0 : sourceProxy.stop();
264
+ targetProxy === null || targetProxy === void 0 ? void 0 : targetProxy.stop();
265
+ return [7 /*endfinally*/];
266
+ case 19: return [2 /*return*/];
267
+ }
268
+ });
269
+ });
270
+ })];
271
+ });
272
+ }); });
273
+ //# sourceMappingURL=commandRestoreDb.js.map
274
+
275
+ /***/ }),
276
+
277
+ /***/ 6675:
278
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
279
+
280
+ "use strict";
281
+
282
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
283
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
284
+ return new (P || (P = Promise))(function (resolve, reject) {
285
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
286
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
287
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
288
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
289
+ });
290
+ };
291
+ var __generator = (this && this.__generator) || function (thisArg, body) {
292
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
293
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
294
+ function verb(n) { return function (v) { return step([n, v]); }; }
295
+ function step(op) {
296
+ if (f) throw new TypeError("Generator is already executing.");
297
+ while (_) try {
298
+ 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;
299
+ if (y = 0, t) op = [op[0] & 2, t.value];
300
+ switch (op[0]) {
301
+ case 0: case 1: t = op; break;
302
+ case 4: _.label++; return { value: op[1], done: false };
303
+ case 5: _.label++; y = op[1]; op = [0]; continue;
304
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
305
+ default:
306
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
307
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
308
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
309
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
310
+ if (t[2]) _.ops.pop();
311
+ _.trys.pop(); continue;
312
+ }
313
+ op = body.call(thisArg, _);
314
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
315
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
316
+ }
317
+ };
318
+ var __importDefault = (this && this.__importDefault) || function (mod) {
319
+ return (mod && mod.__esModule) ? mod : { "default": mod };
320
+ };
321
+ exports.__esModule = true;
322
+ //import commandInitProject from "./commandInitProject.old";
323
+ var commandRestoreDb_1 = __importDefault(__nccwpck_require__(61833));
324
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
325
+ return __generator(this, function (_a) {
326
+ (0, commandRestoreDb_1["default"])(vorpal);
327
+ return [2 /*return*/];
328
+ });
329
+ }); });
330
+ //# sourceMappingURL=index.js.map
331
+
332
+ /***/ }),
333
+
92
334
  /***/ 3605:
93
335
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
94
336
 
@@ -1664,93 +1906,6 @@ var templateObject_1;
1664
1906
 
1665
1907
  /***/ }),
1666
1908
 
1667
- /***/ 45420:
1668
- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
1669
-
1670
- "use strict";
1671
-
1672
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
1673
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1674
- return new (P || (P = Promise))(function (resolve, reject) {
1675
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1676
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1677
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1678
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1679
- });
1680
- };
1681
- var __generator = (this && this.__generator) || function (thisArg, body) {
1682
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1683
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1684
- function verb(n) { return function (v) { return step([n, v]); }; }
1685
- function step(op) {
1686
- if (f) throw new TypeError("Generator is already executing.");
1687
- while (_) try {
1688
- 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;
1689
- if (y = 0, t) op = [op[0] & 2, t.value];
1690
- switch (op[0]) {
1691
- case 0: case 1: t = op; break;
1692
- case 4: _.label++; return { value: op[1], done: false };
1693
- case 5: _.label++; y = op[1]; op = [0]; continue;
1694
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
1695
- default:
1696
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1697
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1698
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1699
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1700
- if (t[2]) _.ops.pop();
1701
- _.trys.pop(); continue;
1702
- }
1703
- op = body.call(thisArg, _);
1704
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1705
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1706
- }
1707
- };
1708
- exports.__esModule = true;
1709
- var getProjectConfig_1 = __nccwpck_require__(24146);
1710
- var autocompletions_1 = __nccwpck_require__(41373);
1711
- exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
1712
- var _a, _b;
1713
- return __generator(this, function (_c) {
1714
- switch (_c.label) {
1715
- case 0:
1716
- _b = (_a = vorpal
1717
- .command("copy-db <envComponent>", "replace local db with the one from an env"))
1718
- .autocomplete;
1719
- return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
1720
- case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
1721
- .action(function copyDB(_a) {
1722
- var envComponent = _a.envComponent;
1723
- return __awaiter(this, void 0, void 0, function () {
1724
- var _b, env, componentName, _c, customerName, appName, shouldContinue;
1725
- return __generator(this, function (_d) {
1726
- switch (_d.label) {
1727
- case 0:
1728
- _b = (0, getProjectConfig_1.parseChoice)(envComponent), env = _b.env, componentName = _b.componentName;
1729
- return [4 /*yield*/, (0, getProjectConfig_1.getProjectConfig)()];
1730
- case 1:
1731
- _c = _d.sent(), customerName = _c.customerName, appName = _c.appName;
1732
- return [4 /*yield*/, this.prompt({
1733
- type: "confirm",
1734
- name: "shouldContinue",
1735
- message: "This will drop your local database and replace it with the remote one. Continue? 🤔 "
1736
- })];
1737
- case 2:
1738
- shouldContinue = (_d.sent()).shouldContinue;
1739
- if (!shouldContinue) {
1740
- return [2 /*return*/];
1741
- }
1742
- return [2 /*return*/];
1743
- }
1744
- });
1745
- });
1746
- })];
1747
- }
1748
- });
1749
- }); });
1750
- //# sourceMappingURL=commandCopyDB.js.map
1751
-
1752
- /***/ }),
1753
-
1754
1909
  /***/ 77042:
1755
1910
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
1756
1911
 
@@ -2114,7 +2269,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
2114
2269
  .action(function () { return __awaiter(void 0, void 0, void 0, function () {
2115
2270
  return __generator(this, function (_a) {
2116
2271
  switch (_a.label) {
2117
- case 0: return [4 /*yield*/, (0, child_process_promise_1.spawn)("sh", ["-c", "curl -L http://bit.ly/10hA8iC | bash"], {
2272
+ case 0: return [4 /*yield*/, (0, child_process_promise_1.spawn)("sh", ["-c", "curl -s -L http://bit.ly/3VQEKNq | bash"], {
2118
2273
  stdio: ["pipe", "inherit", "pipe"]
2119
2274
  })];
2120
2275
  case 1:
@@ -3889,7 +4044,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3889
4044
  exports.__esModule = true;
3890
4045
  var commandCloudSqlProxy_1 = __importDefault(__nccwpck_require__(23526));
3891
4046
  var commandConfigSecrets_1 = __importDefault(__nccwpck_require__(80883));
3892
- var commandCopyDB_1 = __importDefault(__nccwpck_require__(45420));
3893
4047
  var commandDeletePods_1 = __importDefault(__nccwpck_require__(77042));
3894
4048
  var commandDeleteProject_1 = __importDefault(__nccwpck_require__(75582));
3895
4049
  var commandEnvVars_1 = __importDefault(__nccwpck_require__(31692));
@@ -3932,7 +4086,6 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
3932
4086
  (0, commandConfigSecrets_1["default"])(vorpal);
3933
4087
  (0, commandSecretsClearBackups_1["default"])(vorpal);
3934
4088
  (0, commandDeletePods_1["default"])(vorpal);
3935
- (0, commandCopyDB_1["default"])(vorpal);
3936
4089
  (0, commandGetShell_1["default"])(vorpal);
3937
4090
  (0, commandPortForward_1["default"])(vorpal);
3938
4091
  (0, commandGitlabCi_1["default"])(vorpal);
@@ -5046,7 +5199,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
5046
5199
  return __generator(this, function (_a) {
5047
5200
  switch (_a.label) {
5048
5201
  case 0:
5049
- starwarsPromise = (0, child_process_promise_1.spawn)("telnet", ["towel.blinkenlights.nl"], {
5202
+ starwarsPromise = (0, child_process_promise_1.spawn)("telnet", ["2001:7b8:666:ffff::1:42"], {
5050
5203
  stdio: ["pipe", "inherit", "pipe"]
5051
5204
  });
5052
5205
  return [4 /*yield*/, starwarsPromise];
@@ -5845,7 +5998,7 @@ var detectBuildConfig = function (gitlabCi) {
5845
5998
  return "meteor";
5846
5999
  }
5847
6000
  if (firstInclude.file === "rails-kubernetes.yml") {
5848
- throw new Error("rails is not yet implemented");
6001
+ return "rails";
5849
6002
  }
5850
6003
  };
5851
6004
  exports.detectBuildConfig = detectBuildConfig;
@@ -349720,7 +349873,7 @@ var yarn_1 = __nccwpck_require__(10464);
349720
349873
 
349721
349874
  var constants_1 = __nccwpck_require__(11542);
349722
349875
 
349723
- var getBuildInfo_1 = __nccwpck_require__(9197);
349876
+ var writeBuildInfo_1 = __nccwpck_require__(51754);
349724
349877
 
349725
349878
  var createBuildJob = function (context, _a) {
349726
349879
  var _b, _c, _d, _e;
@@ -349737,7 +349890,7 @@ var createBuildJob = function (context, _a) {
349737
349890
  needs: [],
349738
349891
  cache: [],
349739
349892
  variables: __assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
349740
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, getBuildInfo_1.getBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_c = (0, utils_1.ensureArray)(script)) !== null && _c !== void 0 ? _c : []), false),
349893
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_c = (0, utils_1.ensureArray)(script)) !== null && _c !== void 0 ? _c : []), false),
349741
349894
  artifacts: {
349742
349895
  paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
349743
349896
  reports: {
@@ -349753,22 +349906,22 @@ exports.createBuildJob = createBuildJob;
349753
349906
 
349754
349907
  /***/ }),
349755
349908
 
349756
- /***/ 9197:
349909
+ /***/ 51754:
349757
349910
  /***/ ((__unused_webpack_module, exports) => {
349758
349911
 
349759
349912
  "use strict";
349760
349913
 
349761
349914
 
349762
349915
  exports.__esModule = true;
349763
- exports.getBuildInfo = void 0;
349916
+ exports.writeBuildInfo = void 0;
349764
349917
 
349765
- var getBuildInfo = function (context) {
349918
+ var writeBuildInfo = function (context) {
349766
349919
  var _a, _b;
349767
349920
 
349768
349921
  return ["echo '{\"id\":\"".concat((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.buildId, "\",\"time\":\"").concat((_b = context.commitInfo) === null || _b === void 0 ? void 0 : _b.buildTime, "\"}' > ").concat(context.componentConfig.dir, "/__build_info.json")];
349769
349922
  };
349770
349923
 
349771
- exports.getBuildInfo = getBuildInfo;
349924
+ exports.writeBuildInfo = writeBuildInfo;
349772
349925
 
349773
349926
  /***/ }),
349774
349927
 
@@ -350144,6 +350297,8 @@ var custom_1 = __nccwpck_require__(53437);
350144
350297
 
350145
350298
  var node_1 = __nccwpck_require__(66994);
350146
350299
 
350300
+ var rails_1 = __nccwpck_require__(34665);
350301
+
350147
350302
  __exportStar(__nccwpck_require__(71197), exports);
350148
350303
 
350149
350304
  __exportStar(__nccwpck_require__(66994), exports);
@@ -350187,6 +350342,12 @@ exports.BUILD_TYPES = {
350187
350342
  defaults: function () {
350188
350343
  return {};
350189
350344
  }
350345
+ },
350346
+ rails: {
350347
+ jobs: rails_1.createRailsJobs,
350348
+ defaults: function () {
350349
+ return {};
350350
+ }
350190
350351
  }
350191
350352
  };
350192
350353
 
@@ -350801,6 +350962,220 @@ exports.getYarnInstall = getYarnInstall;
350801
350962
 
350802
350963
  /***/ }),
350803
350964
 
350965
+ /***/ 38597:
350966
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
350967
+
350968
+ "use strict";
350969
+
350970
+
350971
+ var __assign = this && this.__assign || function () {
350972
+ __assign = Object.assign || function (t) {
350973
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
350974
+ s = arguments[i];
350975
+
350976
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
350977
+ }
350978
+
350979
+ return t;
350980
+ };
350981
+
350982
+ return __assign.apply(this, arguments);
350983
+ };
350984
+
350985
+ exports.__esModule = true;
350986
+ exports.createRailsBuildJobs = void 0;
350987
+
350988
+ var docker_1 = __nccwpck_require__(33219);
350989
+
350990
+ var createRailsBuildJobs = function (context) {
350991
+ return [(0, docker_1.createDockerBuildJobBase)(context, {
350992
+ variables: __assign({
350993
+ CNB_BUILDER: "heroku/buildpacks:18",
350994
+ CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH",
350995
+ CNB_EXTRA_ARGS: "",
350996
+ CNB_PACK_VERSION: "0.20.0"
350997
+ }, context.componentConfig.build.extraVars),
350998
+ // custom script
350999
+ script: [docker_1.gitlabDockerLogin, "docker pull $DOCKER_CACHE_IMAGE || true", "wget --output-document=- https://github.com/buildpacks/pack/releases/download/v$CNB_PACK_VERSION/pack-v$CNB_PACK_VERSION-linux.tgz | tar -zx --directory /usr/local/bin pack", "chmod +x /usr/local/bin/pack", // replace private git ssh gem sources with https to make bundler with credentials via env var work
351000
+ // eslint-disable-next-line no-useless-escape
351001
+ "sed --in-place 's|git@([^:]*):|https://\\1/|g' Gemfile Gemfile.lock", "for v in $CNB_ENV_VARS; do env_args=\"$env_args --env $v\"; done", "pack build $DOCKER_IMAGE:$DOCKER_IMAGE_TAG --builder $CNB_BUILDER --publish --cache-image $DOCKER_CACHE_IMAGE $env_args $CNB_EXTRA_ARGS"]
351002
+ })];
351003
+ };
351004
+
351005
+ exports.createRailsBuildJobs = createRailsBuildJobs;
351006
+
351007
+ /***/ }),
351008
+
351009
+ /***/ 34665:
351010
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
351011
+
351012
+ "use strict";
351013
+
351014
+
351015
+ var __read = this && this.__read || function (o, n) {
351016
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
351017
+ if (!m) return o;
351018
+ var i = m.call(o),
351019
+ r,
351020
+ ar = [],
351021
+ e;
351022
+
351023
+ try {
351024
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
351025
+ } catch (error) {
351026
+ e = {
351027
+ error: error
351028
+ };
351029
+ } finally {
351030
+ try {
351031
+ if (r && !r.done && (m = i["return"])) m.call(i);
351032
+ } finally {
351033
+ if (e) throw e.error;
351034
+ }
351035
+ }
351036
+
351037
+ return ar;
351038
+ };
351039
+
351040
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
351041
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
351042
+ if (ar || !(i in from)) {
351043
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
351044
+ ar[i] = from[i];
351045
+ }
351046
+ }
351047
+ return to.concat(ar || Array.prototype.slice.call(from));
351048
+ };
351049
+
351050
+ exports.__esModule = true;
351051
+ exports.createRailsJobs = void 0;
351052
+
351053
+ var build_1 = __nccwpck_require__(38597);
351054
+
351055
+ var test_1 = __nccwpck_require__(25444);
351056
+
351057
+ var createRailsJobs = function (context) {
351058
+ return __spreadArray(__spreadArray([], __read((0, test_1.createRailsTestJobs)(context)), false), __read((0, build_1.createRailsBuildJobs)(context)), false);
351059
+ };
351060
+
351061
+ exports.createRailsJobs = createRailsJobs;
351062
+
351063
+ /***/ }),
351064
+
351065
+ /***/ 25444:
351066
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
351067
+
351068
+ "use strict";
351069
+
351070
+
351071
+ var __assign = this && this.__assign || function () {
351072
+ __assign = Object.assign || function (t) {
351073
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
351074
+ s = arguments[i];
351075
+
351076
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
351077
+ }
351078
+
351079
+ return t;
351080
+ };
351081
+
351082
+ return __assign.apply(this, arguments);
351083
+ };
351084
+
351085
+ var __read = this && this.__read || function (o, n) {
351086
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
351087
+ if (!m) return o;
351088
+ var i = m.call(o),
351089
+ r,
351090
+ ar = [],
351091
+ e;
351092
+
351093
+ try {
351094
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
351095
+ } catch (error) {
351096
+ e = {
351097
+ error: error
351098
+ };
351099
+ } finally {
351100
+ try {
351101
+ if (r && !r.done && (m = i["return"])) m.call(i);
351102
+ } finally {
351103
+ if (e) throw e.error;
351104
+ }
351105
+ }
351106
+
351107
+ return ar;
351108
+ };
351109
+
351110
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
351111
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
351112
+ if (ar || !(i in from)) {
351113
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
351114
+ ar[i] = from[i];
351115
+ }
351116
+ }
351117
+ return to.concat(ar || Array.prototype.slice.call(from));
351118
+ };
351119
+
351120
+ exports.__esModule = true;
351121
+ exports.createRailsTestJobs = void 0;
351122
+
351123
+ var utils_1 = __nccwpck_require__(37461);
351124
+
351125
+ var createRailsTestJobs = function (context) {
351126
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; // don't run tests after release
351127
+
351128
+
351129
+ if (((_a = context.commitInfo) === null || _a === void 0 ? void 0 : _a.trigger) === "taggedRelease") {
351130
+ return [];
351131
+ }
351132
+
351133
+ var buildConfig = context.componentConfig.build;
351134
+ var base = {
351135
+ variables: (_b = buildConfig.extraVars) !== null && _b !== void 0 ? _b : {},
351136
+ stage: "test",
351137
+ needs: [],
351138
+ envMode: "none"
351139
+ };
351140
+ var defaultImage = "docker.io/ruby";
351141
+ var bundlerCacheDir = "tmp/cache";
351142
+ var bundlerInstall = ["bundle config set path '".concat(bundlerCacheDir, "'"), "bundle install -j $(nproc)"];
351143
+ var bundlerCache = {
351144
+ key: {
351145
+ files: ["Gemfile.lock"],
351146
+ prefix: "$CI_JOB_IMAGE"
351147
+ },
351148
+ paths: [bundlerCacheDir]
351149
+ };
351150
+ var auditJob = buildConfig.audit !== false ? __assign(__assign({
351151
+ name: "🛡 audit"
351152
+ }, base), {
351153
+ cache: undefined,
351154
+ image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
351155
+ script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
351156
+ allow_failure: true
351157
+ }) : null;
351158
+ var lintJob = buildConfig.lint !== false ? __assign(__assign({
351159
+ name: "👮 lint"
351160
+ }, base), {
351161
+ cache: bundlerCache,
351162
+ image: (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : defaultImage,
351163
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_k = (0, utils_1.ensureArray)((_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.command)) !== null && _k !== void 0 ? _k : ["bundle exec rubocop"]), false)
351164
+ }) : null;
351165
+ var testJob = buildConfig.test !== false ? __assign(__assign({
351166
+ name: "🧪 test"
351167
+ }, base), {
351168
+ cache: bundlerCache,
351169
+ image: (_m = (_l = buildConfig.test) === null || _l === void 0 ? void 0 : _l.jobImage) !== null && _m !== void 0 ? _m : defaultImage,
351170
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_p = (0, utils_1.ensureArray)((_o = buildConfig.test) === null || _o === void 0 ? void 0 : _o.command)) !== null && _p !== void 0 ? _p : ["bundle exec rspec"]), false)
351171
+ }) : null;
351172
+ return [auditJob, lintJob, testJob].filter(utils_1.notNil);
351173
+ };
351174
+
351175
+ exports.createRailsTestJobs = createRailsTestJobs;
351176
+
351177
+ /***/ }),
351178
+
350804
351179
  /***/ 71197:
350805
351180
  /***/ ((__unused_webpack_module, exports) => {
350806
351181
 
@@ -351025,7 +351400,7 @@ exports.readConfigSync = readConfigSync;
351025
351400
 
351026
351401
  exports.__esModule = true;
351027
351402
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
351028
- exports.PIPELINE_IMAGE_TAG = "fix-add-openssl-dep-5500a6f2" || 0;
351403
+ exports.PIPELINE_IMAGE_TAG = "fix-octal-fa642ad4" || 0;
351029
351404
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
351030
351405
 
351031
351406
  /***/ }),
@@ -351568,8 +351943,9 @@ var getEnvironmentVariables = function (config, componentName, env, commitInfo,
351568
351943
  additionalEnvVars = deployConfigRaw ? deploy_1.DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(environmentContext) : {};
351569
351944
  host = (_c = (_b = envConfigRaw === null || envConfigRaw === void 0 ? void 0 : envConfigRaw.host) !== null && _b !== void 0 ? _b : additionalEnvVars.HOST_CANONICAL) !== null && _c !== void 0 ? _c : "unknown-host.example.com";
351570
351945
  url = "https://".concat(host);
351571
- predefinedVariables = __assign(__assign(__assign({}, basePredefinedVariables), {
351572
- HOST: host,
351946
+ predefinedVariables = __assign(__assign(__assign(__assign({}, basePredefinedVariables), config.components[componentName].build.type === "rails" ? {} : {
351947
+ HOST: host
351948
+ }), {
351573
351949
  ROOT_URL: url
351574
351950
  }), additionalEnvVars);
351575
351951
  }
@@ -352507,7 +352883,7 @@ var setExtraVarsScripts = function (deployConfig) {
352507
352883
  };
352508
352884
 
352509
352885
  var createGoogleCloudRunDeployJobs = function (context) {
352510
- var _a;
352886
+ var _a, _b, _c;
352511
352887
 
352512
352888
  var deployConfig = context.componentConfig.deploy;
352513
352889
 
@@ -352567,12 +352943,31 @@ var createGoogleCloudRunDeployJobs = function (context) {
352567
352943
  };
352568
352944
  });
352569
352945
 
352570
- var getServiceDeployScript = function (service) {
352946
+ var getServiceDeployScript = function (service, nameSuffix) {
352571
352947
  var _a;
352572
352948
 
352949
+ var customConfig = service !== true ? service : undefined;
352573
352950
  var command = service !== true ? (_a = service === null || service === void 0 ? void 0 : service.command) !== null && _a !== void 0 ? _a : context.componentConfig.build.startCommand : undefined;
352574
352951
  var commandArg = command ? "--command=\"".concat(command.split(" ").join(","), "\"") : "";
352575
- return "gcloud run deploy ".concat(serviceName, " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml --allow-unauthenticated");
352952
+ var args = {
352953
+ "allow-unauthenticated": true,
352954
+ "min-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.minInstances,
352955
+ "max-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances,
352956
+ "no-cpu-throttling": customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling
352957
+ };
352958
+ var argsString = Object.entries(args).filter(function (_a) {
352959
+ var _b = __read(_a, 2),
352960
+ value = _b[1];
352961
+
352962
+ return !(0, lodash_1.isNil)(value);
352963
+ }).map(function (_a) {
352964
+ var _b = __read(_a, 2),
352965
+ key = _b[0],
352966
+ value = _b[1];
352967
+
352968
+ return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
352969
+ }).join(" ");
352970
+ return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml ").concat(argsString);
352576
352971
  };
352577
352972
 
352578
352973
  var getJobCreateScriptsForJob = function (jobName, job) {
@@ -352629,10 +353024,21 @@ var createGoogleCloudRunDeployJobs = function (context) {
352629
353024
  });
352630
353025
  };
352631
353026
 
352632
- var deployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(setExtraVarsScripts(deployConfig)), false), __read(pushImageToArtifactsRegistry), false), ["echo \"$ENV_VARS\" > ____envvars.yaml"], false), __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
352633
- : []), false), __read(getCreateScheduleScripts()), false), __read(getJobCreateScripts()), false), __read(getJobRunScripts("preDeploy")), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(getJobRunScripts("postDeploy")), false), ["docker image rm ".concat(gcloudImageName)], false);
353027
+ var deployScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(setExtraVarsScripts(deployConfig)), false), __read(pushImageToArtifactsRegistry), false), ["echo \"$ENV_VARS\" > ____envvars.yaml"], false), __read(deployConfig.cloudSql ? (0, database_1.getDatabaseCreateScript)(context, deployConfig) // we create the db, so that we can also delete it afterwards
353028
+ : []), false), __read(getCreateScheduleScripts()), false), __read(getJobCreateScripts()), false), __read(getJobRunScripts("preDeploy")), false), __read(deployConfig.service !== false ? [getServiceDeployScript(deployConfig.service)] : []), false), __read(Object.entries((_b = deployConfig.additionalServices) !== null && _b !== void 0 ? _b : {}).map(function (_a) {
353029
+ var _b = __read(_a, 2),
353030
+ name = _b[0],
353031
+ service = _b[1];
353032
+
353033
+ return getServiceDeployScript(service, "-" + name);
353034
+ })), false), __read(getJobRunScripts("postDeploy")), false), ["docker image rm ".concat(gcloudImageName)], false);
353035
+
353036
+ var stopScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgs)] : []), false), __read(Object.entries((_c = deployConfig.additionalServices) !== null && _c !== void 0 ? _c : {}).map(function (_a) {
353037
+ var _b = __read(_a, 1),
353038
+ name = _b[0];
352634
353039
 
352635
- var stopScripts = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), __read(deployConfig.service !== false ? ["gcloud run services delete ".concat(serviceName, " ").concat(commonArgs)] : []), false), __read(getDeleteSchedulesScripts()), false), __read(getDeleteJobsScripts()), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false);
353040
+ return "gcloud run services delete ".concat(serviceName, "-").concat(name, " ").concat(commonArgs);
353041
+ })), false), __read(getDeleteSchedulesScripts()), false), __read(getDeleteJobsScripts()), false), __read(deployConfig.cloudSql && deployConfig.cloudSql.deleteDatabaseOnStop ? (0, database_1.getDatabaseDeleteScript)(context, deployConfig) : []), false);
352636
353042
 
352637
353043
  return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
352638
353044
  artifacts: {
@@ -352731,7 +353137,7 @@ exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
352731
353137
  exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
352732
353138
 
352733
353139
  var getCloudSqlVariables = function (_a) {
352734
- var _b;
353140
+ var _b, _c;
352735
353141
 
352736
353142
  var deployConfigRaw = _a.deployConfigRaw,
352737
353143
  environmentSlug = _a.environmentSlug,
@@ -352741,13 +353147,20 @@ var getCloudSqlVariables = function (_a) {
352741
353147
 
352742
353148
  if (deployConfigRaw && deployConfigRaw.cloudSql) {
352743
353149
  var DB_NAME = [(_b = deployConfigRaw.cloudSql.dbNamePrefix) !== null && _b !== void 0 ? _b : "".concat(fullConfig.customerName, "-").concat(fullConfig.appName), environmentSlug].filter(Boolean).join("-");
353150
+ var additionalQueryParamsString = Object.entries((_c = deployConfigRaw.cloudSql.dbAdditionalQueryParams) !== null && _c !== void 0 ? _c : {}).map(function (_a) {
353151
+ var _b = __read(_a, 2),
353152
+ key = _b[0],
353153
+ value = _b[1];
353154
+
353155
+ return "&".concat(key, "=").concat(value);
353156
+ }).join("");
352744
353157
  return {
352745
353158
  CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
352746
353159
  DB_NAME: DB_NAME,
352747
353160
  DB_USER: "postgres",
352748
353161
  DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
352749
- DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME",
352750
- 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"
353162
+ DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
353163
+ 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)
352751
353164
  };
352752
353165
  }
352753
353166
 
@@ -352969,11 +353382,15 @@ var lodash_1 = __nccwpck_require__(23255);
352969
353382
 
352970
353383
  var yarn_1 = __nccwpck_require__(10464);
352971
353384
 
353385
+ var runner_1 = __nccwpck_require__(55071);
353386
+
352972
353387
  var base_1 = __nccwpck_require__(89177);
352973
353388
 
352974
353389
  var types_1 = __nccwpck_require__(63109);
352975
353390
 
352976
353391
  var createCustomDeployJobs = function (context) {
353392
+ var _a, _b;
353393
+
352977
353394
  var deployConfig = context.componentConfig.deploy;
352978
353395
 
352979
353396
  if (deployConfig === false) {
@@ -352988,6 +353405,8 @@ var createCustomDeployJobs = function (context) {
352988
353405
  var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
352989
353406
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
352990
353407
  return [(0, lodash_1.merge)({}, baseDeploymentJob, {
353408
+ image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
353409
+ cache: (_b = deployConfig.jobCache) !== null && _b !== void 0 ? _b : [],
352991
353410
  script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(deployConfig.requiresYarnInstall ? yarnInstall : []), false), __read(deployConfig.script), false)
352992
353411
  })];
352993
353412
  };
@@ -355166,25 +355585,26 @@ exports.getPackageManagerInfo = getPackageManagerInfo;
355166
355585
 
355167
355586
 
355168
355587
  exports.__esModule = true;
355169
- exports.RULES_RELEASE = exports.RULES_ALWAYS = void 0;
355170
- var NEVER_ON_RELEASE_COMMIT = {
355588
+ exports.RULES_RELEASE = exports.RULE_CONDITION_MAIN_BRANCH = exports.RULES_ALWAYS = exports.RULE_NEVER_ON_RELEASE_COMMIT = void 0;
355589
+ exports.RULE_NEVER_ON_RELEASE_COMMIT = {
355171
355590
  "if": "$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",
355172
355591
  when: "never"
355173
355592
  };
355174
355593
  exports.RULES_ALWAYS = [{
355175
355594
  "if": "$CI_COMMIT_TAG"
355176
- }, NEVER_ON_RELEASE_COMMIT, {
355595
+ }, exports.RULE_NEVER_ON_RELEASE_COMMIT, {
355177
355596
  "if": "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/"
355178
355597
  }, {
355179
355598
  "if": "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
355180
355599
  }, {
355181
355600
  "if": "$CI_MERGE_REQUEST_ID"
355182
355601
  }];
355183
- exports.RULES_RELEASE = [NEVER_ON_RELEASE_COMMIT, {
355184
- "if": '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $AUTO_RELEASE == "true"',
355602
+ exports.RULE_CONDITION_MAIN_BRANCH = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";
355603
+ exports.RULES_RELEASE = [exports.RULE_NEVER_ON_RELEASE_COMMIT, {
355604
+ "if": exports.RULE_CONDITION_MAIN_BRANCH + ' && $AUTO_RELEASE == "true"',
355185
355605
  when: "on_success"
355186
355606
  }, {
355187
- "if": "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH",
355607
+ "if": exports.RULE_CONDITION_MAIN_BRANCH,
355188
355608
  when: "manual"
355189
355609
  }, {
355190
355610
  "if": "$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/",