@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
|
@@ -62,7 +62,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
62
62
|
.command("cloud-sql-restore-db", "restore a db from one source to another target")
|
|
63
63
|
.action(function restoreDb() {
|
|
64
64
|
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
-
var sourceInstance, sourceProxy, targetProxy, sourcePort, targetPort, sourceLocalPort, sourcePassword, sourceDbName, targetInstance, targetLocalPort, targetPassword, targetDbName, shouldContinue, targetPSQL, copyDBScript;
|
|
65
|
+
var sourceInstance, sourceProxy, targetProxy, sourcePort, targetPort, sourceLocalPort, sourceUsername, sourcePassword, sourceDbName, targetInstance, targetLocalPort, targetUsername, targetPassword, targetDbName, shouldContinue, targetPSQL, copyDBScript;
|
|
66
66
|
return __generator(this, function (_a) {
|
|
67
67
|
switch (_a.label) {
|
|
68
68
|
case 0: return [4 /*yield*/, this.prompt({
|
|
@@ -91,82 +91,98 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
91
91
|
_a.label = 5;
|
|
92
92
|
case 5: return [4 /*yield*/, this.prompt({
|
|
93
93
|
type: "input",
|
|
94
|
-
name: "
|
|
95
|
-
|
|
94
|
+
name: "sourceUsername",
|
|
95
|
+
"default": "postgres",
|
|
96
|
+
message: "Source Username? 🤔 "
|
|
96
97
|
})];
|
|
97
98
|
case 6:
|
|
99
|
+
sourceUsername = (_a.sent()).sourceUsername;
|
|
100
|
+
return [4 /*yield*/, this.prompt({
|
|
101
|
+
type: "input",
|
|
102
|
+
name: "sourcePassword",
|
|
103
|
+
message: "Source Password? 🤔 "
|
|
104
|
+
})];
|
|
105
|
+
case 7:
|
|
98
106
|
sourcePassword = (_a.sent()).sourcePassword;
|
|
99
107
|
return [4 /*yield*/, this.prompt({
|
|
100
108
|
type: "input",
|
|
101
109
|
name: "sourceDbName",
|
|
102
110
|
message: "Source DB name? 🤔 "
|
|
103
111
|
})];
|
|
104
|
-
case
|
|
112
|
+
case 8:
|
|
105
113
|
sourceDbName = (_a.sent()).sourceDbName;
|
|
106
114
|
return [4 /*yield*/, this.prompt({
|
|
107
115
|
type: "input",
|
|
108
116
|
name: "targetInstance",
|
|
109
117
|
message: "Targe INSTANCE (connection string or 'local')? 🤔 "
|
|
110
118
|
})];
|
|
111
|
-
case
|
|
119
|
+
case 9:
|
|
112
120
|
targetInstance = (_a.sent()).targetInstance;
|
|
113
|
-
if (!(targetInstance === "local")) return [3 /*break*/,
|
|
121
|
+
if (!(targetInstance === "local")) return [3 /*break*/, 11];
|
|
114
122
|
return [4 /*yield*/, this.prompt({
|
|
115
123
|
type: "number",
|
|
116
124
|
name: "targetLocalPort",
|
|
117
125
|
"default": 5432,
|
|
118
126
|
message: "Local Port for target? 🤔 "
|
|
119
127
|
})];
|
|
120
|
-
case
|
|
128
|
+
case 10:
|
|
121
129
|
targetLocalPort = (_a.sent()).targetLocalPort;
|
|
122
130
|
targetPort = targetLocalPort;
|
|
123
|
-
return [3 /*break*/,
|
|
124
|
-
case
|
|
131
|
+
return [3 /*break*/, 13];
|
|
132
|
+
case 11:
|
|
125
133
|
targetPort = 54499;
|
|
126
134
|
return [4 /*yield*/, createProxy(targetInstance, targetPort)];
|
|
127
|
-
case
|
|
135
|
+
case 12:
|
|
128
136
|
targetProxy = _a.sent();
|
|
129
|
-
_a.label =
|
|
130
|
-
case
|
|
137
|
+
_a.label = 13;
|
|
138
|
+
case 13: return [4 /*yield*/, this.prompt({
|
|
131
139
|
type: "input",
|
|
132
|
-
name: "
|
|
133
|
-
|
|
140
|
+
name: "targetUsername",
|
|
141
|
+
"default": "postgres",
|
|
142
|
+
message: "Target Username? 🤔 "
|
|
134
143
|
})];
|
|
135
|
-
case
|
|
144
|
+
case 14:
|
|
145
|
+
targetUsername = (_a.sent()).targetUsername;
|
|
146
|
+
return [4 /*yield*/, this.prompt({
|
|
147
|
+
type: "input",
|
|
148
|
+
name: "targetPassword",
|
|
149
|
+
message: "Target Password? 🤔 "
|
|
150
|
+
})];
|
|
151
|
+
case 15:
|
|
136
152
|
targetPassword = (_a.sent()).targetPassword;
|
|
137
153
|
return [4 /*yield*/, this.prompt({
|
|
138
154
|
type: "input",
|
|
139
155
|
name: "targetDbName",
|
|
140
156
|
message: "Target DB name? 🤔 "
|
|
141
157
|
})];
|
|
142
|
-
case
|
|
158
|
+
case 16:
|
|
143
159
|
targetDbName = (_a.sent()).targetDbName;
|
|
144
160
|
return [4 /*yield*/, this.prompt({
|
|
145
161
|
type: "confirm",
|
|
146
162
|
name: "shouldContinue",
|
|
147
163
|
message: "This will drop ".concat(targetInstance, "/").concat(targetDbName, " and replace it with ").concat(sourceInstance, "/").concat(sourceDbName, ". Continue? \uD83E\uDD14 ")
|
|
148
164
|
})];
|
|
149
|
-
case
|
|
165
|
+
case 17:
|
|
150
166
|
shouldContinue = (_a.sent()).shouldContinue;
|
|
151
167
|
if (!shouldContinue) {
|
|
152
168
|
return [2 /*return*/];
|
|
153
169
|
}
|
|
154
170
|
targetPSQL = function (command) {
|
|
155
|
-
return "PGPASSWORD=".concat(targetPassword, " psql -p ").concat(targetPort, " --host=localhost --user=
|
|
171
|
+
return "PGPASSWORD=".concat(targetPassword, " psql -p ").concat(targetPort, " --host=localhost --user=").concat(targetUsername, " -q ").concat(command);
|
|
156
172
|
};
|
|
157
|
-
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://
|
|
158
|
-
_a.label =
|
|
159
|
-
case
|
|
160
|
-
_a.trys.push([
|
|
173
|
+
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 ");
|
|
174
|
+
_a.label = 18;
|
|
175
|
+
case 18:
|
|
176
|
+
_a.trys.push([18, , 20, 21]);
|
|
161
177
|
return [4 /*yield*/, (0, child_process_promise_1.spawn)(copyDBScript, [], { shell: "bash", stdio: "inherit" })];
|
|
162
|
-
case
|
|
178
|
+
case 19:
|
|
163
179
|
_a.sent();
|
|
164
|
-
return [3 /*break*/,
|
|
165
|
-
case
|
|
180
|
+
return [3 /*break*/, 21];
|
|
181
|
+
case 20:
|
|
166
182
|
sourceProxy === null || sourceProxy === void 0 ? void 0 : sourceProxy.stop();
|
|
167
183
|
targetProxy === null || targetProxy === void 0 ? void 0 : targetProxy.stop();
|
|
168
184
|
return [7 /*endfinally*/];
|
|
169
|
-
case
|
|
185
|
+
case 21: return [2 /*return*/];
|
|
170
186
|
}
|
|
171
187
|
});
|
|
172
188
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandRestoreDb.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/cloudSQL/commandRestoreDb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA8C;AAG9C,IAAM,WAAW,GAAG,UAAO,QAAgB,EAAE,IAAY;;;;;gBACjD,KAAK,GAAG,IAAA,6BAAK,EACjB,qCAA8B,QAAQ,kBAAQ,IAAI,CAAE,EACpD,EAAE,EACF,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;gBACF,uBAAuB;gBACvB,qBAAM,IAAA,6BAAK,EACT,+EACoC,IAAI,2EAGrB,EACnB,EAAE,EACF,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,EAAA;;gBATD,uBAAuB;gBACvB,SAQC,CAAC;gBACI,IAAI,GAAG,cAAM,OAAA,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,EAAzB,CAAyB,CAAC;gBAC7C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBAE/B,sBAAO;wBACL,IAAI,MAAA;qBACL,EAAC;;;KACH,CAAC;AAEF,sBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CACN,sBAAsB,EACtB,gDAAgD,CACjD;iBACA,MAAM,CAAC,SAAe,SAAS;;;;;oCACH,qBAAM,IAAI,CAAC,MAAM,CAAC;oCAC3C,IAAI,EAAE,OAAO;oCACb,IAAI,EAAE,gBAAgB;oCAEtB,OAAO,EAAE,qDAAqD;iCAC/D,CAAC,EAAA;;gCALM,cAAc,GAAK,CAAA,SAKzB,CAAA,eALoB;qCAclB,CAAA,cAAc,KAAK,OAAO,CAAA,EAA1B,wBAA0B;gCACA,qBAAM,IAAI,CAAC,MAAM,CAAC;wCAC5C,IAAI,EAAE,QAAQ;wCACd,IAAI,EAAE,iBAAiB;wCACvB,SAAO,EAAE,IAAI;wCAEb,OAAO,EAAE,4BAA4B;qCACtC,CAAC,EAAA;;gCANM,eAAe,GAAK,CAAA,SAM1B,CAAA,gBANqB;gCAOvB,UAAU,GAAG,eAAe,CAAC;;;gCAE7B,UAAU,GAAG,KAAK,CAAC;gCACL,qBAAM,WAAW,CAAC,cAAc,EAAE,UAAU,CAAC,EAAA;;gCAA3D,WAAW,GAAG,SAA6C,CAAC;;oCAGnC,qBAAM,IAAI,CAAC,MAAM,CAAC;oCAC3C,IAAI,EAAE,OAAO;oCACb,IAAI,EAAE,gBAAgB;
|
|
1
|
+
{"version":3,"file":"commandRestoreDb.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/cloudSQL/commandRestoreDb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA8C;AAG9C,IAAM,WAAW,GAAG,UAAO,QAAgB,EAAE,IAAY;;;;;gBACjD,KAAK,GAAG,IAAA,6BAAK,EACjB,qCAA8B,QAAQ,kBAAQ,IAAI,CAAE,EACpD,EAAE,EACF,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;gBACF,uBAAuB;gBACvB,qBAAM,IAAA,6BAAK,EACT,+EACoC,IAAI,2EAGrB,EACnB,EAAE,EACF,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,EAAA;;gBATD,uBAAuB;gBACvB,SAQC,CAAC;gBACI,IAAI,GAAG,cAAM,OAAA,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,EAAzB,CAAyB,CAAC;gBAC7C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBAE/B,sBAAO;wBACL,IAAI,MAAA;qBACL,EAAC;;;KACH,CAAC;AAEF,sBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CACN,sBAAsB,EACtB,gDAAgD,CACjD;iBACA,MAAM,CAAC,SAAe,SAAS;;;;;oCACH,qBAAM,I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AAkB,cAAc,cAAI,YAAY,kCAAwB,cAAc,cAAI,YAAY,8BAAiB;qCACjI,CAAC,EAAA;;gCAJM,cAAc,GAAK,CAAA,SAIzB,CAAA,eAJoB;gCAMtB,IAAI,CAAC,cAAc,EAAE;oCACnB,sBAAO;iCACR;gCAEK,UAAU,GAAG,UAAC,OAAe;oCACjC,OAAA,qBAAc,cAAc,sBAAY,UAAU,sCAA4B,cAAc,iBAAO,OAAO,CAAE;gCAA5G,CAA4G,CAAC;gCAEzG,YAAY,GAAG,gKAQS,cAAc,cAAI,cAAc,wBAAc,UAAU,cAAI,YAAY,qFAEpG,UAAU,CACV,8BAAsB,YAAY,0CAAsC,CACzE,qBACC,UAAU,CAAC,gCAAwB,YAAY,qBAAiB,CAAC,2DAEjE,UAAU,CAAC,YAAI,YAAY,+BAA2B,CAAC,qHAOxD,CAAC;;;;gCAEA,qBAAM,IAAA,6BAAK,EAAC,YAAY,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAA;;gCAAlE,SAAkE,CAAC;;;gCAEnE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,EAAE,CAAC;gCACpB,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,EAAE,CAAC;;;;;;aAEvB,CAAC,EAAA;;KAAA,EAAC"}
|
|
@@ -64,7 +64,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
64
64
|
.action(function (_a) {
|
|
65
65
|
var envComponent = _a.envComponent;
|
|
66
66
|
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
-
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, instanceName, localPort, cloudsqlProxyCredentials;
|
|
67
|
+
var _b, env, componentName, context, proxyInfo, DB_PASSWORD, DB_NAME, DB_USER, instanceName, localPort, cloudsqlProxyCredentials;
|
|
68
68
|
var _this = this;
|
|
69
69
|
return __generator(this, function (_c) {
|
|
70
70
|
switch (_c.label) {
|
|
@@ -89,7 +89,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
89
89
|
return [3 /*break*/, 6];
|
|
90
90
|
case 5: throw new Error("unsupported environment");
|
|
91
91
|
case 6:
|
|
92
|
-
DB_PASSWORD = proxyInfo.DB_PASSWORD, DB_NAME = proxyInfo.DB_NAME, instanceName = proxyInfo.instanceName;
|
|
92
|
+
DB_PASSWORD = proxyInfo.DB_PASSWORD, DB_NAME = proxyInfo.DB_NAME, DB_USER = proxyInfo.DB_USER, instanceName = proxyInfo.instanceName;
|
|
93
93
|
return [4 /*yield*/, this.prompt({
|
|
94
94
|
type: "number",
|
|
95
95
|
name: "localPort",
|
|
@@ -101,7 +101,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
101
101
|
this.log("");
|
|
102
102
|
this.log("postgres-PW: ".concat(DB_PASSWORD));
|
|
103
103
|
this.log("");
|
|
104
|
-
this.log("POSTGRESQL_URL=postgresql://
|
|
104
|
+
this.log("POSTGRESQL_URL=postgresql://".concat(DB_USER, ":").concat(DB_PASSWORD, "@localhost:").concat(localPort, "/").concat(DB_NAME, "?schema=public"));
|
|
105
105
|
this.log("");
|
|
106
106
|
return [4 /*yield*/, (0, getProjectConfig_1.getGitlabVar)(this, env, componentName, "cloudsqlProxyCredentials")];
|
|
107
107
|
case 8:
|
|
@@ -168,13 +168,14 @@ var getProxyInfoForKubernetes = function (context) { return __awaiter(void 0, vo
|
|
|
168
168
|
return [2 /*return*/, {
|
|
169
169
|
instanceName: instanceName,
|
|
170
170
|
DB_PASSWORD: DB_PASSWORD,
|
|
171
|
-
DB_NAME: DB_NAME
|
|
171
|
+
DB_NAME: DB_NAME,
|
|
172
|
+
DB_USER: "postgres"
|
|
172
173
|
}];
|
|
173
174
|
}
|
|
174
175
|
});
|
|
175
176
|
}); };
|
|
176
177
|
var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
177
|
-
var envVars, DB_PASSWORD, DB_NAME;
|
|
178
|
+
var envVars, DB_PASSWORD, DB_USER, DB_NAME;
|
|
178
179
|
return __generator(this, function (_a) {
|
|
179
180
|
switch (_a.label) {
|
|
180
181
|
case 0:
|
|
@@ -186,11 +187,13 @@ var getProxyInfoForCloudRun = function (context) { return __awaiter(void 0, void
|
|
|
186
187
|
case 1:
|
|
187
188
|
envVars = _a.sent();
|
|
188
189
|
DB_PASSWORD = envVars === null || envVars === void 0 ? void 0 : envVars.DB_PASSWORD;
|
|
190
|
+
DB_USER = envVars === null || envVars === void 0 ? void 0 : envVars.DB_USER;
|
|
189
191
|
DB_NAME = context.environment.envVars.DB_NAME;
|
|
190
192
|
return [2 /*return*/, {
|
|
191
193
|
instanceName: context.componentConfig.deploy.cloudSql.instanceConnectionName,
|
|
192
194
|
DB_PASSWORD: DB_PASSWORD,
|
|
193
|
-
DB_NAME: DB_NAME
|
|
195
|
+
DB_NAME: DB_NAME,
|
|
196
|
+
DB_USER: DB_USER
|
|
194
197
|
}];
|
|
195
198
|
}
|
|
196
199
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandCloudSqlProxy.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandCloudSqlProxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAqD;AACrD,+DAA8C;AAC9C,qCAAqC;AACrC,2CAAuC;AAEvC,wEAK6C;AAC7C,2DAA2D;
|
|
1
|
+
{"version":3,"file":"commandCloudSqlProxy.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandCloudSqlProxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAqD;AACrD,+DAA8C;AAC9C,qCAAqC;AACrC,2CAAuC;AAEvC,wEAK6C;AAC7C,2DAA2D;AAQ3D,sBAA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;gBAEhB,IACE,CAAC,IAAA,yBAAc,EAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,iBAAiB,CAAC;oBAClE,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,EACxC;oBACA,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;iBAChC;gBAEe,qBAAM,IAAA,6BAAU,EAC9B,IAAI,EACJ,OAAO,CAAC,WAAW,CAAC,SAAS,EAC7B,OAAO,CAAC,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"}
|
|
@@ -39315,9 +39315,15 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
39315
39315
|
}
|
|
39316
39316
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
39317
39317
|
};
|
|
39318
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
39319
|
+
return mod && mod.__esModule ? mod : {
|
|
39320
|
+
"default": mod
|
|
39321
|
+
};
|
|
39322
|
+
};
|
|
39318
39323
|
exports.__esModule = true;
|
|
39319
39324
|
exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
39320
39325
|
var path_1 = __nccwpck_require__(1017);
|
|
39326
|
+
var slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
39321
39327
|
var getYarnCache = function (context, policy) {
|
|
39322
39328
|
var _a;
|
|
39323
39329
|
if (policy === void 0) {
|
|
@@ -39329,7 +39335,7 @@ var getYarnCache = function (context, policy) {
|
|
|
39329
39335
|
policy: policy,
|
|
39330
39336
|
paths: [".yarn"]
|
|
39331
39337
|
} : {
|
|
39332
|
-
key: context.componentConfig.dir + "-yarn",
|
|
39338
|
+
key: (0, slugify_1["default"])(context.componentConfig.dir) + "-yarn",
|
|
39333
39339
|
policy: policy,
|
|
39334
39340
|
paths: [(0, path_1.join)(context.componentConfig.dir, ".yarn")]
|
|
39335
39341
|
}];
|
|
@@ -39341,9 +39347,11 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
39341
39347
|
policy = "pull-push";
|
|
39342
39348
|
}
|
|
39343
39349
|
var componentIsInWorkspace = (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace;
|
|
39350
|
+
// 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.
|
|
39351
|
+
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
39344
39352
|
return [{
|
|
39345
39353
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
39346
|
-
key: componentIsInWorkspace ? "node-modules-workspace" : context.componentConfig.dir + "-node-modules",
|
|
39354
|
+
key: componentIsInWorkspace ? "node-modules-workspace" : (0, slugify_1["default"])(context.componentConfig.dir) + "-node-modules",
|
|
39347
39355
|
policy: policy,
|
|
39348
39356
|
paths: __spreadArray([], __read(componentIsInWorkspace ? __spreadArray(["node_modules"], __read((_c = (_b = context.packageManagerInfo) === null || _b === void 0 ? void 0 : _b.workspaces.map(function (w) {
|
|
39349
39357
|
return (0, path_1.join)(w.location, "node_modules");
|
|
@@ -39843,8 +39851,9 @@ var createRailsTestJobs = function (context) {
|
|
|
39843
39851
|
var bundlerCache = {
|
|
39844
39852
|
key: {
|
|
39845
39853
|
files: ["Gemfile.lock"],
|
|
39846
|
-
prefix: "$CI_JOB_IMAGE"
|
|
39854
|
+
prefix: "$CI_JOB_IMAGE" // a changed image might have different OS libraries which no longer work with the cached gems
|
|
39847
39855
|
},
|
|
39856
|
+
|
|
39848
39857
|
paths: [bundlerCacheDir]
|
|
39849
39858
|
};
|
|
39850
39859
|
var auditJob = buildConfig.audit !== false ? __assign(__assign({
|
|
@@ -40065,7 +40074,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40065
40074
|
|
|
40066
40075
|
exports.__esModule = true;
|
|
40067
40076
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40068
|
-
exports.PIPELINE_IMAGE_TAG = "refactor-
|
|
40077
|
+
exports.PIPELINE_IMAGE_TAG = "refactor-args-52277d47" || 0;
|
|
40069
40078
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40070
40079
|
|
|
40071
40080
|
/***/ }),
|
|
@@ -41122,7 +41131,7 @@ var getBaseDeploymentJob = function (context) {
|
|
|
41122
41131
|
return {
|
|
41123
41132
|
name: exports.DEPLOY_JOB_NAME,
|
|
41124
41133
|
envMode: "stagePerEnv",
|
|
41125
|
-
|
|
41134
|
+
needsOtherComponent: context.componentConfig.deploy ? (_c = (_b = context.componentConfig.deploy.waitFor) === null || _b === void 0 ? void 0 : _b.map(function (c) {
|
|
41126
41135
|
return {
|
|
41127
41136
|
componentName: c,
|
|
41128
41137
|
job: exports.DEPLOY_JOB_NAME,
|
|
@@ -41248,6 +41257,7 @@ var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(2607);
|
|
|
41248
41257
|
var database_1 = __nccwpck_require__(1384);
|
|
41249
41258
|
var gitlab_1 = __nccwpck_require__(4997);
|
|
41250
41259
|
var jobName_1 = __nccwpck_require__(7311);
|
|
41260
|
+
var createArgsString_1 = __nccwpck_require__(8686);
|
|
41251
41261
|
var setExtraVarsScripts = function (deployConfig) {
|
|
41252
41262
|
return ["export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ".concat(deployConfig.projectId, " --format=\"value(projectNumber)\")"), "echo \"GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER\""];
|
|
41253
41263
|
};
|
|
@@ -41273,9 +41283,12 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41273
41283
|
value = _b[1];
|
|
41274
41284
|
return "".concat(key, "=").concat(value);
|
|
41275
41285
|
}).join(",");
|
|
41276
|
-
var commonArgs =
|
|
41286
|
+
var commonArgs = (0, createArgsString_1.createArgsString)({
|
|
41287
|
+
project: deployConfig.projectId,
|
|
41288
|
+
region: deployConfig.region
|
|
41289
|
+
});
|
|
41277
41290
|
var cloudRunArgs = deployConfig.cloudSql ? "--set-cloudsql-instances=".concat(deployConfig.cloudSql.instanceConnectionName) : "";
|
|
41278
|
-
var commonDeployArgs = "--image
|
|
41291
|
+
var commonDeployArgs = "--image=".concat(gcloudImageName, " ").concat(commonArgs, " ").concat(cloudRunArgs, " --labels=").concat(labelsString);
|
|
41279
41292
|
var serviceName = context.environment.fullName.toLowerCase();
|
|
41280
41293
|
var getFullJobName = function (name) {
|
|
41281
41294
|
return (0, jobName_1.getCloudRunJobName)(context.environment.fullName, name);
|
|
@@ -41315,16 +41328,7 @@ var createGoogleCloudRunDeployJobs = function (context) {
|
|
|
41315
41328
|
"max-instances": customConfig === null || customConfig === void 0 ? void 0 : customConfig.maxInstances,
|
|
41316
41329
|
"no-cpu-throttling": customConfig === null || customConfig === void 0 ? void 0 : customConfig.noCpuThrottling
|
|
41317
41330
|
};
|
|
41318
|
-
var argsString =
|
|
41319
|
-
var _b = __read(_a, 2),
|
|
41320
|
-
value = _b[1];
|
|
41321
|
-
return !(0, lodash_1.isNil)(value);
|
|
41322
|
-
}).map(function (_a) {
|
|
41323
|
-
var _b = __read(_a, 2),
|
|
41324
|
-
key = _b[0],
|
|
41325
|
-
value = _b[1];
|
|
41326
|
-
return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
|
|
41327
|
-
}).join(" ");
|
|
41331
|
+
var argsString = (0, createArgsString_1.createArgsString)(args);
|
|
41328
41332
|
return "gcloud run deploy ".concat(serviceName).concat(nameSuffix !== null && nameSuffix !== void 0 ? nameSuffix : "", " ").concat(commandArg, " ").concat(commonDeployArgs, " --env-vars-file=____envvars.yaml ").concat(argsString);
|
|
41329
41333
|
};
|
|
41330
41334
|
var getJobCreateScriptsForJob = function (jobName, job) {
|
|
@@ -41468,7 +41472,7 @@ var jobName_1 = __nccwpck_require__(7311);
|
|
|
41468
41472
|
exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
|
|
41469
41473
|
exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
|
|
41470
41474
|
var getCloudSqlVariables = function (_a) {
|
|
41471
|
-
var _b, _c;
|
|
41475
|
+
var _b, _c, _d;
|
|
41472
41476
|
var deployConfigRaw = _a.deployConfigRaw,
|
|
41473
41477
|
environmentSlug = _a.environmentSlug,
|
|
41474
41478
|
env = _a.env,
|
|
@@ -41485,7 +41489,7 @@ var getCloudSqlVariables = function (_a) {
|
|
|
41485
41489
|
return {
|
|
41486
41490
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME: deployConfigRaw.cloudSql.instanceConnectionName,
|
|
41487
41491
|
DB_NAME: DB_NAME,
|
|
41488
|
-
DB_USER: "postgres",
|
|
41492
|
+
DB_USER: (_d = deployConfigRaw.cloudSql.dbUser) !== null && _d !== void 0 ? _d : "postgres",
|
|
41489
41493
|
DB_PASSWORD: "$" + (0, context_1.getSecretVarName)(env, componentName, "DB_PASSWORD"),
|
|
41490
41494
|
DATABASE_URL: "postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME".concat(additionalQueryParamsString),
|
|
41491
41495
|
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)
|
|
@@ -41530,6 +41534,63 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
41530
41534
|
|
|
41531
41535
|
/***/ }),
|
|
41532
41536
|
|
|
41537
|
+
/***/ 8686:
|
|
41538
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
41539
|
+
|
|
41540
|
+
"use strict";
|
|
41541
|
+
|
|
41542
|
+
|
|
41543
|
+
var __read = this && this.__read || function (o, n) {
|
|
41544
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
41545
|
+
if (!m) return o;
|
|
41546
|
+
var i = m.call(o),
|
|
41547
|
+
r,
|
|
41548
|
+
ar = [],
|
|
41549
|
+
e;
|
|
41550
|
+
try {
|
|
41551
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
41552
|
+
} catch (error) {
|
|
41553
|
+
e = {
|
|
41554
|
+
error: error
|
|
41555
|
+
};
|
|
41556
|
+
} finally {
|
|
41557
|
+
try {
|
|
41558
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
41559
|
+
} finally {
|
|
41560
|
+
if (e) throw e.error;
|
|
41561
|
+
}
|
|
41562
|
+
}
|
|
41563
|
+
return ar;
|
|
41564
|
+
};
|
|
41565
|
+
exports.__esModule = true;
|
|
41566
|
+
exports.createArgsString = void 0;
|
|
41567
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
41568
|
+
/**
|
|
41569
|
+
* creates arguments string:
|
|
41570
|
+
*
|
|
41571
|
+
* --key=value
|
|
41572
|
+
*
|
|
41573
|
+
* - undefined or null values will get removed completly
|
|
41574
|
+
* - true will just be "--key"
|
|
41575
|
+
* @param args args record
|
|
41576
|
+
* @returns
|
|
41577
|
+
*/
|
|
41578
|
+
var createArgsString = function (args) {
|
|
41579
|
+
return Object.entries(args).filter(function (_a) {
|
|
41580
|
+
var _b = __read(_a, 2),
|
|
41581
|
+
value = _b[1];
|
|
41582
|
+
return !(0, lodash_1.isNil)(value);
|
|
41583
|
+
}).map(function (_a) {
|
|
41584
|
+
var _b = __read(_a, 2),
|
|
41585
|
+
key = _b[0],
|
|
41586
|
+
value = _b[1];
|
|
41587
|
+
return "--".concat(key).concat(value !== true ? "=".concat(value) : "");
|
|
41588
|
+
}).join(" ");
|
|
41589
|
+
};
|
|
41590
|
+
exports.createArgsString = createArgsString;
|
|
41591
|
+
|
|
41592
|
+
/***/ }),
|
|
41593
|
+
|
|
41533
41594
|
/***/ 1384:
|
|
41534
41595
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
41535
41596
|
|
|
@@ -42151,6 +42212,16 @@ exports.createKubeEnv = createKubeEnv;
|
|
|
42151
42212
|
"use strict";
|
|
42152
42213
|
|
|
42153
42214
|
|
|
42215
|
+
var __assign = this && this.__assign || function () {
|
|
42216
|
+
__assign = Object.assign || function (t) {
|
|
42217
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
42218
|
+
s = arguments[i];
|
|
42219
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
42220
|
+
}
|
|
42221
|
+
return t;
|
|
42222
|
+
};
|
|
42223
|
+
return __assign.apply(this, arguments);
|
|
42224
|
+
};
|
|
42154
42225
|
var __rest = this && this.__rest || function (s, e) {
|
|
42155
42226
|
var t = {};
|
|
42156
42227
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -42159,6 +42230,28 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
42159
42230
|
}
|
|
42160
42231
|
return t;
|
|
42161
42232
|
};
|
|
42233
|
+
var __read = this && this.__read || function (o, n) {
|
|
42234
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
42235
|
+
if (!m) return o;
|
|
42236
|
+
var i = m.call(o),
|
|
42237
|
+
r,
|
|
42238
|
+
ar = [],
|
|
42239
|
+
e;
|
|
42240
|
+
try {
|
|
42241
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
42242
|
+
} catch (error) {
|
|
42243
|
+
e = {
|
|
42244
|
+
error: error
|
|
42245
|
+
};
|
|
42246
|
+
} finally {
|
|
42247
|
+
try {
|
|
42248
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
42249
|
+
} finally {
|
|
42250
|
+
if (e) throw e.error;
|
|
42251
|
+
}
|
|
42252
|
+
}
|
|
42253
|
+
return ar;
|
|
42254
|
+
};
|
|
42162
42255
|
exports.__esModule = true;
|
|
42163
42256
|
exports.createKubeValues = void 0;
|
|
42164
42257
|
var lodash_1 = __nccwpck_require__(3255);
|
|
@@ -42199,6 +42292,14 @@ var createAppConfig = function (context, application) {
|
|
|
42199
42292
|
);
|
|
42200
42293
|
};
|
|
42201
42294
|
|
|
42295
|
+
var removeFalsy = function (record) {
|
|
42296
|
+
if (!record) return undefined;
|
|
42297
|
+
return Object.fromEntries(Object.entries(record).filter(function (_a) {
|
|
42298
|
+
var _b = __read(_a, 2),
|
|
42299
|
+
value = _b[1];
|
|
42300
|
+
return value !== false;
|
|
42301
|
+
}));
|
|
42302
|
+
};
|
|
42202
42303
|
var createKubeValues = function (context) {
|
|
42203
42304
|
var _a, _b;
|
|
42204
42305
|
var deployConfig = context.componentConfig.deploy;
|
|
@@ -42215,13 +42316,18 @@ var createKubeValues = function (context) {
|
|
|
42215
42316
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
42216
42317
|
var _c = values !== null && values !== void 0 ? values : {},
|
|
42217
42318
|
application = _c.application,
|
|
42218
|
-
|
|
42319
|
+
jobs = _c.jobs,
|
|
42320
|
+
cronjobs = _c.cronjobs,
|
|
42321
|
+
rest = __rest(_c, ["application", "jobs", "cronjobs"]);
|
|
42219
42322
|
var env = (0, kubeEnv_1.createKubeEnv)(context);
|
|
42220
42323
|
var defaultKubeValues = (0, lodash_1.merge)({
|
|
42221
42324
|
env: env,
|
|
42222
42325
|
application: createAppConfig(context, application)
|
|
42223
42326
|
}, (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) : {});
|
|
42224
|
-
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues,
|
|
42327
|
+
var kubeValues = (0, processSecretsAsFiles_1.processSecretsAsFiles)((0, utils_1.mergeWithMergingArrays)(defaultKubeValues, __assign({
|
|
42328
|
+
jobs: removeFalsy(jobs),
|
|
42329
|
+
cronjobs: removeFalsy(cronjobs)
|
|
42330
|
+
}, rest)));
|
|
42225
42331
|
return kubeValues;
|
|
42226
42332
|
};
|
|
42227
42333
|
exports.createKubeValues = createKubeValues;
|
|
@@ -43270,14 +43376,19 @@ var getFullReferencedJobName = function (referencedJobName, componentName, env,
|
|
|
43270
43376
|
var replaceReferences = function (job, componentName, env, allRawJobs) {
|
|
43271
43377
|
var _a, _b, _c;
|
|
43272
43378
|
var stage = job.envMode === "stagePerEnv" ? "".concat(job.stage, " ").concat(env) : job.stage;
|
|
43273
|
-
var
|
|
43274
|
-
var needs = cleanedNeeds === null || cleanedNeeds === void 0 ? void 0 : cleanedNeeds.map(function (n) {
|
|
43275
|
-
var _a;
|
|
43379
|
+
var needsFromNeeds = (_a = job.needs) === null || _a === void 0 ? void 0 : _a.map(function (n) {
|
|
43276
43380
|
return (0, lodash_1.isObject)(n) ? {
|
|
43277
|
-
job: getFullReferencedJobName(n.job,
|
|
43381
|
+
job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
|
|
43278
43382
|
artifacts: n.artifacts
|
|
43279
43383
|
} : getFullReferencedJobName(n, componentName, env, allRawJobs);
|
|
43280
43384
|
});
|
|
43385
|
+
var needsFromOtherComponents = (_b = job.needsOtherComponent) === null || _b === void 0 ? void 0 : _b.map(function (other) {
|
|
43386
|
+
return {
|
|
43387
|
+
artifacts: other.artifacts,
|
|
43388
|
+
job: getFullReferencedJobName(other.job, other.componentName, env, allRawJobs)
|
|
43389
|
+
};
|
|
43390
|
+
});
|
|
43391
|
+
var needs = __spreadArray(__spreadArray([], __read(needsFromNeeds !== null && needsFromNeeds !== void 0 ? needsFromNeeds : []), false), __read(needsFromOtherComponents !== null && needsFromOtherComponents !== void 0 ? needsFromOtherComponents : []), false);
|
|
43281
43392
|
return __assign(__assign({}, job), {
|
|
43282
43393
|
stage: stage,
|
|
43283
43394
|
needs: needs,
|
|
@@ -43390,37 +43501,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
43390
43501
|
}
|
|
43391
43502
|
return t;
|
|
43392
43503
|
};
|
|
43393
|
-
var __read = this && this.__read || function (o, n) {
|
|
43394
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
43395
|
-
if (!m) return o;
|
|
43396
|
-
var i = m.call(o),
|
|
43397
|
-
r,
|
|
43398
|
-
ar = [],
|
|
43399
|
-
e;
|
|
43400
|
-
try {
|
|
43401
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
43402
|
-
} catch (error) {
|
|
43403
|
-
e = {
|
|
43404
|
-
error: error
|
|
43405
|
-
};
|
|
43406
|
-
} finally {
|
|
43407
|
-
try {
|
|
43408
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
43409
|
-
} finally {
|
|
43410
|
-
if (e) throw e.error;
|
|
43411
|
-
}
|
|
43412
|
-
}
|
|
43413
|
-
return ar;
|
|
43414
|
-
};
|
|
43415
|
-
var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
43416
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
43417
|
-
if (ar || !(i in from)) {
|
|
43418
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
43419
|
-
ar[i] = from[i];
|
|
43420
|
-
}
|
|
43421
|
-
}
|
|
43422
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
43423
|
-
};
|
|
43424
43504
|
exports.__esModule = true;
|
|
43425
43505
|
exports.makeGitlabJob = void 0;
|
|
43426
43506
|
var lodash_1 = __nccwpck_require__(3255);
|
|
@@ -43437,9 +43517,9 @@ var makeGitlabJob = function (_a) {
|
|
|
43437
43517
|
rest = __rest(_a, ["envMode", "needsStages", "needsOtherComponent", "name", "needs"]);
|
|
43438
43518
|
return __assign(__assign({}, rest), {
|
|
43439
43519
|
// sort in a predictable manner for snapshot tests
|
|
43440
|
-
needs: needs ?
|
|
43520
|
+
needs: needs === null || needs === void 0 ? void 0 : needs.sort(function (a, b) {
|
|
43441
43521
|
return getJobName(a).localeCompare(getJobName(b));
|
|
43442
|
-
})
|
|
43522
|
+
}),
|
|
43443
43523
|
retry: defaults_1.BASE_RETRY,
|
|
43444
43524
|
interruptible: true
|
|
43445
43525
|
});
|