kourou 0.23.0 → 0.24.2
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/README.md +13 -8
- package/lib/commands/app/debug-proxy.d.ts +3 -1
- package/lib/commands/app/debug-proxy.js +8 -2
- package/lib/commands/app/scaffold.js +5 -3
- package/lib/commands/paas/deploy.js +2 -1
- package/lib/commands/paas/login.d.ts +1 -0
- package/lib/commands/paas/login.js +11 -1
- package/lib/commands/vault/encrypt.js +3 -2
- package/lib/common.js +2 -0
- package/lib/support/PaasKommand.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ $ npm install -g kourou
|
|
|
26
26
|
$ kourou COMMAND
|
|
27
27
|
running command...
|
|
28
28
|
$ kourou (-v|--version|version)
|
|
29
|
-
kourou/0.
|
|
29
|
+
kourou/0.24.2 darwin-x64 node-v16.17.0
|
|
30
30
|
$ kourou --help [COMMAND]
|
|
31
31
|
USAGE
|
|
32
32
|
$ kourou COMMAND
|
|
@@ -156,7 +156,7 @@ All other arguments and options will be passed as-is to the `sdk:query` method.
|
|
|
156
156
|
* [`kourou instance:list`](#kourou-instancelist)
|
|
157
157
|
* [`kourou instance:logs`](#kourou-instancelogs)
|
|
158
158
|
* [`kourou instance:spawn`](#kourou-instancespawn)
|
|
159
|
-
* [`kourou paas:deploy ENVIRONMENT IMAGE`](#kourou-paasdeploy-environment-image)
|
|
159
|
+
* [`kourou paas:deploy ENVIRONMENT APPLICATIONID IMAGE`](#kourou-paasdeploy-environment-applicationid-image)
|
|
160
160
|
* [`kourou paas:init PROJECT`](#kourou-paasinit-project)
|
|
161
161
|
* [`kourou paas:login`](#kourou-paaslogin)
|
|
162
162
|
* [`kourou paas:logs ENVIRONMENT APPLICATION`](#kourou-paaslogs-environment-application)
|
|
@@ -303,8 +303,9 @@ OPTIONS
|
|
|
303
303
|
--forwardPort=forwardPort [default: 9222] Port of the forwarding server
|
|
304
304
|
--help show CLI help
|
|
305
305
|
--host=host [default: localhost] Kuzzle server host
|
|
306
|
+
--keepAuth Keep the user authenticated
|
|
306
307
|
|
|
307
|
-
--
|
|
308
|
+
--noAutoEnableDebugger True if Kourou should not enable and disable the Debugger automatically before and after
|
|
308
309
|
usage
|
|
309
310
|
|
|
310
311
|
--password=password Kuzzle user password
|
|
@@ -319,6 +320,8 @@ OPTIONS
|
|
|
319
320
|
|
|
320
321
|
--ssl Use SSL to connect to Kuzzle
|
|
321
322
|
|
|
323
|
+
--ttl=ttl [default: 1h] Kuzzle login TTL
|
|
324
|
+
|
|
322
325
|
--username=username [default: anonymous] Kuzzle username (local strategy)
|
|
323
326
|
```
|
|
324
327
|
|
|
@@ -378,7 +381,7 @@ EXAMPLES
|
|
|
378
381
|
$ kourou autocomplete --refresh-cache
|
|
379
382
|
```
|
|
380
383
|
|
|
381
|
-
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.
|
|
384
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.2.0/src/commands/autocomplete/index.ts)_
|
|
382
385
|
|
|
383
386
|
## `kourou collection:create INDEX COLLECTION [BODY]`
|
|
384
387
|
|
|
@@ -955,17 +958,18 @@ OPTIONS
|
|
|
955
958
|
|
|
956
959
|
_See code: [src/commands/instance/spawn.ts](src/commands/instance/spawn.ts)_
|
|
957
960
|
|
|
958
|
-
## `kourou paas:deploy ENVIRONMENT IMAGE`
|
|
961
|
+
## `kourou paas:deploy ENVIRONMENT APPLICATIONID IMAGE`
|
|
959
962
|
|
|
960
963
|
Deploy a new version of the application in the PaaS
|
|
961
964
|
|
|
962
965
|
```
|
|
963
966
|
USAGE
|
|
964
|
-
$ kourou paas:deploy ENVIRONMENT IMAGE
|
|
967
|
+
$ kourou paas:deploy ENVIRONMENT APPLICATIONID IMAGE
|
|
965
968
|
|
|
966
969
|
ARGUMENTS
|
|
967
|
-
ENVIRONMENT
|
|
968
|
-
|
|
970
|
+
ENVIRONMENT Project environment name
|
|
971
|
+
APPLICATIONID Application Identifier
|
|
972
|
+
IMAGE Image name and hash as myimage:mytag
|
|
969
973
|
|
|
970
974
|
OPTIONS
|
|
971
975
|
--help show CLI help
|
|
@@ -1002,6 +1006,7 @@ USAGE
|
|
|
1002
1006
|
|
|
1003
1007
|
OPTIONS
|
|
1004
1008
|
--help show CLI help
|
|
1009
|
+
--only_npm Only perform the login on the private NPM registry
|
|
1005
1010
|
--project=project Current PaaS project
|
|
1006
1011
|
--username=username PaaS username
|
|
1007
1012
|
```
|
|
@@ -13,7 +13,9 @@ export default class DebugProxy extends Kommand {
|
|
|
13
13
|
'api-key': flags.IOptionFlag<string | undefined>;
|
|
14
14
|
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
15
15
|
forwardPort: import("@oclif/parser/lib/flags").IOptionFlag<number>;
|
|
16
|
-
|
|
16
|
+
ttl: flags.IOptionFlag<string>;
|
|
17
|
+
keepAuth: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
18
|
+
noAutoEnableDebugger: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
17
19
|
showDebuggerEvents: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
18
20
|
showDebuggerPayloads: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
19
21
|
};
|
|
@@ -160,9 +160,15 @@ DebugProxy.description = 'Create a Proxy Server that allows Chrome to debug Kuzz
|
|
|
160
160
|
DebugProxy.flags = Object.assign({ help: command_1.flags.help(), forwardPort: command_1.flags.integer({
|
|
161
161
|
description: 'Port of the forwarding server',
|
|
162
162
|
default: 9222
|
|
163
|
-
}),
|
|
163
|
+
}), ttl: command_1.flags.string({
|
|
164
|
+
description: 'Kuzzle login TTL',
|
|
165
|
+
default: '1h',
|
|
166
|
+
}), keepAuth: command_1.flags.boolean({
|
|
167
|
+
description: 'Keep the user authenticated',
|
|
168
|
+
default: false,
|
|
169
|
+
}), noAutoEnableDebugger: command_1.flags.boolean({
|
|
164
170
|
description: 'True if Kourou should not enable and disable the Debugger automatically before and after usage',
|
|
165
|
-
default:
|
|
171
|
+
default: false
|
|
166
172
|
}), showDebuggerEvents: command_1.flags.boolean({
|
|
167
173
|
description: 'Verbose mode to display events sent to the Chrome Debugger',
|
|
168
174
|
default: false,
|
|
@@ -21,9 +21,11 @@ class AppScaffold extends common_1.Kommand {
|
|
|
21
21
|
this.logOk(`Scaffolding complete! Use ${chalk_1.default.grey(`cd ${destination} && npm run docker npm install`)} install dependencies and then ${chalk_1.default.grey(`npm run docker:dev`)} to run your application!`);
|
|
22
22
|
}
|
|
23
23
|
async cloneTemplate(flavor, destination) {
|
|
24
|
-
|
|
25
|
-
await (0, execute_1.execute)('
|
|
26
|
-
await (0, execute_1.execute)('
|
|
24
|
+
const templatesDir = '/tmp/project-templates';
|
|
25
|
+
await (0, execute_1.execute)('rm', '-rf', templatesDir);
|
|
26
|
+
await (0, execute_1.execute)('git', 'clone', '--depth=1', 'https://github.com/kuzzleio/project-templates', '--branch', flavor, '--single-branch', templatesDir);
|
|
27
|
+
await (0, execute_1.execute)('cp', '-r', `${templatesDir}/${flavor}`, `${destination}/`);
|
|
28
|
+
await (0, execute_1.execute)('rm', '-rf', templatesDir);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
exports.default = AppScaffold;
|
|
@@ -19,7 +19,7 @@ class PaasDeploy extends PaasKommand_1.PaasKommand {
|
|
|
19
19
|
action: 'deploy',
|
|
20
20
|
environmentId: this.args.environment,
|
|
21
21
|
projectId: this.flags.project || this.getProject(),
|
|
22
|
-
applicationId:
|
|
22
|
+
applicationId: this.args.applicationId,
|
|
23
23
|
body: {
|
|
24
24
|
image: {
|
|
25
25
|
name: image,
|
|
@@ -61,6 +61,7 @@ PaasDeploy.flags = {
|
|
|
61
61
|
};
|
|
62
62
|
PaasDeploy.args = [
|
|
63
63
|
{ name: 'environment', description: 'Project environment name', required: true },
|
|
64
|
+
{ name: 'applicationId', description: 'Application Identifier', required: true },
|
|
64
65
|
{ name: 'image', description: 'Image name and hash as myimage:mytag', required: true },
|
|
65
66
|
];
|
|
66
67
|
exports.default = PaasDeploy;
|
|
@@ -7,6 +7,7 @@ declare class PaasLogin extends PaasKommand {
|
|
|
7
7
|
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
8
8
|
project: flags.IOptionFlag<string | undefined>;
|
|
9
9
|
username: flags.IOptionFlag<string | undefined>;
|
|
10
|
+
only_npm: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
10
11
|
};
|
|
11
12
|
runSafe(): Promise<void>;
|
|
12
13
|
createProjectCredentials(apiKey: ApiKey): void;
|
|
@@ -16,6 +16,10 @@ class PaasLogin extends PaasKommand_1.PaasKommand {
|
|
|
16
16
|
const password = process.env.KUZZLE_PAAS_PASSWORD
|
|
17
17
|
? process.env.KUZZLE_PAAS_PASSWORD
|
|
18
18
|
: await cli_ux_1.default.prompt(` Password`, { type: 'hide' });
|
|
19
|
+
if (this.flags.only_npm) {
|
|
20
|
+
await this.authenticateNPM(username, password);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
19
23
|
await this.initPaasClient({ username, password });
|
|
20
24
|
const apiKey = await this.paas.auth.createApiKey('Kourou PaaS API Key');
|
|
21
25
|
this.createProjectCredentials(apiKey);
|
|
@@ -55,10 +59,16 @@ PaasLogin.description = 'Login for a PaaS project';
|
|
|
55
59
|
PaasLogin.flags = {
|
|
56
60
|
help: command_1.flags.help(),
|
|
57
61
|
project: command_1.flags.string({
|
|
58
|
-
description: 'Current PaaS project'
|
|
62
|
+
description: 'Current PaaS project',
|
|
63
|
+
required: false
|
|
59
64
|
}),
|
|
60
65
|
username: command_1.flags.string({
|
|
61
66
|
description: 'PaaS username',
|
|
62
67
|
}),
|
|
68
|
+
only_npm: command_1.flags.boolean({
|
|
69
|
+
description: 'Only perform the login on the private NPM registry',
|
|
70
|
+
required: false,
|
|
71
|
+
default: false
|
|
72
|
+
})
|
|
63
73
|
};
|
|
64
74
|
exports.default = PaasLogin;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VaultEncrypt = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
7
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
8
|
const command_1 = require("@oclif/command");
|
|
8
9
|
const kuzzle_vault_1 = require("kuzzle-vault");
|
|
@@ -15,8 +16,8 @@ class VaultEncrypt extends common_1.Kommand {
|
|
|
15
16
|
if (lodash_1.default.isEmpty(this.args.file)) {
|
|
16
17
|
throw new Error('A secrets file must be provided');
|
|
17
18
|
}
|
|
18
|
-
const
|
|
19
|
-
let outputFile = `${
|
|
19
|
+
const { name, ext } = path_1.default.parse(this.args.file);
|
|
20
|
+
let outputFile = `${name}.enc${ext}`;
|
|
20
21
|
if (this.flags['output-file']) {
|
|
21
22
|
outputFile = this.flags['output-file'];
|
|
22
23
|
}
|
package/lib/common.js
CHANGED
|
@@ -113,6 +113,7 @@ class Kommand extends command_1.Command {
|
|
|
113
113
|
this.logKo(JSON.stringify(error.reason));
|
|
114
114
|
}
|
|
115
115
|
err = true;
|
|
116
|
+
this.exitCode = 1;
|
|
116
117
|
}
|
|
117
118
|
finally {
|
|
118
119
|
if (kommand.id !== undefined) {
|
|
@@ -127,6 +128,7 @@ class Kommand extends command_1.Command {
|
|
|
127
128
|
]);
|
|
128
129
|
}
|
|
129
130
|
this.sdk.disconnect();
|
|
131
|
+
process.exit(this.exitCode);
|
|
130
132
|
}
|
|
131
133
|
return this.exitCode;
|
|
132
134
|
}
|
|
@@ -11,7 +11,7 @@ class PaasKommand extends common_1.Kommand {
|
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.host = process.env.KUZZLE_PAAS_HOST
|
|
13
13
|
? process.env.KUZZLE_PAAS_HOST
|
|
14
|
-
: '
|
|
14
|
+
: 'console.paas.kuzzle.io';
|
|
15
15
|
this.port = process.env.KUZZLE_PAAS_PORT
|
|
16
16
|
? parseInt(process.env.KUZZLE_PAAS_PORT)
|
|
17
17
|
: 443;
|