@enspirit/emb 0.23.0 → 0.25.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 +84 -45
- package/dist/src/cli/abstract/KubernetesCommand.d.ts +5 -1
- package/dist/src/cli/abstract/KubernetesCommand.js +11 -2
- package/dist/src/cli/commands/images/push.d.ts +3 -0
- package/dist/src/cli/commands/images/push.js +4 -1
- package/dist/src/cli/commands/kubernetes/logs.js +7 -12
- package/dist/src/cli/commands/kubernetes/ps.js +2 -1
- package/dist/src/cli/commands/kubernetes/restart.js +2 -1
- package/dist/src/cli/commands/kubernetes/shell.js +7 -10
- package/dist/src/cli/commands/resources/build.d.ts +1 -0
- package/dist/src/cli/commands/resources/build.js +17 -3
- package/dist/src/cli/commands/resources/index.d.ts +3 -1
- package/dist/src/cli/commands/resources/index.js +23 -5
- package/dist/src/cli/commands/resources/publish.d.ts +15 -0
- package/dist/src/cli/commands/resources/publish.js +35 -0
- package/dist/src/config/schema.d.ts +51 -1
- package/dist/src/config/schema.json +68 -1
- package/dist/src/docker/compose/client.js +2 -2
- package/dist/src/docker/compose/operations/ComposeLogsArchiveOperation.d.ts +1 -1
- package/dist/src/docker/credentials.d.ts +20 -0
- package/dist/src/docker/credentials.js +157 -0
- package/dist/src/docker/operations/images/PushImagesOperation.js +5 -7
- package/dist/src/docker/resources/DockerImageResource.js +79 -0
- package/dist/src/kubernetes/index.d.ts +1 -0
- package/dist/src/kubernetes/index.js +1 -0
- package/dist/src/kubernetes/operations/GetComponentPodOperation.d.ts +17 -0
- package/dist/src/kubernetes/operations/GetComponentPodOperation.js +77 -0
- package/dist/src/kubernetes/operations/GetDeploymentPodsOperation.js +4 -2
- package/dist/src/kubernetes/operations/PodExecOperation.d.ts +20 -0
- package/dist/src/kubernetes/operations/PodExecOperation.js +158 -0
- package/dist/src/kubernetes/operations/index.d.ts +3 -0
- package/dist/src/kubernetes/operations/index.js +3 -0
- package/dist/src/kubernetes/utils/index.d.ts +1 -0
- package/dist/src/kubernetes/utils/index.js +1 -0
- package/dist/src/kubernetes/utils/resolveNamespace.d.ts +13 -0
- package/dist/src/kubernetes/utils/resolveNamespace.js +12 -0
- package/dist/src/monorepo/operations/resources/PublishResourcesOperation.d.ts +19 -0
- package/dist/src/monorepo/operations/resources/PublishResourcesOperation.js +120 -0
- package/dist/src/monorepo/operations/tasks/RunTasksOperation.d.ts +2 -0
- package/dist/src/monorepo/operations/tasks/RunTasksOperation.js +43 -3
- package/oclif.manifest.json +98 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ $ npm install -g @enspirit/emb
|
|
|
14
14
|
$ emb COMMAND
|
|
15
15
|
running command...
|
|
16
16
|
$ emb (--version)
|
|
17
|
-
@enspirit/emb/0.
|
|
17
|
+
@enspirit/emb/0.25.0 darwin-arm64 node-v22.21.1
|
|
18
18
|
$ emb --help [COMMAND]
|
|
19
19
|
USAGE
|
|
20
20
|
$ emb COMMAND
|
|
@@ -45,6 +45,7 @@ USAGE
|
|
|
45
45
|
* [`emb ps`](#emb-ps)
|
|
46
46
|
* [`emb resources`](#emb-resources)
|
|
47
47
|
* [`emb resources build [COMPONENT]`](#emb-resources-build-component)
|
|
48
|
+
* [`emb resources publish [RESOURCES]`](#emb-resources-publish-resources)
|
|
48
49
|
* [`emb restart [SERVICE]`](#emb-restart-service)
|
|
49
50
|
* [`emb run TASK`](#emb-run-task)
|
|
50
51
|
* [`emb secrets`](#emb-secrets)
|
|
@@ -112,7 +113,7 @@ EXAMPLES
|
|
|
112
113
|
$ emb clean
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
_See code: [src/commands/clean.ts](https://github.com/enspirit/emb/blob/v0.
|
|
116
|
+
_See code: [src/commands/clean.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/clean.ts)_
|
|
116
117
|
|
|
117
118
|
## `emb components`
|
|
118
119
|
|
|
@@ -137,7 +138,7 @@ EXAMPLES
|
|
|
137
138
|
$ emb components
|
|
138
139
|
```
|
|
139
140
|
|
|
140
|
-
_See code: [src/commands/components/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
141
|
+
_See code: [src/commands/components/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/components/index.ts)_
|
|
141
142
|
|
|
142
143
|
## `emb components shell SERVICE`
|
|
143
144
|
|
|
@@ -165,7 +166,7 @@ EXAMPLES
|
|
|
165
166
|
$ emb components shell
|
|
166
167
|
```
|
|
167
168
|
|
|
168
|
-
_See code: [src/commands/components/shell.ts](https://github.com/enspirit/emb/blob/v0.
|
|
169
|
+
_See code: [src/commands/components/shell.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/components/shell.ts)_
|
|
169
170
|
|
|
170
171
|
## `emb config print`
|
|
171
172
|
|
|
@@ -190,7 +191,7 @@ EXAMPLES
|
|
|
190
191
|
$ emb config print
|
|
191
192
|
```
|
|
192
193
|
|
|
193
|
-
_See code: [src/commands/config/print.ts](https://github.com/enspirit/emb/blob/v0.
|
|
194
|
+
_See code: [src/commands/config/print.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/config/print.ts)_
|
|
194
195
|
|
|
195
196
|
## `emb containers`
|
|
196
197
|
|
|
@@ -215,7 +216,7 @@ EXAMPLES
|
|
|
215
216
|
$ emb containers
|
|
216
217
|
```
|
|
217
218
|
|
|
218
|
-
_See code: [src/commands/containers/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
219
|
+
_See code: [src/commands/containers/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/containers/index.ts)_
|
|
219
220
|
|
|
220
221
|
## `emb containers prune`
|
|
221
222
|
|
|
@@ -239,7 +240,7 @@ EXAMPLES
|
|
|
239
240
|
$ emb containers prune
|
|
240
241
|
```
|
|
241
242
|
|
|
242
|
-
_See code: [src/commands/containers/prune.ts](https://github.com/enspirit/emb/blob/v0.
|
|
243
|
+
_See code: [src/commands/containers/prune.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/containers/prune.ts)_
|
|
243
244
|
|
|
244
245
|
## `emb down [SERVICE]`
|
|
245
246
|
|
|
@@ -267,7 +268,7 @@ EXAMPLES
|
|
|
267
268
|
$ emb down
|
|
268
269
|
```
|
|
269
270
|
|
|
270
|
-
_See code: [src/commands/down.ts](https://github.com/enspirit/emb/blob/v0.
|
|
271
|
+
_See code: [src/commands/down.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/down.ts)_
|
|
271
272
|
|
|
272
273
|
## `emb help [COMMAND]`
|
|
273
274
|
|
|
@@ -313,7 +314,7 @@ EXAMPLES
|
|
|
313
314
|
$ emb images
|
|
314
315
|
```
|
|
315
316
|
|
|
316
|
-
_See code: [src/commands/images/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
317
|
+
_See code: [src/commands/images/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/images/index.ts)_
|
|
317
318
|
|
|
318
319
|
## `emb images delete`
|
|
319
320
|
|
|
@@ -338,7 +339,7 @@ EXAMPLES
|
|
|
338
339
|
$ emb images delete
|
|
339
340
|
```
|
|
340
341
|
|
|
341
|
-
_See code: [src/commands/images/delete.ts](https://github.com/enspirit/emb/blob/v0.
|
|
342
|
+
_See code: [src/commands/images/delete.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/images/delete.ts)_
|
|
342
343
|
|
|
343
344
|
## `emb images prune`
|
|
344
345
|
|
|
@@ -363,11 +364,11 @@ EXAMPLES
|
|
|
363
364
|
$ emb images prune
|
|
364
365
|
```
|
|
365
366
|
|
|
366
|
-
_See code: [src/commands/images/prune.ts](https://github.com/enspirit/emb/blob/v0.
|
|
367
|
+
_See code: [src/commands/images/prune.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/images/prune.ts)_
|
|
367
368
|
|
|
368
369
|
## `emb images push`
|
|
369
370
|
|
|
370
|
-
Push docker images.
|
|
371
|
+
[DEPRECATED] Push docker images. Use "emb resources publish" instead.
|
|
371
372
|
|
|
372
373
|
```
|
|
373
374
|
USAGE
|
|
@@ -384,7 +385,7 @@ GLOBAL FLAGS
|
|
|
384
385
|
--json Format output as json.
|
|
385
386
|
|
|
386
387
|
DESCRIPTION
|
|
387
|
-
Push docker images.
|
|
388
|
+
[DEPRECATED] Push docker images. Use "emb resources publish" instead.
|
|
388
389
|
|
|
389
390
|
EXAMPLES
|
|
390
391
|
$ emb images push
|
|
@@ -392,7 +393,7 @@ EXAMPLES
|
|
|
392
393
|
$ emb images push --registry my.registry.io --retag newtag
|
|
393
394
|
```
|
|
394
395
|
|
|
395
|
-
_See code: [src/commands/images/push.ts](https://github.com/enspirit/emb/blob/v0.
|
|
396
|
+
_See code: [src/commands/images/push.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/images/push.ts)_
|
|
396
397
|
|
|
397
398
|
## `emb kubernetes logs COMPONENT`
|
|
398
399
|
|
|
@@ -400,7 +401,7 @@ Follow kubernetes logs.
|
|
|
400
401
|
|
|
401
402
|
```
|
|
402
403
|
USAGE
|
|
403
|
-
$ emb kubernetes logs COMPONENT -
|
|
404
|
+
$ emb kubernetes logs COMPONENT [--verbose] [-C <value>] [-n <value>] [-f]
|
|
404
405
|
|
|
405
406
|
ARGUMENTS
|
|
406
407
|
COMPONENT The component you want to see the logs of
|
|
@@ -408,7 +409,7 @@ ARGUMENTS
|
|
|
408
409
|
FLAGS
|
|
409
410
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
410
411
|
-f, --[no-]follow Follow log output
|
|
411
|
-
-n, --namespace=<value>
|
|
412
|
+
-n, --namespace=<value> The Kubernetes namespace to target
|
|
412
413
|
--[no-]verbose
|
|
413
414
|
|
|
414
415
|
DESCRIPTION
|
|
@@ -418,7 +419,7 @@ EXAMPLES
|
|
|
418
419
|
$ emb kubernetes logs
|
|
419
420
|
```
|
|
420
421
|
|
|
421
|
-
_See code: [src/commands/kubernetes/logs.ts](https://github.com/enspirit/emb/blob/v0.
|
|
422
|
+
_See code: [src/commands/kubernetes/logs.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/kubernetes/logs.ts)_
|
|
422
423
|
|
|
423
424
|
## `emb kubernetes ps`
|
|
424
425
|
|
|
@@ -426,11 +427,11 @@ Show running pods.
|
|
|
426
427
|
|
|
427
428
|
```
|
|
428
429
|
USAGE
|
|
429
|
-
$ emb kubernetes ps -
|
|
430
|
+
$ emb kubernetes ps [--verbose] [-C <value>] [-n <value>] [--watch]
|
|
430
431
|
|
|
431
432
|
FLAGS
|
|
432
433
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
433
|
-
-n, --namespace=<value>
|
|
434
|
+
-n, --namespace=<value> The Kubernetes namespace to target
|
|
434
435
|
--[no-]verbose
|
|
435
436
|
--[no-]watch
|
|
436
437
|
|
|
@@ -441,7 +442,7 @@ EXAMPLES
|
|
|
441
442
|
$ emb kubernetes ps
|
|
442
443
|
```
|
|
443
444
|
|
|
444
|
-
_See code: [src/commands/kubernetes/ps.ts](https://github.com/enspirit/emb/blob/v0.
|
|
445
|
+
_See code: [src/commands/kubernetes/ps.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/kubernetes/ps.ts)_
|
|
445
446
|
|
|
446
447
|
## `emb kubernetes restart [DEPLOYMENT]`
|
|
447
448
|
|
|
@@ -449,14 +450,14 @@ Restart pods of an instance.
|
|
|
449
450
|
|
|
450
451
|
```
|
|
451
452
|
USAGE
|
|
452
|
-
$ emb kubernetes restart [DEPLOYMENT...] -
|
|
453
|
+
$ emb kubernetes restart [DEPLOYMENT...] [--verbose] [-C <value>] [-n <value>]
|
|
453
454
|
|
|
454
455
|
ARGUMENTS
|
|
455
456
|
[DEPLOYMENT...] The deployment(s) to restart
|
|
456
457
|
|
|
457
458
|
FLAGS
|
|
458
459
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
459
|
-
-n, --namespace=<value>
|
|
460
|
+
-n, --namespace=<value> The Kubernetes namespace to target
|
|
460
461
|
--[no-]verbose
|
|
461
462
|
|
|
462
463
|
DESCRIPTION
|
|
@@ -466,7 +467,7 @@ EXAMPLES
|
|
|
466
467
|
$ emb kubernetes restart
|
|
467
468
|
```
|
|
468
469
|
|
|
469
|
-
_See code: [src/commands/kubernetes/restart.ts](https://github.com/enspirit/emb/blob/v0.
|
|
470
|
+
_See code: [src/commands/kubernetes/restart.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/kubernetes/restart.ts)_
|
|
470
471
|
|
|
471
472
|
## `emb kubernetes shell COMPONENT`
|
|
472
473
|
|
|
@@ -474,14 +475,14 @@ Get a shell on a deployed component.
|
|
|
474
475
|
|
|
475
476
|
```
|
|
476
477
|
USAGE
|
|
477
|
-
$ emb kubernetes shell COMPONENT -
|
|
478
|
+
$ emb kubernetes shell COMPONENT [--verbose] [-C <value>] [-n <value>] [-s <value>]
|
|
478
479
|
|
|
479
480
|
ARGUMENTS
|
|
480
481
|
COMPONENT The component you want to get a shell on
|
|
481
482
|
|
|
482
483
|
FLAGS
|
|
483
484
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
484
|
-
-n, --namespace=<value>
|
|
485
|
+
-n, --namespace=<value> The Kubernetes namespace to target
|
|
485
486
|
-s, --shell=<value> [default: bash] The shell to run
|
|
486
487
|
--[no-]verbose
|
|
487
488
|
|
|
@@ -495,7 +496,7 @@ EXAMPLES
|
|
|
495
496
|
$ emb kubernetes shell
|
|
496
497
|
```
|
|
497
498
|
|
|
498
|
-
_See code: [src/commands/kubernetes/shell.ts](https://github.com/enspirit/emb/blob/v0.
|
|
499
|
+
_See code: [src/commands/kubernetes/shell.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/kubernetes/shell.ts)_
|
|
499
500
|
|
|
500
501
|
## `emb logs [SERVICE]`
|
|
501
502
|
|
|
@@ -526,7 +527,7 @@ EXAMPLES
|
|
|
526
527
|
$ emb logs --no-follow backend
|
|
527
528
|
```
|
|
528
529
|
|
|
529
|
-
_See code: [src/commands/logs/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
530
|
+
_See code: [src/commands/logs/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/logs/index.ts)_
|
|
530
531
|
|
|
531
532
|
## `emb logs archive [SERVICE]`
|
|
532
533
|
|
|
@@ -562,7 +563,7 @@ EXAMPLES
|
|
|
562
563
|
$ emb logs archive --tail 1000
|
|
563
564
|
```
|
|
564
565
|
|
|
565
|
-
_See code: [src/commands/logs/archive.ts](https://github.com/enspirit/emb/blob/v0.
|
|
566
|
+
_See code: [src/commands/logs/archive.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/logs/archive.ts)_
|
|
566
567
|
|
|
567
568
|
## `emb ps`
|
|
568
569
|
|
|
@@ -585,7 +586,7 @@ EXAMPLES
|
|
|
585
586
|
$ emb ps
|
|
586
587
|
```
|
|
587
588
|
|
|
588
|
-
_See code: [src/commands/ps.ts](https://github.com/enspirit/emb/blob/v0.
|
|
589
|
+
_See code: [src/commands/ps.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/ps.ts)_
|
|
589
590
|
|
|
590
591
|
## `emb resources`
|
|
591
592
|
|
|
@@ -593,11 +594,12 @@ List resources.
|
|
|
593
594
|
|
|
594
595
|
```
|
|
595
596
|
USAGE
|
|
596
|
-
$ emb resources [--json] [--verbose] [-C <value>] [--flavor <value>]
|
|
597
|
+
$ emb resources [--json] [--verbose] [-C <value>] [--flavor <value>] [--publishable]
|
|
597
598
|
|
|
598
599
|
FLAGS
|
|
599
600
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
600
601
|
--flavor=<value> Specify the flavor to use.
|
|
602
|
+
--publishable Only show resources that are publishable (publish: true)
|
|
601
603
|
--[no-]verbose
|
|
602
604
|
|
|
603
605
|
GLOBAL FLAGS
|
|
@@ -608,9 +610,11 @@ DESCRIPTION
|
|
|
608
610
|
|
|
609
611
|
EXAMPLES
|
|
610
612
|
$ emb resources
|
|
613
|
+
|
|
614
|
+
$ emb resources --publishable
|
|
611
615
|
```
|
|
612
616
|
|
|
613
|
-
_See code: [src/commands/resources/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
617
|
+
_See code: [src/commands/resources/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/resources/index.ts)_
|
|
614
618
|
|
|
615
619
|
## `emb resources build [COMPONENT]`
|
|
616
620
|
|
|
@@ -619,6 +623,7 @@ Build the resources of the monorepo
|
|
|
619
623
|
```
|
|
620
624
|
USAGE
|
|
621
625
|
$ emb resources build [COMPONENT...] [--json] [--verbose] [-C <value>] [--flavor <value>] [--dry-run] [-f]
|
|
626
|
+
[--publishable]
|
|
622
627
|
|
|
623
628
|
ARGUMENTS
|
|
624
629
|
[COMPONENT...] List of resources to build (defaults to all)
|
|
@@ -628,6 +633,7 @@ FLAGS
|
|
|
628
633
|
-f, --force Bypass the cache and force the build
|
|
629
634
|
--dry-run Do not build the resources but only produce build meta information
|
|
630
635
|
--flavor=<value> Specify the flavor to use.
|
|
636
|
+
--publishable Only build resources that are publishable (publish: true) and their dependencies
|
|
631
637
|
--[no-]verbose
|
|
632
638
|
|
|
633
639
|
GLOBAL FLAGS
|
|
@@ -638,9 +644,42 @@ DESCRIPTION
|
|
|
638
644
|
|
|
639
645
|
EXAMPLES
|
|
640
646
|
$ emb resources build build --flavor development
|
|
647
|
+
|
|
648
|
+
$ emb resources build build --publishable --flavor production
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
_See code: [src/commands/resources/build.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/resources/build.ts)_
|
|
652
|
+
|
|
653
|
+
## `emb resources publish [RESOURCES]`
|
|
654
|
+
|
|
655
|
+
Publish resources to their registries
|
|
656
|
+
|
|
657
|
+
```
|
|
658
|
+
USAGE
|
|
659
|
+
$ emb resources publish [RESOURCES...] [--json] [--verbose] [-C <value>] [--flavor <value>] [--dry-run]
|
|
660
|
+
|
|
661
|
+
ARGUMENTS
|
|
662
|
+
[RESOURCES...] List of resources to publish (defaults to all publishable)
|
|
663
|
+
|
|
664
|
+
FLAGS
|
|
665
|
+
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
666
|
+
--dry-run Do not publish, just show what would be published
|
|
667
|
+
--flavor=<value> Specify the flavor to use.
|
|
668
|
+
--[no-]verbose
|
|
669
|
+
|
|
670
|
+
GLOBAL FLAGS
|
|
671
|
+
--json Format output as json.
|
|
672
|
+
|
|
673
|
+
DESCRIPTION
|
|
674
|
+
Publish resources to their registries
|
|
675
|
+
|
|
676
|
+
EXAMPLES
|
|
677
|
+
$ emb resources publish --flavor production
|
|
678
|
+
|
|
679
|
+
$ emb resources publish api:image --flavor production
|
|
641
680
|
```
|
|
642
681
|
|
|
643
|
-
_See code: [src/commands/resources/
|
|
682
|
+
_See code: [src/commands/resources/publish.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/resources/publish.ts)_
|
|
644
683
|
|
|
645
684
|
## `emb restart [SERVICE]`
|
|
646
685
|
|
|
@@ -668,7 +707,7 @@ EXAMPLES
|
|
|
668
707
|
$ emb restart
|
|
669
708
|
```
|
|
670
709
|
|
|
671
|
-
_See code: [src/commands/restart.ts](https://github.com/enspirit/emb/blob/v0.
|
|
710
|
+
_See code: [src/commands/restart.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/restart.ts)_
|
|
672
711
|
|
|
673
712
|
## `emb run TASK`
|
|
674
713
|
|
|
@@ -676,7 +715,7 @@ Run tasks.
|
|
|
676
715
|
|
|
677
716
|
```
|
|
678
717
|
USAGE
|
|
679
|
-
$ emb run TASK... [--json] [--verbose] [-C <value>] [-x container|local] [-a]
|
|
718
|
+
$ emb run TASK... [--json] [--verbose] [-C <value>] [-x container|kubernetes|local] [-a]
|
|
680
719
|
|
|
681
720
|
ARGUMENTS
|
|
682
721
|
TASK... List of tasks to run. You can provide either ids or names (eg: component:task or task)
|
|
@@ -685,7 +724,7 @@ FLAGS
|
|
|
685
724
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
686
725
|
-a, --all-matching Run all tasks matching (when multiple matches)
|
|
687
726
|
-x, --executor=<option> Where to run the task. (experimental!)
|
|
688
|
-
<options: container|local>
|
|
727
|
+
<options: container|kubernetes|local>
|
|
689
728
|
--[no-]verbose
|
|
690
729
|
|
|
691
730
|
GLOBAL FLAGS
|
|
@@ -726,7 +765,7 @@ EXAMPLES
|
|
|
726
765
|
$ emb secrets --json
|
|
727
766
|
```
|
|
728
767
|
|
|
729
|
-
_See code: [src/commands/secrets/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
768
|
+
_See code: [src/commands/secrets/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/secrets/index.ts)_
|
|
730
769
|
|
|
731
770
|
## `emb secrets providers`
|
|
732
771
|
|
|
@@ -751,7 +790,7 @@ EXAMPLES
|
|
|
751
790
|
$ emb secrets providers
|
|
752
791
|
```
|
|
753
792
|
|
|
754
|
-
_See code: [src/commands/secrets/providers.ts](https://github.com/enspirit/emb/blob/v0.
|
|
793
|
+
_See code: [src/commands/secrets/providers.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/secrets/providers.ts)_
|
|
755
794
|
|
|
756
795
|
## `emb secrets validate`
|
|
757
796
|
|
|
@@ -781,7 +820,7 @@ EXAMPLES
|
|
|
781
820
|
$ emb secrets validate --json
|
|
782
821
|
```
|
|
783
822
|
|
|
784
|
-
_See code: [src/commands/secrets/validate.ts](https://github.com/enspirit/emb/blob/v0.
|
|
823
|
+
_See code: [src/commands/secrets/validate.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/secrets/validate.ts)_
|
|
785
824
|
|
|
786
825
|
## `emb shell SERVICE`
|
|
787
826
|
|
|
@@ -834,7 +873,7 @@ EXAMPLES
|
|
|
834
873
|
$ emb start
|
|
835
874
|
```
|
|
836
875
|
|
|
837
|
-
_See code: [src/commands/start.ts](https://github.com/enspirit/emb/blob/v0.
|
|
876
|
+
_See code: [src/commands/start.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/start.ts)_
|
|
838
877
|
|
|
839
878
|
## `emb stop [SERVICE]`
|
|
840
879
|
|
|
@@ -862,7 +901,7 @@ EXAMPLES
|
|
|
862
901
|
$ emb stop
|
|
863
902
|
```
|
|
864
903
|
|
|
865
|
-
_See code: [src/commands/stop.ts](https://github.com/enspirit/emb/blob/v0.
|
|
904
|
+
_See code: [src/commands/stop.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/stop.ts)_
|
|
866
905
|
|
|
867
906
|
## `emb tasks`
|
|
868
907
|
|
|
@@ -886,7 +925,7 @@ EXAMPLES
|
|
|
886
925
|
$ emb tasks
|
|
887
926
|
```
|
|
888
927
|
|
|
889
|
-
_See code: [src/commands/tasks/index.ts](https://github.com/enspirit/emb/blob/v0.
|
|
928
|
+
_See code: [src/commands/tasks/index.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/tasks/index.ts)_
|
|
890
929
|
|
|
891
930
|
## `emb tasks run TASK`
|
|
892
931
|
|
|
@@ -894,7 +933,7 @@ Run tasks.
|
|
|
894
933
|
|
|
895
934
|
```
|
|
896
935
|
USAGE
|
|
897
|
-
$ emb tasks run TASK... [--json] [--verbose] [-C <value>] [-x container|local] [-a]
|
|
936
|
+
$ emb tasks run TASK... [--json] [--verbose] [-C <value>] [-x container|kubernetes|local] [-a]
|
|
898
937
|
|
|
899
938
|
ARGUMENTS
|
|
900
939
|
TASK... List of tasks to run. You can provide either ids or names (eg: component:task or task)
|
|
@@ -903,7 +942,7 @@ FLAGS
|
|
|
903
942
|
-C, --root=<value> Run as if emb was started in <path>. Can also be set via EMB_ROOT env var.
|
|
904
943
|
-a, --all-matching Run all tasks matching (when multiple matches)
|
|
905
944
|
-x, --executor=<option> Where to run the task. (experimental!)
|
|
906
|
-
<options: container|local>
|
|
945
|
+
<options: container|kubernetes|local>
|
|
907
946
|
--[no-]verbose
|
|
908
947
|
|
|
909
948
|
GLOBAL FLAGS
|
|
@@ -919,7 +958,7 @@ EXAMPLES
|
|
|
919
958
|
$ emb tasks run
|
|
920
959
|
```
|
|
921
960
|
|
|
922
|
-
_See code: [src/commands/tasks/run.ts](https://github.com/enspirit/emb/blob/v0.
|
|
961
|
+
_See code: [src/commands/tasks/run.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/tasks/run.ts)_
|
|
923
962
|
|
|
924
963
|
## `emb up [SERVICE]`
|
|
925
964
|
|
|
@@ -948,7 +987,7 @@ EXAMPLES
|
|
|
948
987
|
$ emb up
|
|
949
988
|
```
|
|
950
989
|
|
|
951
|
-
_See code: [src/commands/up.ts](https://github.com/enspirit/emb/blob/v0.
|
|
990
|
+
_See code: [src/commands/up.ts](https://github.com/enspirit/emb/blob/v0.25.0/src/commands/up.ts)_
|
|
952
991
|
|
|
953
992
|
## `emb update [CHANNEL]`
|
|
954
993
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { BaseCommand } from './BaseCommand.js';
|
|
2
2
|
export declare abstract class KubernetesCommand extends BaseCommand {
|
|
3
3
|
static baseFlags: {
|
|
4
|
-
namespace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
4
|
+
namespace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
5
5
|
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
6
|
root: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the namespace using CLI flag > K8S_NAMESPACE env > config > 'default'
|
|
10
|
+
*/
|
|
11
|
+
protected resolveNamespace(cliFlag?: string): string;
|
|
8
12
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
|
+
import { resolveNamespace } from '../../kubernetes/utils/index.js';
|
|
2
3
|
import { BaseCommand } from './BaseCommand.js';
|
|
3
4
|
export class KubernetesCommand extends BaseCommand {
|
|
4
5
|
static baseFlags = {
|
|
@@ -8,8 +9,16 @@ export class KubernetesCommand extends BaseCommand {
|
|
|
8
9
|
description: 'The Kubernetes namespace to target',
|
|
9
10
|
aliases: ['ns'],
|
|
10
11
|
char: 'n',
|
|
11
|
-
required:
|
|
12
|
-
env: 'K8S_NAMESPACE',
|
|
12
|
+
required: false,
|
|
13
13
|
}),
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the namespace using CLI flag > K8S_NAMESPACE env > config > 'default'
|
|
17
|
+
*/
|
|
18
|
+
resolveNamespace(cliFlag) {
|
|
19
|
+
return resolveNamespace({
|
|
20
|
+
cliFlag,
|
|
21
|
+
config: this.context.monorepo.config.defaults?.kubernetes?.namespace,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
15
24
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { FlavoredCommand } from '../../index.js';
|
|
2
2
|
export default class ImagesPush extends FlavoredCommand<typeof ImagesPush> {
|
|
3
|
+
static deprecationOptions: {
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
3
6
|
static description: string;
|
|
4
7
|
static enableJsonFlag: boolean;
|
|
5
8
|
static examples: string[];
|
|
@@ -2,7 +2,10 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { FlavoredCommand } from '../../index.js';
|
|
3
3
|
import { PushImagesOperation } from '../../../docker/operations/images/PushImagesOperation.js';
|
|
4
4
|
export default class ImagesPush extends FlavoredCommand {
|
|
5
|
-
static
|
|
5
|
+
static deprecationOptions = {
|
|
6
|
+
message: 'Use "emb resources publish" instead. Configure publishing with publish: true on resources and defaults.docker.publish in .emb.yml',
|
|
7
|
+
};
|
|
8
|
+
static description = '[DEPRECATED] Push docker images. Use "emb resources publish" instead.';
|
|
6
9
|
static enableJsonFlag = true;
|
|
7
10
|
static examples = [
|
|
8
11
|
'<%= config.bin %> <%= command.id %>',
|
|
@@ -2,7 +2,7 @@ import { Log } from '@kubernetes/client-node';
|
|
|
2
2
|
import { Args, Flags } from '@oclif/core';
|
|
3
3
|
import { PassThrough } from 'node:stream';
|
|
4
4
|
import { KubernetesCommand } from '../../index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { GetComponentPodOperation } from '../../../kubernetes/operations/index.js';
|
|
6
6
|
export default class KubernetesLogs extends KubernetesCommand {
|
|
7
7
|
static description = 'Follow kubernetes logs.';
|
|
8
8
|
static enableJsonFlag = false;
|
|
@@ -26,23 +26,18 @@ export default class KubernetesLogs extends KubernetesCommand {
|
|
|
26
26
|
async run() {
|
|
27
27
|
const { flags, args } = await this.parse(KubernetesLogs);
|
|
28
28
|
const { monorepo, kubernetes } = this.context;
|
|
29
|
-
|
|
30
|
-
monorepo.component(args.component);
|
|
31
|
-
const
|
|
32
|
-
namespace
|
|
33
|
-
|
|
29
|
+
const namespace = this.resolveNamespace(flags.namespace);
|
|
30
|
+
const component = monorepo.component(args.component);
|
|
31
|
+
const { pod, container } = await monorepo.run(new GetComponentPodOperation(), {
|
|
32
|
+
namespace,
|
|
33
|
+
component,
|
|
34
34
|
});
|
|
35
|
-
if (pods.length === 0) {
|
|
36
|
-
throw new Error(`No running pod found for component ${args.component}`);
|
|
37
|
-
}
|
|
38
35
|
const k8sLogs = new Log(kubernetes.config);
|
|
39
36
|
const transform = new PassThrough();
|
|
40
37
|
transform.on('data', (chunk) => {
|
|
41
38
|
process.stdout.write(chunk);
|
|
42
39
|
});
|
|
43
|
-
|
|
44
|
-
const container = pod.spec.containers[0];
|
|
45
|
-
await k8sLogs.log(flags.namespace, pod.metadata.name, container.name, transform, {
|
|
40
|
+
await k8sLogs.log(namespace, pod.metadata.name, container, transform, {
|
|
46
41
|
follow: flags.follow,
|
|
47
42
|
tailLines: 50,
|
|
48
43
|
pretty: false,
|
|
@@ -15,8 +15,9 @@ export default class KPSCommand extends KubernetesCommand {
|
|
|
15
15
|
async run() {
|
|
16
16
|
const { flags } = await this.parse(KPSCommand);
|
|
17
17
|
const { kubernetes } = getContext();
|
|
18
|
+
const namespace = this.resolveNamespace(flags.namespace);
|
|
18
19
|
const { items } = await kubernetes.core.listNamespacedPod({
|
|
19
|
-
namespace
|
|
20
|
+
namespace,
|
|
20
21
|
});
|
|
21
22
|
const pods = items.map((i) => {
|
|
22
23
|
const restarts = i.status?.containerStatuses
|
|
@@ -14,8 +14,9 @@ export default class KRestartCommand extends KubernetesCommand {
|
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags, argv } = await this.parse(KRestartCommand);
|
|
16
16
|
const { monorepo } = getContext();
|
|
17
|
+
const namespace = this.resolveNamespace(flags.namespace);
|
|
17
18
|
await monorepo.run(new PodsRestartOperation(), {
|
|
18
|
-
namespace
|
|
19
|
+
namespace,
|
|
19
20
|
deployments: argv.length > 0 ? argv : undefined,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exec } from '@kubernetes/client-node';
|
|
2
2
|
import { Args, Flags } from '@oclif/core';
|
|
3
3
|
import { getContext, KubernetesCommand } from '../../index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { GetComponentPodOperation } from '../../../kubernetes/operations/index.js';
|
|
5
5
|
import { enableRawMode } from '../../../utils/streams.js';
|
|
6
6
|
export default class PodShellCommand extends KubernetesCommand {
|
|
7
7
|
static aliases = ['shell'];
|
|
@@ -26,18 +26,15 @@ export default class PodShellCommand extends KubernetesCommand {
|
|
|
26
26
|
async run() {
|
|
27
27
|
const { flags, args } = await this.parse(PodShellCommand);
|
|
28
28
|
const { monorepo, kubernetes } = await getContext();
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const namespace = this.resolveNamespace(flags.namespace);
|
|
30
|
+
const component = monorepo.component(args.component);
|
|
31
|
+
const { pod, container } = await monorepo.run(new GetComponentPodOperation(), {
|
|
32
|
+
namespace,
|
|
33
|
+
component,
|
|
32
34
|
});
|
|
33
|
-
if (pods.length === 0) {
|
|
34
|
-
throw new Error(`No running pod found for component ${args.component}`);
|
|
35
|
-
}
|
|
36
|
-
const pod = pods[0];
|
|
37
|
-
const container = pod.spec.containers[0];
|
|
38
35
|
const exec = new Exec(kubernetes.config);
|
|
39
36
|
enableRawMode(process.stdin);
|
|
40
|
-
const res = await exec.exec(
|
|
37
|
+
const res = await exec.exec(namespace, pod.metadata.name, container, [flags.shell], process.stdout, process.stderr, process.stdin, true);
|
|
41
38
|
res.on('close', () => {
|
|
42
39
|
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit
|
|
43
40
|
process.exit(0);
|
|
@@ -9,6 +9,7 @@ export default class ResourcesBuildCommand extends FlavoredCommand<typeof Resour
|
|
|
9
9
|
static flags: {
|
|
10
10
|
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
publishable: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
};
|
|
13
14
|
static enableJsonFlag: boolean;
|
|
14
15
|
static strict: boolean;
|
|
@@ -11,6 +11,7 @@ export default class ResourcesBuildCommand extends FlavoredCommand {
|
|
|
11
11
|
static description = 'Build the resources of the monorepo';
|
|
12
12
|
static examples = [
|
|
13
13
|
`<%= config.bin %> <%= command.id %> build --flavor development`,
|
|
14
|
+
`<%= config.bin %> <%= command.id %> build --publishable --flavor production`,
|
|
14
15
|
];
|
|
15
16
|
static flags = {
|
|
16
17
|
'dry-run': Flags.boolean({
|
|
@@ -23,15 +24,28 @@ export default class ResourcesBuildCommand extends FlavoredCommand {
|
|
|
23
24
|
required: false,
|
|
24
25
|
description: 'Bypass the cache and force the build',
|
|
25
26
|
}),
|
|
27
|
+
publishable: Flags.boolean({
|
|
28
|
+
required: false,
|
|
29
|
+
description: 'Only build resources that are publishable (publish: true) and their dependencies',
|
|
30
|
+
}),
|
|
26
31
|
};
|
|
27
32
|
static enableJsonFlag = true;
|
|
28
33
|
static strict = false;
|
|
29
34
|
async run() {
|
|
30
35
|
const { argv, flags } = await this.parse(ResourcesBuildCommand);
|
|
31
36
|
const { monorepo } = getContext();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
let toBuild;
|
|
38
|
+
if (argv.length > 0) {
|
|
39
|
+
toBuild = argv;
|
|
40
|
+
}
|
|
41
|
+
else if (flags.publishable) {
|
|
42
|
+
toBuild = monorepo.resources
|
|
43
|
+
.filter((r) => r.publish === true)
|
|
44
|
+
.map((r) => r.id);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
toBuild = monorepo.resources.map((c) => c.id);
|
|
48
|
+
}
|
|
35
49
|
return monorepo.run(new BuildResourcesOperation(), {
|
|
36
50
|
dryRun: flags['dry-run'],
|
|
37
51
|
force: flags.force,
|