hereya-cli 0.6.3 → 0.7.0
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 +55 -21
- package/dist/commands/bootstrap/index.js +1 -1
- package/dist/commands/env/index.d.ts +4 -0
- package/dist/commands/env/index.js +24 -3
- package/dist/commands/unbootstrap/index.d.ts +12 -0
- package/dist/commands/unbootstrap/index.js +28 -0
- package/dist/infrastructure/aws.d.ts +1 -0
- package/dist/infrastructure/aws.js +18 -1
- package/dist/infrastructure/common.d.ts +1 -0
- package/dist/infrastructure/local.d.ts +1 -0
- package/dist/infrastructure/local.js +3 -0
- package/oclif.manifest.json +59 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
|
|
|
20
20
|
$ hereya COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ hereya (--version)
|
|
23
|
-
hereya-cli/0.
|
|
23
|
+
hereya-cli/0.7.0 linux-x64 node-v20.14.0
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -33,12 +33,13 @@ USAGE
|
|
|
33
33
|
* [`hereya bootstrap INFRASTRUCTURETYPE`](#hereya-bootstrap-infrastructuretype)
|
|
34
34
|
* [`hereya deploy`](#hereya-deploy)
|
|
35
35
|
* [`hereya down`](#hereya-down)
|
|
36
|
-
* [`hereya env`](#hereya-env)
|
|
36
|
+
* [`hereya env [NAME]`](#hereya-env-name)
|
|
37
37
|
* [`hereya help [COMMAND]`](#hereya-help-command)
|
|
38
38
|
* [`hereya init PROJECT`](#hereya-init-project)
|
|
39
39
|
* [`hereya remote exec [PKGPATH]`](#hereya-remote-exec-pkgpath)
|
|
40
40
|
* [`hereya remove PACKAGE`](#hereya-remove-package)
|
|
41
41
|
* [`hereya run CMD`](#hereya-run-cmd)
|
|
42
|
+
* [`hereya unbootstrap INFRASTRUCTURETYPE`](#hereya-unbootstrap-infrastructuretype)
|
|
42
43
|
* [`hereya undeploy`](#hereya-undeploy)
|
|
43
44
|
* [`hereya up`](#hereya-up)
|
|
44
45
|
* [`hereya workspace create NAME`](#hereya-workspace-create-name)
|
|
@@ -70,7 +71,7 @@ EXAMPLES
|
|
|
70
71
|
$ hereya add cloudy/docker_postgres
|
|
71
72
|
```
|
|
72
73
|
|
|
73
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
74
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/add/index.ts)_
|
|
74
75
|
|
|
75
76
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
76
77
|
|
|
@@ -81,7 +82,7 @@ USAGE
|
|
|
81
82
|
$ hereya bootstrap INFRASTRUCTURETYPE [-f]
|
|
82
83
|
|
|
83
84
|
ARGUMENTS
|
|
84
|
-
INFRASTRUCTURETYPE infrastructure to bootstrap. Options are local, aws
|
|
85
|
+
INFRASTRUCTURETYPE infrastructure to bootstrap. Options are local, aws
|
|
85
86
|
|
|
86
87
|
FLAGS
|
|
87
88
|
-f, --force redeploy hereya resources if already deployed
|
|
@@ -95,7 +96,7 @@ EXAMPLES
|
|
|
95
96
|
$ hereya bootstrap local
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
99
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/bootstrap/index.ts)_
|
|
99
100
|
|
|
100
101
|
## `hereya deploy`
|
|
101
102
|
|
|
@@ -116,7 +117,7 @@ EXAMPLES
|
|
|
116
117
|
$ hereya deploy
|
|
117
118
|
```
|
|
118
119
|
|
|
119
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
120
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/deploy/index.ts)_
|
|
120
121
|
|
|
121
122
|
## `hereya down`
|
|
122
123
|
|
|
@@ -138,17 +139,21 @@ EXAMPLES
|
|
|
138
139
|
$ hereya down
|
|
139
140
|
```
|
|
140
141
|
|
|
141
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
142
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/down/index.ts)_
|
|
142
143
|
|
|
143
|
-
## `hereya env`
|
|
144
|
+
## `hereya env [NAME]`
|
|
144
145
|
|
|
145
146
|
Print project environment variables.
|
|
146
147
|
|
|
147
148
|
```
|
|
148
149
|
USAGE
|
|
149
|
-
$ hereya env [--chdir <value>] [-w <value>]
|
|
150
|
+
$ hereya env [NAME] [--chdir <value>] [-l] [-w <value>]
|
|
151
|
+
|
|
152
|
+
ARGUMENTS
|
|
153
|
+
NAME name of the env to display
|
|
150
154
|
|
|
151
155
|
FLAGS
|
|
156
|
+
-l, --list list only the env vars without values
|
|
152
157
|
-w, --workspace=<value> name of the workspace to print the env vars for
|
|
153
158
|
--chdir=<value> project root directory
|
|
154
159
|
|
|
@@ -158,10 +163,14 @@ DESCRIPTION
|
|
|
158
163
|
EXAMPLES
|
|
159
164
|
$ hereya env
|
|
160
165
|
|
|
166
|
+
$ hereya env myEnv
|
|
167
|
+
|
|
161
168
|
$ hereya env -w dev
|
|
169
|
+
|
|
170
|
+
$ hereya env -w dev -l
|
|
162
171
|
```
|
|
163
172
|
|
|
164
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
173
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/env/index.ts)_
|
|
165
174
|
|
|
166
175
|
## `hereya help [COMMAND]`
|
|
167
176
|
|
|
@@ -207,7 +216,7 @@ EXAMPLES
|
|
|
207
216
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
208
217
|
```
|
|
209
218
|
|
|
210
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
219
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/init/index.ts)_
|
|
211
220
|
|
|
212
221
|
## `hereya remote exec [PKGPATH]`
|
|
213
222
|
|
|
@@ -231,7 +240,7 @@ EXAMPLES
|
|
|
231
240
|
$ hereya remote exec
|
|
232
241
|
```
|
|
233
242
|
|
|
234
|
-
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
243
|
+
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/remote/exec/index.ts)_
|
|
235
244
|
|
|
236
245
|
## `hereya remove PACKAGE`
|
|
237
246
|
|
|
@@ -254,7 +263,7 @@ EXAMPLES
|
|
|
254
263
|
$ hereya remove cloudy/docker_postgres
|
|
255
264
|
```
|
|
256
265
|
|
|
257
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
266
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/remove/index.ts)_
|
|
258
267
|
|
|
259
268
|
## `hereya run CMD`
|
|
260
269
|
|
|
@@ -280,7 +289,32 @@ EXAMPLES
|
|
|
280
289
|
$ hereya run -w uat -- node index.js
|
|
281
290
|
```
|
|
282
291
|
|
|
283
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
292
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/run/index.ts)_
|
|
293
|
+
|
|
294
|
+
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
295
|
+
|
|
296
|
+
Uninstall hereya resources deployed with bootstrap command.
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
USAGE
|
|
300
|
+
$ hereya unbootstrap INFRASTRUCTURETYPE [-f]
|
|
301
|
+
|
|
302
|
+
ARGUMENTS
|
|
303
|
+
INFRASTRUCTURETYPE infrastructure to unbootstrap. Options are local, aws
|
|
304
|
+
|
|
305
|
+
FLAGS
|
|
306
|
+
-f, --force try to delete hereya resources even if not deployed
|
|
307
|
+
|
|
308
|
+
DESCRIPTION
|
|
309
|
+
Uninstall hereya resources deployed with bootstrap command.
|
|
310
|
+
|
|
311
|
+
EXAMPLES
|
|
312
|
+
$ hereya unbootstrap aws
|
|
313
|
+
|
|
314
|
+
$ hereya unbootstrap local
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/unbootstrap/index.ts)_
|
|
284
318
|
|
|
285
319
|
## `hereya undeploy`
|
|
286
320
|
|
|
@@ -301,7 +335,7 @@ EXAMPLES
|
|
|
301
335
|
$ hereya undeploy
|
|
302
336
|
```
|
|
303
337
|
|
|
304
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
338
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/undeploy/index.ts)_
|
|
305
339
|
|
|
306
340
|
## `hereya up`
|
|
307
341
|
|
|
@@ -323,7 +357,7 @@ EXAMPLES
|
|
|
323
357
|
$ hereya up
|
|
324
358
|
```
|
|
325
359
|
|
|
326
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
360
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/up/index.ts)_
|
|
327
361
|
|
|
328
362
|
## `hereya workspace create NAME`
|
|
329
363
|
|
|
@@ -343,7 +377,7 @@ EXAMPLES
|
|
|
343
377
|
$ hereya workspace create dev
|
|
344
378
|
```
|
|
345
379
|
|
|
346
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
380
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/workspace/create/index.ts)_
|
|
347
381
|
|
|
348
382
|
## `hereya workspace delete NAME`
|
|
349
383
|
|
|
@@ -363,7 +397,7 @@ EXAMPLES
|
|
|
363
397
|
$ hereya workspace delete dev
|
|
364
398
|
```
|
|
365
399
|
|
|
366
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
400
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/workspace/delete/index.ts)_
|
|
367
401
|
|
|
368
402
|
## `hereya workspace env [NAME]`
|
|
369
403
|
|
|
@@ -389,7 +423,7 @@ EXAMPLES
|
|
|
389
423
|
$ hereya workspace env myEnv -w dev
|
|
390
424
|
```
|
|
391
425
|
|
|
392
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
426
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/workspace/env/index.ts)_
|
|
393
427
|
|
|
394
428
|
## `hereya workspace install PACKAGE`
|
|
395
429
|
|
|
@@ -415,7 +449,7 @@ EXAMPLES
|
|
|
415
449
|
$ hereya workspace install hereya/aws-cognito
|
|
416
450
|
```
|
|
417
451
|
|
|
418
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
452
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/workspace/install/index.ts)_
|
|
419
453
|
|
|
420
454
|
## `hereya workspace uninstall PACKAGE`
|
|
421
455
|
|
|
@@ -441,5 +475,5 @@ EXAMPLES
|
|
|
441
475
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
442
476
|
```
|
|
443
477
|
|
|
444
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
478
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.7.0/src/commands/workspace/uninstall/index.ts)_
|
|
445
479
|
<!-- commandsstop -->
|
|
@@ -3,7 +3,7 @@ import { getInfrastructure } from '../../infrastructure/index.js';
|
|
|
3
3
|
export default class Bootstrap extends Command {
|
|
4
4
|
static args = {
|
|
5
5
|
infrastructureType: Args.string({
|
|
6
|
-
description: 'infrastructure to bootstrap. Options are local, aws
|
|
6
|
+
description: 'infrastructure to bootstrap. Options are local, aws',
|
|
7
7
|
required: true
|
|
8
8
|
})
|
|
9
9
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Env extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
3
6
|
static description: string;
|
|
4
7
|
static examples: string[];
|
|
5
8
|
static flags: {
|
|
6
9
|
chdir: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
list: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
7
11
|
workspace: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
12
|
};
|
|
9
13
|
run(): Promise<void>;
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
3
3
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
4
4
|
import { logEnv } from '../../lib/env-utils.js';
|
|
5
5
|
export default class Env extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
name: Args.string({ description: 'name of the env to display', required: false }),
|
|
8
|
+
};
|
|
6
9
|
static description = 'Print project environment variables.';
|
|
7
10
|
static examples = [
|
|
8
11
|
'<%= config.bin %> <%= command.id %>',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> myEnv',
|
|
9
13
|
'<%= config.bin %> <%= command.id %> -w dev',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> -w dev -l',
|
|
10
15
|
];
|
|
11
16
|
static flags = {
|
|
12
17
|
chdir: Flags.string({
|
|
13
18
|
description: 'project root directory',
|
|
14
19
|
required: false,
|
|
15
20
|
}),
|
|
21
|
+
list: Flags.boolean({
|
|
22
|
+
char: 'l',
|
|
23
|
+
description: 'list only the env vars without values',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
16
26
|
workspace: Flags.string({
|
|
17
27
|
char: 'w',
|
|
18
28
|
description: 'name of the workspace to print the env vars for',
|
|
@@ -20,7 +30,7 @@ export default class Env extends Command {
|
|
|
20
30
|
}),
|
|
21
31
|
};
|
|
22
32
|
async run() {
|
|
23
|
-
const { flags } = await this.parse(Env);
|
|
33
|
+
const { args, flags } = await this.parse(Env);
|
|
24
34
|
const projectRootDir = flags.chdir || process.env.HEREYA_PROJECT_ROOT_DIR;
|
|
25
35
|
const configManager = getConfigManager();
|
|
26
36
|
const loadConfigOutput = await configManager.loadConfig({ projectRootDir });
|
|
@@ -29,7 +39,7 @@ export default class Env extends Command {
|
|
|
29
39
|
return;
|
|
30
40
|
}
|
|
31
41
|
const { config } = loadConfigOutput;
|
|
32
|
-
let { workspace } = flags;
|
|
42
|
+
let { list, workspace } = flags;
|
|
33
43
|
if (!workspace) {
|
|
34
44
|
workspace = config.workspace;
|
|
35
45
|
}
|
|
@@ -41,6 +51,17 @@ export default class Env extends Command {
|
|
|
41
51
|
projectRootDir,
|
|
42
52
|
workspace,
|
|
43
53
|
});
|
|
54
|
+
if (args.name) {
|
|
55
|
+
if (env[args.name] === undefined) {
|
|
56
|
+
this.error(`Env var ${args.name} not found`);
|
|
57
|
+
}
|
|
58
|
+
this.log(env[args.name]);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (list) {
|
|
62
|
+
this.log(Object.keys(env).join('\n'));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
44
65
|
logEnv(env);
|
|
45
66
|
}
|
|
46
67
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Unbootstrap extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
infrastructureType: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { getInfrastructure } from '../../infrastructure/index.js';
|
|
3
|
+
export default class Unbootstrap extends Command {
|
|
4
|
+
static args = {
|
|
5
|
+
infrastructureType: Args.string({
|
|
6
|
+
description: 'infrastructure to unbootstrap. Options are local, aws',
|
|
7
|
+
required: true
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
static description = 'Uninstall hereya resources deployed with bootstrap command.';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %> aws',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> local',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
force: Flags.boolean({ char: 'f', description: 'try to delete hereya resources even if not deployed' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(Unbootstrap);
|
|
20
|
+
const infrastructure$ = getInfrastructure({ type: args.infrastructureType });
|
|
21
|
+
if (!infrastructure$.supported) {
|
|
22
|
+
this.warn(infrastructure$.reason);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const { infrastructure } = infrastructure$;
|
|
26
|
+
await infrastructure.unbootstrap({ force: flags.force });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -6,6 +6,7 @@ export declare class AwsInfrastructure implements Infrastructure {
|
|
|
6
6
|
provision(input: ProvisionInput): Promise<ProvisionOutput>;
|
|
7
7
|
resolveEnv(input: ResolveEnvInput): Promise<ResolveEnvOutput>;
|
|
8
8
|
saveEnv(input: SaveEnvInput): Promise<SaveEnvOutput>;
|
|
9
|
+
unbootstrap(_: BootstrapInput): Promise<void>;
|
|
9
10
|
undeploy(input: UndeployInput): Promise<UndeployOutput>;
|
|
10
11
|
private getEnv;
|
|
11
12
|
private getFilesToUpload;
|
|
@@ -13,7 +13,7 @@ import { fileExists, getAnyPath } from '../lib/filesystem.js';
|
|
|
13
13
|
import { objectToBase64 } from '../lib/object-utils.js';
|
|
14
14
|
import { runShell } from '../lib/shell.js';
|
|
15
15
|
import { InfrastructureType } from './common.js';
|
|
16
|
-
import { provisionPackage } from './index.js';
|
|
16
|
+
import { destroyPackage, provisionPackage } from './index.js';
|
|
17
17
|
export class AwsInfrastructure {
|
|
18
18
|
async bootstrap(_) {
|
|
19
19
|
const stsClient = new STSClient({});
|
|
@@ -129,6 +129,23 @@ export class AwsInfrastructure {
|
|
|
129
129
|
return { reason: error.message, success: false };
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
async unbootstrap(_) {
|
|
133
|
+
const ssmClient = new SSMClient({});
|
|
134
|
+
const key = '/hereya-bootstrap/config';
|
|
135
|
+
try {
|
|
136
|
+
await ssmClient.send(new DeleteParameterCommand({
|
|
137
|
+
Name: key,
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
console.log(`Could not delete parameter "${key}": ${error.message}. Continuing with unbootstrap...`);
|
|
142
|
+
}
|
|
143
|
+
const bootstrapPackage = 'hereya/bootstrap-aws-stack';
|
|
144
|
+
const output = await destroyPackage({ package: bootstrapPackage });
|
|
145
|
+
if (!output.success) {
|
|
146
|
+
throw new Error(output.reason);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
132
149
|
async undeploy(input) {
|
|
133
150
|
let files = [];
|
|
134
151
|
let s3Bucket = '';
|
|
@@ -12,6 +12,7 @@ export interface Infrastructure {
|
|
|
12
12
|
provision(input: ProvisionInput): Promise<ProvisionOutput>;
|
|
13
13
|
resolveEnv(input: ResolveEnvInput): Promise<ResolveEnvOutput>;
|
|
14
14
|
saveEnv(input: SaveEnvInput): Promise<SaveEnvOutput>;
|
|
15
|
+
unbootstrap(input: BootstrapInput): Promise<void>;
|
|
15
16
|
undeploy(input: UndeployInput): Promise<UndeployOutput>;
|
|
16
17
|
}
|
|
17
18
|
export type BootstrapInput = {
|
|
@@ -10,6 +10,7 @@ export declare class LocalInfrastructure implements Infrastructure {
|
|
|
10
10
|
value: string;
|
|
11
11
|
}>;
|
|
12
12
|
saveEnv(input: SaveEnvInput): Promise<SaveEnvOutput>;
|
|
13
|
+
unbootstrap(): Promise<void>;
|
|
13
14
|
undeploy(input: UndeployInput): Promise<UndeployOutput>;
|
|
14
15
|
private download;
|
|
15
16
|
private isNotEmpty;
|
|
@@ -64,6 +64,9 @@ export class LocalInfrastructure {
|
|
|
64
64
|
console.log(`Saving env to ${input.id}`);
|
|
65
65
|
return { success: true };
|
|
66
66
|
}
|
|
67
|
+
async unbootstrap() {
|
|
68
|
+
console.log('Unbootstrapping local infrastructure');
|
|
69
|
+
}
|
|
67
70
|
async undeploy(input) {
|
|
68
71
|
input.parameters = {
|
|
69
72
|
...input.parameters,
|
package/oclif.manifest.json
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"aliases": [],
|
|
53
53
|
"args": {
|
|
54
54
|
"infrastructureType": {
|
|
55
|
-
"description": "infrastructure to bootstrap. Options are local, aws
|
|
55
|
+
"description": "infrastructure to bootstrap. Options are local, aws",
|
|
56
56
|
"name": "infrastructureType",
|
|
57
57
|
"required": true
|
|
58
58
|
}
|
|
@@ -180,11 +180,19 @@
|
|
|
180
180
|
},
|
|
181
181
|
"env": {
|
|
182
182
|
"aliases": [],
|
|
183
|
-
"args": {
|
|
183
|
+
"args": {
|
|
184
|
+
"name": {
|
|
185
|
+
"description": "name of the env to display",
|
|
186
|
+
"name": "name",
|
|
187
|
+
"required": false
|
|
188
|
+
}
|
|
189
|
+
},
|
|
184
190
|
"description": "Print project environment variables.",
|
|
185
191
|
"examples": [
|
|
186
192
|
"<%= config.bin %> <%= command.id %>",
|
|
187
|
-
"<%= config.bin %> <%= command.id %>
|
|
193
|
+
"<%= config.bin %> <%= command.id %> myEnv",
|
|
194
|
+
"<%= config.bin %> <%= command.id %> -w dev",
|
|
195
|
+
"<%= config.bin %> <%= command.id %> -w dev -l"
|
|
188
196
|
],
|
|
189
197
|
"flags": {
|
|
190
198
|
"chdir": {
|
|
@@ -195,6 +203,14 @@
|
|
|
195
203
|
"multiple": false,
|
|
196
204
|
"type": "option"
|
|
197
205
|
},
|
|
206
|
+
"list": {
|
|
207
|
+
"char": "l",
|
|
208
|
+
"description": "list only the env vars without values",
|
|
209
|
+
"name": "list",
|
|
210
|
+
"required": false,
|
|
211
|
+
"allowNo": false,
|
|
212
|
+
"type": "boolean"
|
|
213
|
+
},
|
|
198
214
|
"workspace": {
|
|
199
215
|
"char": "w",
|
|
200
216
|
"description": "name of the workspace to print the env vars for",
|
|
@@ -358,6 +374,45 @@
|
|
|
358
374
|
"index.js"
|
|
359
375
|
]
|
|
360
376
|
},
|
|
377
|
+
"unbootstrap": {
|
|
378
|
+
"aliases": [],
|
|
379
|
+
"args": {
|
|
380
|
+
"infrastructureType": {
|
|
381
|
+
"description": "infrastructure to unbootstrap. Options are local, aws",
|
|
382
|
+
"name": "infrastructureType",
|
|
383
|
+
"required": true
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"description": "Uninstall hereya resources deployed with bootstrap command.",
|
|
387
|
+
"examples": [
|
|
388
|
+
"<%= config.bin %> <%= command.id %> aws",
|
|
389
|
+
"<%= config.bin %> <%= command.id %> local"
|
|
390
|
+
],
|
|
391
|
+
"flags": {
|
|
392
|
+
"force": {
|
|
393
|
+
"char": "f",
|
|
394
|
+
"description": "try to delete hereya resources even if not deployed",
|
|
395
|
+
"name": "force",
|
|
396
|
+
"allowNo": false,
|
|
397
|
+
"type": "boolean"
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"hasDynamicHelp": false,
|
|
401
|
+
"hiddenAliases": [],
|
|
402
|
+
"id": "unbootstrap",
|
|
403
|
+
"pluginAlias": "hereya-cli",
|
|
404
|
+
"pluginName": "hereya-cli",
|
|
405
|
+
"pluginType": "core",
|
|
406
|
+
"strict": true,
|
|
407
|
+
"enableJsonFlag": false,
|
|
408
|
+
"isESM": true,
|
|
409
|
+
"relativePath": [
|
|
410
|
+
"dist",
|
|
411
|
+
"commands",
|
|
412
|
+
"unbootstrap",
|
|
413
|
+
"index.js"
|
|
414
|
+
]
|
|
415
|
+
},
|
|
361
416
|
"undeploy": {
|
|
362
417
|
"aliases": [],
|
|
363
418
|
"args": {},
|
|
@@ -728,5 +783,5 @@
|
|
|
728
783
|
]
|
|
729
784
|
}
|
|
730
785
|
},
|
|
731
|
-
"version": "0.
|
|
786
|
+
"version": "0.7.0"
|
|
732
787
|
}
|