hereya-cli 0.4.4 → 0.4.5
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 +18 -18
- package/dist/infrastructure/aws.js +20 -1
- package/oclif.manifest.json +40 -40
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
hereya-cli
|
|
2
2
|
=================
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Use infrastructure components as simple software packages.
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
[](https://oclif.io)
|
|
@@ -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.4.
|
|
23
|
+
hereya-cli/0.4.5 linux-x64 node-v20.13.1
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -70,7 +70,7 @@ EXAMPLES
|
|
|
70
70
|
$ hereya add cloudy/docker_postgres
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
73
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/add/index.ts)_
|
|
74
74
|
|
|
75
75
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
76
76
|
|
|
@@ -95,7 +95,7 @@ EXAMPLES
|
|
|
95
95
|
$ hereya bootstrap local
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
98
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/bootstrap/index.ts)_
|
|
99
99
|
|
|
100
100
|
## `hereya deploy`
|
|
101
101
|
|
|
@@ -116,7 +116,7 @@ EXAMPLES
|
|
|
116
116
|
$ hereya deploy
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
119
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/deploy/index.ts)_
|
|
120
120
|
|
|
121
121
|
## `hereya down`
|
|
122
122
|
|
|
@@ -137,7 +137,7 @@ EXAMPLES
|
|
|
137
137
|
$ hereya down
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
140
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/down/index.ts)_
|
|
141
141
|
|
|
142
142
|
## `hereya env`
|
|
143
143
|
|
|
@@ -160,7 +160,7 @@ EXAMPLES
|
|
|
160
160
|
$ hereya env -w dev
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
163
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/env/index.ts)_
|
|
164
164
|
|
|
165
165
|
## `hereya help [COMMAND]`
|
|
166
166
|
|
|
@@ -206,7 +206,7 @@ EXAMPLES
|
|
|
206
206
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
209
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/init/index.ts)_
|
|
210
210
|
|
|
211
211
|
## `hereya remote exec [PKGPATH]`
|
|
212
212
|
|
|
@@ -230,7 +230,7 @@ EXAMPLES
|
|
|
230
230
|
$ hereya remote exec
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
233
|
+
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/remote/exec/index.ts)_
|
|
234
234
|
|
|
235
235
|
## `hereya remove PACKAGE`
|
|
236
236
|
|
|
@@ -253,7 +253,7 @@ EXAMPLES
|
|
|
253
253
|
$ hereya remove cloudy/docker_postgres
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
256
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/remove/index.ts)_
|
|
257
257
|
|
|
258
258
|
## `hereya run CMD`
|
|
259
259
|
|
|
@@ -279,7 +279,7 @@ EXAMPLES
|
|
|
279
279
|
$ hereya run -w uat -- node index.js
|
|
280
280
|
```
|
|
281
281
|
|
|
282
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
282
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/run/index.ts)_
|
|
283
283
|
|
|
284
284
|
## `hereya undeploy`
|
|
285
285
|
|
|
@@ -300,7 +300,7 @@ EXAMPLES
|
|
|
300
300
|
$ hereya undeploy
|
|
301
301
|
```
|
|
302
302
|
|
|
303
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
303
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/undeploy/index.ts)_
|
|
304
304
|
|
|
305
305
|
## `hereya up`
|
|
306
306
|
|
|
@@ -321,7 +321,7 @@ EXAMPLES
|
|
|
321
321
|
$ hereya up
|
|
322
322
|
```
|
|
323
323
|
|
|
324
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
324
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/up/index.ts)_
|
|
325
325
|
|
|
326
326
|
## `hereya workspace create NAME`
|
|
327
327
|
|
|
@@ -341,7 +341,7 @@ EXAMPLES
|
|
|
341
341
|
$ hereya workspace create dev
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
344
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/workspace/create/index.ts)_
|
|
345
345
|
|
|
346
346
|
## `hereya workspace delete NAME`
|
|
347
347
|
|
|
@@ -361,7 +361,7 @@ EXAMPLES
|
|
|
361
361
|
$ hereya workspace delete dev
|
|
362
362
|
```
|
|
363
363
|
|
|
364
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
364
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/workspace/delete/index.ts)_
|
|
365
365
|
|
|
366
366
|
## `hereya workspace env`
|
|
367
367
|
|
|
@@ -381,7 +381,7 @@ EXAMPLES
|
|
|
381
381
|
$ hereya workspace env -w dev
|
|
382
382
|
```
|
|
383
383
|
|
|
384
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
384
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/workspace/env/index.ts)_
|
|
385
385
|
|
|
386
386
|
## `hereya workspace install PACKAGE`
|
|
387
387
|
|
|
@@ -407,7 +407,7 @@ EXAMPLES
|
|
|
407
407
|
$ hereya workspace install hereya/aws-cognito
|
|
408
408
|
```
|
|
409
409
|
|
|
410
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
410
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/workspace/install/index.ts)_
|
|
411
411
|
|
|
412
412
|
## `hereya workspace uninstall PACKAGE`
|
|
413
413
|
|
|
@@ -433,5 +433,5 @@ EXAMPLES
|
|
|
433
433
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
434
434
|
```
|
|
435
435
|
|
|
436
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.
|
|
436
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.4.5/src/commands/workspace/uninstall/index.ts)_
|
|
437
437
|
<!-- commandsstop -->
|
|
@@ -23,6 +23,16 @@ export class AwsInfrastructure {
|
|
|
23
23
|
if (!output.success) {
|
|
24
24
|
throw new Error(output.reason);
|
|
25
25
|
}
|
|
26
|
+
const { env } = output;
|
|
27
|
+
const key = '/hereya-bootstrap/config';
|
|
28
|
+
const ssmClient = new SSMClient({});
|
|
29
|
+
const value = JSON.stringify(env);
|
|
30
|
+
await ssmClient.send(new PutParameterCommand({
|
|
31
|
+
Name: key,
|
|
32
|
+
Overwrite: true,
|
|
33
|
+
Type: 'String',
|
|
34
|
+
Value: value
|
|
35
|
+
}));
|
|
26
36
|
}
|
|
27
37
|
async deploy(input) {
|
|
28
38
|
let files = [];
|
|
@@ -265,8 +275,17 @@ export class AwsInfrastructure {
|
|
|
265
275
|
return { success: true };
|
|
266
276
|
}
|
|
267
277
|
async uploadProjectFiles(input) {
|
|
278
|
+
const key = '/hereya-bootstrap/config';
|
|
279
|
+
const ssmClient = new SSMClient({});
|
|
280
|
+
const response = await ssmClient.send(new GetParameterCommand({
|
|
281
|
+
Name: key,
|
|
282
|
+
}));
|
|
283
|
+
const bootstrapConfig = JSON.parse(response.Parameter?.Value ?? '{}');
|
|
284
|
+
if (!bootstrapConfig.hereyaSourceCodeBucketName) {
|
|
285
|
+
throw new Error('hereyaSourceCodeBucketName not found in bootstrap config');
|
|
286
|
+
}
|
|
268
287
|
const s3Key = `${input.id}/${randomUUID()}`;
|
|
269
|
-
const s3Bucket =
|
|
288
|
+
const s3Bucket = bootstrapConfig.hereyaSourceCodeBucketName;
|
|
270
289
|
const files = await this.getFilesToUpload(input.projectRootDir);
|
|
271
290
|
const s3Client = new S3Client({});
|
|
272
291
|
await Promise.all(files.map(async (file) => {
|
package/oclif.manifest.json
CHANGED
|
@@ -1,40 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"
|
|
3
|
+
"bootstrap": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {
|
|
6
|
-
"
|
|
7
|
-
"description": "
|
|
8
|
-
"name": "
|
|
6
|
+
"infrastructureType": {
|
|
7
|
+
"description": "infrastructure to bootstrap. Options are local, aws, azure, gcp",
|
|
8
|
+
"name": "infrastructureType",
|
|
9
9
|
"required": true
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"description": "
|
|
12
|
+
"description": "Install necessary resources for hereya operations in an infrastructure.",
|
|
13
13
|
"examples": [
|
|
14
|
-
"<%= config.bin %> <%= command.id %>
|
|
14
|
+
"<%= config.bin %> <%= command.id %> aws",
|
|
15
|
+
"<%= config.bin %> <%= command.id %> local"
|
|
15
16
|
],
|
|
16
17
|
"flags": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"type": "option"
|
|
24
|
-
},
|
|
25
|
-
"parameter": {
|
|
26
|
-
"char": "p",
|
|
27
|
-
"description": "parameter for the package, in the form of 'key=value'. Can be specified multiple times.",
|
|
28
|
-
"name": "parameter",
|
|
29
|
-
"default": [],
|
|
30
|
-
"hasDynamicHelp": false,
|
|
31
|
-
"multiple": true,
|
|
32
|
-
"type": "option"
|
|
18
|
+
"force": {
|
|
19
|
+
"char": "f",
|
|
20
|
+
"description": "redeploy hereya resources if already deployed",
|
|
21
|
+
"name": "force",
|
|
22
|
+
"allowNo": false,
|
|
23
|
+
"type": "boolean"
|
|
33
24
|
}
|
|
34
25
|
},
|
|
35
26
|
"hasDynamicHelp": false,
|
|
36
27
|
"hiddenAliases": [],
|
|
37
|
-
"id": "
|
|
28
|
+
"id": "bootstrap",
|
|
38
29
|
"pluginAlias": "hereya-cli",
|
|
39
30
|
"pluginName": "hereya-cli",
|
|
40
31
|
"pluginType": "core",
|
|
@@ -44,36 +35,45 @@
|
|
|
44
35
|
"relativePath": [
|
|
45
36
|
"dist",
|
|
46
37
|
"commands",
|
|
47
|
-
"
|
|
38
|
+
"bootstrap",
|
|
48
39
|
"index.js"
|
|
49
40
|
]
|
|
50
41
|
},
|
|
51
|
-
"
|
|
42
|
+
"add": {
|
|
52
43
|
"aliases": [],
|
|
53
44
|
"args": {
|
|
54
|
-
"
|
|
55
|
-
"description": "
|
|
56
|
-
"name": "
|
|
45
|
+
"package": {
|
|
46
|
+
"description": "The package to add. Packages are gitHub repositories. Use the format owner/repository",
|
|
47
|
+
"name": "package",
|
|
57
48
|
"required": true
|
|
58
49
|
}
|
|
59
50
|
},
|
|
60
|
-
"description": "
|
|
51
|
+
"description": "Add a package to the project.",
|
|
61
52
|
"examples": [
|
|
62
|
-
"<%= config.bin %> <%= command.id %>
|
|
63
|
-
"<%= config.bin %> <%= command.id %> local"
|
|
53
|
+
"<%= config.bin %> <%= command.id %> cloudy/docker_postgres"
|
|
64
54
|
],
|
|
65
55
|
"flags": {
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
56
|
+
"chdir": {
|
|
57
|
+
"description": "directory to run command in",
|
|
58
|
+
"name": "chdir",
|
|
59
|
+
"required": false,
|
|
60
|
+
"hasDynamicHelp": false,
|
|
61
|
+
"multiple": false,
|
|
62
|
+
"type": "option"
|
|
63
|
+
},
|
|
64
|
+
"parameter": {
|
|
65
|
+
"char": "p",
|
|
66
|
+
"description": "parameter for the package, in the form of 'key=value'. Can be specified multiple times.",
|
|
67
|
+
"name": "parameter",
|
|
68
|
+
"default": [],
|
|
69
|
+
"hasDynamicHelp": false,
|
|
70
|
+
"multiple": true,
|
|
71
|
+
"type": "option"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"hasDynamicHelp": false,
|
|
75
75
|
"hiddenAliases": [],
|
|
76
|
-
"id": "
|
|
76
|
+
"id": "add",
|
|
77
77
|
"pluginAlias": "hereya-cli",
|
|
78
78
|
"pluginName": "hereya-cli",
|
|
79
79
|
"pluginType": "core",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"relativePath": [
|
|
84
84
|
"dist",
|
|
85
85
|
"commands",
|
|
86
|
-
"
|
|
86
|
+
"add",
|
|
87
87
|
"index.js"
|
|
88
88
|
]
|
|
89
89
|
},
|
|
@@ -699,5 +699,5 @@
|
|
|
699
699
|
]
|
|
700
700
|
}
|
|
701
701
|
},
|
|
702
|
-
"version": "0.4.
|
|
702
|
+
"version": "0.4.5"
|
|
703
703
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hereya-cli",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.4.
|
|
3
|
+
"description": "Infrastructure as Package",
|
|
4
|
+
"version": "0.4.5",
|
|
5
5
|
"author": "Hereya Developers",
|
|
6
6
|
"bin": {
|
|
7
7
|
"hereya": "./bin/run.js"
|