@catladder/cli 0.0.0-update-meteor-53480fed → 0.0.0-update-docker-f59d0d91
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/CONTRIBUTING.md +17 -12
- package/README.md +19 -12
- package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js +12 -7
- package/dist/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +1 -1
- package/dist/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.d.ts +3 -0
- package/dist/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +189 -0
- package/dist/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -0
- package/dist/apps/cli/commands/project/index.js +2 -0
- package/dist/apps/cli/commands/project/index.js.map +1 -1
- package/dist/bundles/catenv/index.js +6 -4
- package/dist/bundles/cli/index.js +434 -12
- package/dist/gcloud/cloudSql/copyDb.d.ts +12 -0
- package/dist/gcloud/cloudSql/copyDb.js +64 -0
- package/dist/gcloud/cloudSql/copyDb.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -2
- package/src/apps/cli/commands/cloudSQL/commandRestoreDb.ts +11 -29
- package/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts +175 -0
- package/src/apps/cli/commands/project/index.ts +2 -0
- package/src/gcloud/cloudSql/copyDb.ts +57 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
#### Atomic commits
|
|
4
4
|
|
|
5
|
-
If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means:
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
5
|
+
If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means that a commit should:
|
|
6
|
+
|
|
7
|
+
- Contain exactly one self-contained functional change
|
|
8
|
+
- Not depend on changes in one of your later commits
|
|
9
|
+
- Not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc…)
|
|
9
10
|
|
|
10
11
|
A complex feature can be broken down into multiple commits as long as each one maintains a consistent state and consists of a self-contained change.
|
|
11
12
|
|
|
@@ -27,7 +28,8 @@ The **footer** can contain a [closing reference to an issue](https://help.github
|
|
|
27
28
|
|
|
28
29
|
#### Revert
|
|
29
30
|
|
|
30
|
-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
|
|
31
|
+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
|
|
32
|
+
In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
|
31
33
|
|
|
32
34
|
#### Type
|
|
33
35
|
|
|
@@ -42,25 +44,28 @@ The type must be one of the following:
|
|
|
42
44
|
| **fix** | A bug fix |
|
|
43
45
|
| **perf** | A code change that improves performance |
|
|
44
46
|
| **refactor** | A code change that neither fixes a bug nor adds a feature |
|
|
45
|
-
| **style** | Changes that do not affect the meaning of the code (white-space, formatting, missing
|
|
47
|
+
| **style** | Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc) |
|
|
46
48
|
| **test** | Adding missing tests or correcting existing tests |
|
|
47
49
|
|
|
48
50
|
#### Subject
|
|
49
51
|
|
|
50
|
-
The subject contains succinct description of the change:
|
|
52
|
+
The subject contains a succinct description of the change:
|
|
51
53
|
|
|
52
54
|
- use the imperative, present tense: "change" not "changed" nor "changes"
|
|
53
|
-
- don't capitalize first letter
|
|
55
|
+
- don't capitalize the first letter
|
|
54
56
|
- no dot (.) at the end
|
|
55
57
|
|
|
56
58
|
#### Body
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
|
|
60
|
+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
|
61
|
+
The body should include the motivation for the change and contrast this with previous behaviour.
|
|
59
62
|
|
|
60
63
|
#### Footer
|
|
64
|
+
|
|
61
65
|
The footer should contain any information about **Breaking Changes** and is also the place to reference GitLab issues that this commit **Closes**.
|
|
62
66
|
|
|
63
|
-
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
|
|
67
|
+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
|
|
68
|
+
The rest of the commit message is then used for this.
|
|
64
69
|
|
|
65
70
|
#### Examples
|
|
66
71
|
|
|
@@ -80,4 +85,4 @@ perf(pencil): remove graphiteWidth option`
|
|
|
80
85
|
BREAKING CHANGE: The graphiteWidth option has been removed.
|
|
81
86
|
|
|
82
87
|
The default graphite width of 10mm is always used for performance reasons.
|
|
83
|
-
```
|
|
88
|
+
```
|
package/README.md
CHANGED
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
# catladder 🐱 🔧
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Panter cli tool for Kubernetes.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```sh
|
|
8
|
+
# yarn users
|
|
9
|
+
yarn global add @catladder/cli
|
|
10
|
+
# npm users
|
|
11
|
+
npm install -g @catladder/cli
|
|
12
|
+
```
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`npm install -g @catladder/cli`
|
|
12
|
-
|
|
13
|
-
_Note: if you have `@panter/catladder` installed upgrade it to >=4.0.0 before installing `@catladder/cli`_
|
|
14
|
+
> **Note**: If you have [@catladder/pipeline](https://www.npmjs.com/package/@catladder/pipeline) installed, upgrade it to >=4.0.0 before installing [@catladder/cli](https://www.npmjs.com/package/@catladder/cli).
|
|
14
15
|
|
|
15
16
|
## Getting started
|
|
16
17
|
|
|
17
|
-
You'll need
|
|
18
|
+
You'll need:
|
|
18
19
|
|
|
19
20
|
- Google Cloud SDK ([see installation instructions](https://cloud.google.com/sdk/docs/install))
|
|
20
21
|
- Kubectl ([see installation instructions](https://kubernetes.io/docs/tasks/tools/))
|
|
21
22
|
- Cloud SQL Auth proxy ([see installation instructions](https://cloud.google.com/sql/docs/postgres/sql-proxy#install))
|
|
22
23
|
|
|
23
|
-
Afterwards you need to connect to your cluster, e.g. `gcloud container clusters get-credentials clustername --zone google-zone --project google-project-id`
|
|
24
|
-
In most cases you'll find the details on the Google Cloud [cluster overview ](https://console.cloud.google.com/kubernetes/list?project=skynet-164509)
|
|
24
|
+
Afterwards, you need to connect to your cluster, e.g. `gcloud container clusters get-credentials clustername --zone google-zone --project google-project-id`
|
|
25
|
+
In most cases, you'll find the details on the Google Cloud [cluster overview ](https://console.cloud.google.com/kubernetes/list?project=skynet-164509)
|
|
25
26
|
|
|
26
27
|
It just works™
|
|
27
28
|
|
|
28
29
|
## Preferences
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
Catladder stores some preferences in `~/.catladder/preferences.yml` in case you want to change settings.
|
|
31
32
|
|
|
32
33
|
## Contribution
|
|
33
34
|
|
|
34
|
-
Check the
|
|
35
|
+
Check the documentation [here](https://git.panter.ch/catladder/catladder/-/tree/main/cli/CONTRIBUTING.md).
|
|
36
|
+
|
|
37
|
+
### Adding packages in cli
|
|
38
|
+
|
|
39
|
+
if you add npm libs in cli, make sure to add them as dev-dependencies.
|
|
40
|
+
|
|
41
|
+
the reason is that we bundle all dependencies in the cli package, so that if you add that to your project, it won't install all @catladder/cli's dependencies.
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
|
-
var
|
|
39
|
+
var copyDb_1 = require("../../../../gcloud/cloudSql/copyDb");
|
|
40
40
|
var startProxy_1 = require("../../../../gcloud/cloudSql/startProxy");
|
|
41
41
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
42
|
return __generator(this, function (_a) {
|
|
@@ -44,7 +44,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
44
44
|
.command("cloud-sql-restore-db", "restore a db from one source to another target")
|
|
45
45
|
.action(function restoreDb() {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
-
var sourceInstance, sourceProxy, targetProxy, sourcePort, targetPort, sourceLocalPort, sourceUsername, sourcePassword, sourceDbName, targetInstance, targetLocalPort, targetUsername, targetPassword, targetDbName, shouldContinue
|
|
47
|
+
var sourceInstance, sourceProxy, targetProxy, sourcePort, targetPort, sourceLocalPort, sourceUsername, sourcePassword, sourceDbName, targetInstance, targetLocalPort, targetUsername, targetPassword, targetDbName, shouldContinue;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0: return [4 /*yield*/, this.prompt({
|
|
@@ -155,14 +155,19 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
155
155
|
if (!shouldContinue) {
|
|
156
156
|
return [2 /*return*/];
|
|
157
157
|
}
|
|
158
|
-
targetPSQL = function (command) {
|
|
159
|
-
return "PGPASSWORD=".concat(targetPassword, " psql -p ").concat(targetPort, " --host=localhost --user=").concat(targetUsername, " -q ").concat(command);
|
|
160
|
-
};
|
|
161
|
-
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 ");
|
|
162
158
|
_a.label = 18;
|
|
163
159
|
case 18:
|
|
164
160
|
_a.trys.push([18, , 20, 21]);
|
|
165
|
-
return [4 /*yield*/, (0,
|
|
161
|
+
return [4 /*yield*/, (0, copyDb_1.spawnCopyDb)({
|
|
162
|
+
targetPassword: targetPassword,
|
|
163
|
+
targetPort: targetPort,
|
|
164
|
+
targetUsername: targetUsername,
|
|
165
|
+
sourceUsername: sourceUsername,
|
|
166
|
+
sourcePassword: sourcePassword,
|
|
167
|
+
sourcePort: sourcePort,
|
|
168
|
+
sourceDbName: sourceDbName,
|
|
169
|
+
targetDbName: targetDbName
|
|
170
|
+
})];
|
|
166
171
|
case 19:
|
|
167
172
|
_a.sent();
|
|
168
173
|
return [3 /*break*/, 21];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandRestoreDb.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/cloudSQL/commandRestoreDb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"commandRestoreDb.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/cloudSQL/commandRestoreDb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6DAAiE;AAEjE,qEAAwF;AAExF,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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Ac,gBAAA;wCACd,cAAc,gBAAA;wCACd,cAAc,gBAAA;wCACd,UAAU,YAAA;wCACV,YAAY,cAAA;wCACZ,YAAY,cAAA;qCACb,CAAC,EAAA;;gCATF,SASE,CAAC;;;gCAEH,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,EAAE,CAAC;gCACpB,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,EAAE,CAAC;;;;;;aAEvB,CAAC,EAAA;;KAAA,EAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
var getProjectConfig_1 = require("../../../../../config/getProjectConfig");
|
|
40
|
+
var startProxy_1 = require("../../../../../gcloud/cloudSql/startProxy");
|
|
41
|
+
var autocompletions_1 = require("../utils/autocompletions");
|
|
42
|
+
var connection_string_parser_1 = require("connection-string-parser");
|
|
43
|
+
var copyDb_1 = require("../../../../../gcloud/cloudSql/copyDb");
|
|
44
|
+
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
return [2 /*return*/, vorpal
|
|
47
|
+
.command("project-cloud-sql-restore-db", "restores a project db from one source to another target")
|
|
48
|
+
.action(function restoreDb() {
|
|
49
|
+
var _a, _b, _c, _d;
|
|
50
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
+
var envs, sourceEnvAndComponent, _e, sourceEnv, sourceComponent, sourceContext, sourceEnvVars, sourceProxy, sourceDbName, sourceUsername, sourcePassword, targetUsername, targetPassword, targetProxy, sourcePort, targetPort, targetDbName, closeAll, parser, parsersResult, targetEnvAndComponent, _f, targetEnv, targetComponent, targetContext, targetEnvVars, parser, parsersResult, shouldContinue, confirmInstance;
|
|
52
|
+
return __generator(this, function (_g) {
|
|
53
|
+
switch (_g.label) {
|
|
54
|
+
case 0: return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
|
|
55
|
+
case 1:
|
|
56
|
+
envs = _g.sent();
|
|
57
|
+
return [4 /*yield*/, this.prompt({
|
|
58
|
+
type: "list",
|
|
59
|
+
name: "sourceEnvAndComponent",
|
|
60
|
+
choices: envs,
|
|
61
|
+
message: "Source instance (connection string or 'local')? 🤔 "
|
|
62
|
+
})];
|
|
63
|
+
case 2:
|
|
64
|
+
sourceEnvAndComponent = (_g.sent()).sourceEnvAndComponent;
|
|
65
|
+
_e = sourceEnvAndComponent.split(":"), sourceEnv = _e[0], sourceComponent = _e[1];
|
|
66
|
+
return [4 /*yield*/, (0, getProjectConfig_1.getPipelineContextByChoice)(sourceEnv, sourceComponent)];
|
|
67
|
+
case 3:
|
|
68
|
+
sourceContext = _g.sent();
|
|
69
|
+
return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(this, sourceContext.environment.shortName, sourceContext.componentName)];
|
|
70
|
+
case 4:
|
|
71
|
+
sourceEnvVars = _g.sent();
|
|
72
|
+
closeAll = function () {
|
|
73
|
+
sourceProxy === null || sourceProxy === void 0 ? void 0 : sourceProxy.stop();
|
|
74
|
+
targetProxy === null || targetProxy === void 0 ? void 0 : targetProxy.stop();
|
|
75
|
+
};
|
|
76
|
+
if (!(sourceEnv === "local")) return [3 /*break*/, 5];
|
|
77
|
+
parser = new connection_string_parser_1.ConnectionStringParser({
|
|
78
|
+
scheme: "postgres",
|
|
79
|
+
hosts: []
|
|
80
|
+
});
|
|
81
|
+
parsersResult = parser.parse(sourceEnvVars.DATABASE_URL);
|
|
82
|
+
sourcePort = (_b = (_a = parsersResult.hosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.port;
|
|
83
|
+
sourceUsername = parsersResult.username;
|
|
84
|
+
sourcePassword = parsersResult.password;
|
|
85
|
+
sourceDbName = parsersResult.endpoint;
|
|
86
|
+
return [3 /*break*/, 7];
|
|
87
|
+
case 5:
|
|
88
|
+
sourcePort = 54399;
|
|
89
|
+
return [4 /*yield*/, (0, startProxy_1.startCloudSqlProxyInBackground)({
|
|
90
|
+
instanceName: sourceEnvVars.CLOUD_SQL_INSTANCE_CONNECTION_NAME,
|
|
91
|
+
localPort: sourcePort
|
|
92
|
+
})];
|
|
93
|
+
case 6:
|
|
94
|
+
sourceProxy = _g.sent();
|
|
95
|
+
sourceUsername = sourceEnvVars.DB_USER;
|
|
96
|
+
sourcePassword = sourceEnvVars.DB_PASSWORD;
|
|
97
|
+
sourceDbName = sourceEnvVars.DB_NAME;
|
|
98
|
+
_g.label = 7;
|
|
99
|
+
case 7: return [4 /*yield*/, this.prompt({
|
|
100
|
+
type: "list",
|
|
101
|
+
name: "targetEnvAndComponent",
|
|
102
|
+
choices: envs,
|
|
103
|
+
message: "target env? 🤔 "
|
|
104
|
+
})];
|
|
105
|
+
case 8:
|
|
106
|
+
targetEnvAndComponent = (_g.sent()).targetEnvAndComponent;
|
|
107
|
+
_f = targetEnvAndComponent.split(":"), targetEnv = _f[0], targetComponent = _f[1];
|
|
108
|
+
return [4 /*yield*/, (0, getProjectConfig_1.getPipelineContextByChoice)(targetEnv, targetComponent)];
|
|
109
|
+
case 9:
|
|
110
|
+
targetContext = _g.sent();
|
|
111
|
+
return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(this, targetContext.environment.shortName, targetContext.componentName)];
|
|
112
|
+
case 10:
|
|
113
|
+
targetEnvVars = _g.sent();
|
|
114
|
+
if (!(targetEnv === "local")) return [3 /*break*/, 11];
|
|
115
|
+
parser = new connection_string_parser_1.ConnectionStringParser({
|
|
116
|
+
scheme: "postgres",
|
|
117
|
+
hosts: []
|
|
118
|
+
});
|
|
119
|
+
parsersResult = parser.parse(targetEnvVars.DATABASE_URL);
|
|
120
|
+
targetPort = (_d = (_c = parsersResult.hosts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.port;
|
|
121
|
+
targetUsername = parsersResult.username;
|
|
122
|
+
targetPassword = parsersResult.password;
|
|
123
|
+
targetDbName = parsersResult.endpoint;
|
|
124
|
+
return [3 /*break*/, 13];
|
|
125
|
+
case 11:
|
|
126
|
+
targetPort = 54499;
|
|
127
|
+
return [4 /*yield*/, (0, startProxy_1.startCloudSqlProxyInBackground)({
|
|
128
|
+
instanceName: targetEnvVars.CLOUD_SQL_INSTANCE_CONNECTION_NAME,
|
|
129
|
+
localPort: targetPort
|
|
130
|
+
})];
|
|
131
|
+
case 12:
|
|
132
|
+
targetProxy = _g.sent();
|
|
133
|
+
targetUsername = targetEnvVars.DB_USER;
|
|
134
|
+
targetPassword = targetEnvVars.DB_PASSWORD;
|
|
135
|
+
targetDbName = sourceEnvVars.DB_NAME;
|
|
136
|
+
_g.label = 13;
|
|
137
|
+
case 13: return [4 /*yield*/, this.prompt({
|
|
138
|
+
type: "confirm",
|
|
139
|
+
name: "shouldContinue",
|
|
140
|
+
message: "This will drop ".concat(targetEnv, "/").concat(targetDbName, " and replace it with ").concat(sourceEnv, "/").concat(sourceDbName, ". Continue? \uD83E\uDD14 ")
|
|
141
|
+
})];
|
|
142
|
+
case 14:
|
|
143
|
+
shouldContinue = (_g.sent()).shouldContinue;
|
|
144
|
+
if (!shouldContinue) {
|
|
145
|
+
this.log("abort");
|
|
146
|
+
closeAll();
|
|
147
|
+
return [2 /*return*/];
|
|
148
|
+
}
|
|
149
|
+
if (!(targetContext.environment.envType === "prod")) return [3 /*break*/, 16];
|
|
150
|
+
this.log("\n\uD83D\uDEA8 You are overriding a production environment. Please type in ".concat(targetEnvVars.CLOUD_SQL_INSTANCE_CONNECTION_NAME, " to continue\n\n"));
|
|
151
|
+
return [4 /*yield*/, this.prompt({
|
|
152
|
+
type: "input",
|
|
153
|
+
name: "confirmInstance",
|
|
154
|
+
message: "confirm: "
|
|
155
|
+
})];
|
|
156
|
+
case 15:
|
|
157
|
+
confirmInstance = (_g.sent()).confirmInstance;
|
|
158
|
+
if (confirmInstance !== targetEnvVars.CLOUD_SQL_INSTANCE_CONNECTION_NAME) {
|
|
159
|
+
this.log("abort");
|
|
160
|
+
closeAll();
|
|
161
|
+
return [2 /*return*/];
|
|
162
|
+
}
|
|
163
|
+
_g.label = 16;
|
|
164
|
+
case 16:
|
|
165
|
+
_g.trys.push([16, , 18, 19]);
|
|
166
|
+
return [4 /*yield*/, (0, copyDb_1.spawnCopyDb)({
|
|
167
|
+
targetPassword: targetPassword,
|
|
168
|
+
targetPort: targetPort,
|
|
169
|
+
targetUsername: targetUsername,
|
|
170
|
+
sourceUsername: sourceUsername,
|
|
171
|
+
sourcePassword: sourcePassword,
|
|
172
|
+
sourcePort: sourcePort,
|
|
173
|
+
sourceDbName: sourceDbName,
|
|
174
|
+
targetDbName: targetDbName
|
|
175
|
+
})];
|
|
176
|
+
case 17:
|
|
177
|
+
_g.sent();
|
|
178
|
+
return [3 /*break*/, 19];
|
|
179
|
+
case 18:
|
|
180
|
+
closeAll();
|
|
181
|
+
return [7 /*endfinally*/];
|
|
182
|
+
case 19: return [2 /*return*/];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
})];
|
|
187
|
+
});
|
|
188
|
+
}); });
|
|
189
|
+
//# sourceMappingURL=commandProjectRestoreDb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandProjectRestoreDb.js","sourceRoot":"","sources":["../../../../../../src/apps/cli/commands/project/cloudSql/commandProjectRest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B,qBAAM,IAAI,CAAC,MAAM,CAAC;wCAC5C,IAAI,EAAE,OAAO;wCACb,IAAI,EAAE,iBAAiB;wCACvB,OAAO,EAAE,WAAW;qCACrB,CAAC,EAAA;;gCAJM,eAAe,GAAK,CAAA,SAI1B,CAAA,gBAJqB;gCAMvB,IACE,eAAe,KAAK,aAAa,CAAC,kCAAkC,EACpE;oCACA,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;oCAClB,QAAQ,EAAE,CAAC;oCACX,sBAAO;iCACR;;;;gCAID,qBAAM,IAAA,oBAAW,EAAC;wCAChB,cAAc,gBAAA;wCACd,UAAU,YAAA;wCACV,cAAc,gBAAA;wCACd,cAAc,gBAAA;wCACd,cAAc,gBAAA;wCACd,UAAU,YAAA;wCACV,YAAY,cAAA;wCACZ,YAAY,cAAA;qCACb,CAAC,EAAA;;gCATF,SASE,CAAC;;;gCAEH,QAAQ,EAAE,CAAC;;;;;;aAEd,CAAC,EAAA;;KAAA,EAAC"}
|
|
@@ -63,6 +63,7 @@ var commandPortForward_1 = __importDefault(require("./commandPortForward"));
|
|
|
63
63
|
var commandTriggerCronjob_1 = __importDefault(require("./commandTriggerCronjob"));
|
|
64
64
|
var commandOpenGrafanaPod_1 = __importDefault(require("./commandOpenGrafanaPod"));
|
|
65
65
|
var commandSecretsClearBackups_1 = __importDefault(require("./commandSecretsClearBackups"));
|
|
66
|
+
var commandProjectRestoreDb_1 = __importDefault(require("./cloudSql/commandProjectRestoreDb"));
|
|
66
67
|
exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
67
68
|
return __generator(this, function (_a) {
|
|
68
69
|
(0, commandSetup_1["default"])(vorpal);
|
|
@@ -77,6 +78,7 @@ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void
|
|
|
77
78
|
(0, commandOpenGrafana_1["default"])(vorpal);
|
|
78
79
|
(0, commandOpenGrafanaPod_1["default"])(vorpal);
|
|
79
80
|
(0, commandCloudSqlProxy_1["default"])(vorpal);
|
|
81
|
+
(0, commandProjectRestoreDb_1["default"])(vorpal);
|
|
80
82
|
(0, commandOpenGit_1["default"])(vorpal);
|
|
81
83
|
(0, commandOpenEnv_1["default"])(vorpal);
|
|
82
84
|
(0, commandTriggerCronjob_1["default"])(vorpal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gFAA0D;AAC1D,gFAA0D;AAE1D,0EAAoD;AACpD,gFAA0D;AAC1D,oEAA8C;AAC9C,0FAAoE;AACpE,sEAAgD;AAChD,sEAAgD;AAChD,gEAA0C;AAC1C,4DAA4D;AAC5D,sEAAgD;AAChD,8EAAwD;AACxD,wEAAkD;AAClD,wFAAkE;AAClE,gFAA0D;AAC1D,oEAA8C;AAC9C,oEAA8C;AAC9C,sEAAgD;AAChD,8EAAwD;AACxD,4EAAsD;AACtD,4EAAsD;AACtD,kFAA4D;AAE5D,kFAA4D;AAC5D,4FAAsE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gFAA0D;AAC1D,gFAA0D;AAE1D,0EAAoD;AACpD,gFAA0D;AAC1D,oEAA8C;AAC9C,0FAAoE;AACpE,sEAAgD;AAChD,sEAAgD;AAChD,gEAA0C;AAC1C,4DAA4D;AAC5D,sEAAgD;AAChD,8EAAwD;AACxD,wEAAkD;AAClD,wFAAkE;AAClE,gFAA0D;AAC1D,oEAA8C;AAC9C,oEAA8C;AAC9C,sEAAgD;AAChD,8EAAwD;AACxD,4EAAsD;AACtD,4EAAsD;AACtD,kFAA4D;AAE5D,kFAA4D;AAC5D,4FAAsE;AACtE,+FAAyE;AAEzE,sBAAe,UAAO,MAAc;;QAClC,IAAA,yBAAY,EAAC,MAAM,CAAC,CAAC;QAErB,IAAA,2BAAc,EAAC,MAAM,CAAC,CAAC;QAEvB,IAAA,6BAAgB,EAAC,MAAM,CAAC,CAAC;QACzB,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QACxB,IAAA,gCAAmB,EAAC,MAAM,CAAC,CAAC;QAC5B,IAAA,iCAAoB,EAAC,MAAM,CAAC,CAAC;QAE7B,IAAA,iCAAoB,EAAC,MAAM,CAAC,CAAC;QAE7B,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QAExB,IAAA,qCAAwB,EAAC,MAAM,CAAC,CAAC;QAEjC,IAAA,+BAAkB,EAAC,MAAM,CAAC,CAAC;QAC3B,IAAA,kCAAqB,EAAC,MAAM,CAAC,CAAC;QAC9B,IAAA,iCAAoB,EAAC,MAAM,CAAC,CAAC;QAC7B,IAAA,oCAAuB,EAAC,MAAM,CAAC,CAAC;QAChC,IAAA,2BAAc,EAAC,MAAM,CAAC,CAAC;QACvB,IAAA,2BAAc,EAAC,MAAM,CAAC,CAAC;QACvB,IAAA,kCAAqB,EAAC,MAAM,CAAC,CAAC;QAC9B,IAAA,iCAAoB,EAAC,MAAM,CAAC,CAAC;QAC7B,IAAA,uCAA0B,EAAC,MAAM,CAAC,CAAC;QACnC,IAAA,8BAAiB,EAAC,MAAM,CAAC,CAAC;QAE1B,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QACxB,IAAA,+BAAkB,EAAC,MAAM,CAAC,CAAC;QAE3B,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC;QAExB,IAAA,sCAAyB,EAAC,MAAM,CAAC,CAAC;QAClC,IAAA,gCAAmB,EAAC,MAAM,CAAC,CAAC;;;KAC7B,EAAC"}
|
|
@@ -40373,6 +40373,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
40373
40373
|
exports.__esModule = true;
|
|
40374
40374
|
exports.getDockerAppCopyAndBuildScript = exports.getYarnInstall = exports.ensureNodeVersion = void 0;
|
|
40375
40375
|
var utils_1 = __nccwpck_require__(7461);
|
|
40376
|
+
var gitlab_1 = __nccwpck_require__(4997);
|
|
40376
40377
|
var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
40377
40378
|
// FIXME: check why and when rebuild is needed
|
|
40378
40379
|
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
@@ -40384,13 +40385,13 @@ var getYarnInstallCommand = function (context) {
|
|
|
40384
40385
|
return "yarn install --immutable";
|
|
40385
40386
|
};
|
|
40386
40387
|
var ensureNodeVersion = function (context) {
|
|
40387
|
-
return ["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi", "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi"];
|
|
40388
|
+
return (0, gitlab_1.collapseableSection)("node install", "Ensure node version")(["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi", "if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi"]);
|
|
40388
40389
|
};
|
|
40389
40390
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
40390
40391
|
var getYarnInstall = function (context, options) {
|
|
40391
40392
|
var _a;
|
|
40392
40393
|
var postInstall = "postInstall" in context.componentConfig.build ? context.componentConfig.build.postInstall : null;
|
|
40393
|
-
return __spreadArray(__spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false), __read(postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall) ? (_a = (0, utils_1.ensureArray)(postInstall)) !== null && _a !== void 0 ? _a : [] : []), false);
|
|
40394
|
+
return (0, gitlab_1.collapseableSection)("yarn prepare", "Node and yarn install")(__spreadArray(__spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), [getYarnInstallCommand(context)], false), __read(postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall) ? (_a = (0, utils_1.ensureArray)(postInstall)) !== null && _a !== void 0 ? _a : [] : []), false));
|
|
40394
40395
|
};
|
|
40395
40396
|
exports.getYarnInstall = getYarnInstall;
|
|
40396
40397
|
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
@@ -40870,7 +40871,7 @@ exports.readConfigSync = readConfigSync;
|
|
|
40870
40871
|
|
|
40871
40872
|
exports.__esModule = true;
|
|
40872
40873
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
40873
|
-
exports.PIPELINE_IMAGE_TAG = "update-
|
|
40874
|
+
exports.PIPELINE_IMAGE_TAG = "update-docker-f59d0d91" || 0;
|
|
40874
40875
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
|
|
40875
40876
|
|
|
40876
40877
|
/***/ }),
|
|
@@ -44914,7 +44915,8 @@ var createChildPipeline = function (type, trigger, config) {
|
|
|
44914
44915
|
_a = {
|
|
44915
44916
|
image: (0, runner_1.getRunnerImage)("jobs-default"),
|
|
44916
44917
|
variables: {
|
|
44917
|
-
FF_USE_FASTZIP: "true"
|
|
44918
|
+
FF_USE_FASTZIP: "true",
|
|
44919
|
+
GIT_DEPTH: 1
|
|
44918
44920
|
},
|
|
44919
44921
|
workflow: {
|
|
44920
44922
|
rules: rules_1.RULES_ALWAYS
|