@enspirit/emb 0.24.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 +72 -33
- 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/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 +18 -0
- package/dist/src/config/schema.json +26 -0
- 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/operations/GetDeploymentPodsOperation.js +2 -1
- package/dist/src/monorepo/operations/resources/PublishResourcesOperation.d.ts +19 -0
- package/dist/src/monorepo/operations/resources/PublishResourcesOperation.js +120 -0
- package/oclif.manifest.json +229 -140
- 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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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,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 %>',
|
|
@@ -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,
|
|
@@ -4,6 +4,8 @@ export default class ResourcesIndex extends FlavoredCommand<typeof ResourcesInde
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static enableJsonFlag: boolean;
|
|
6
6
|
static examples: string[];
|
|
7
|
-
static flags: {
|
|
7
|
+
static flags: {
|
|
8
|
+
publishable: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
8
10
|
run(): Promise<Array<ResourceConfig>>;
|
|
9
11
|
}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
1
2
|
import { printTable } from '@oclif/table';
|
|
2
3
|
import { FlavoredCommand, getContext, TABLE_DEFAULTS } from '../../index.js';
|
|
3
4
|
import { ResourceFactory } from '../../../monorepo/resources/ResourceFactory.js';
|
|
4
5
|
export default class ResourcesIndex extends FlavoredCommand {
|
|
5
6
|
static description = 'List resources.';
|
|
6
7
|
static enableJsonFlag = true;
|
|
7
|
-
static examples = [
|
|
8
|
-
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --publishable',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
publishable: Flags.boolean({
|
|
14
|
+
description: 'Only show resources that are publishable (publish: true)',
|
|
15
|
+
required: false,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
9
18
|
async run() {
|
|
10
19
|
const { flags } = await this.parse(ResourcesIndex);
|
|
11
20
|
const { monorepo } = await getContext();
|
|
12
|
-
|
|
21
|
+
// Filter resources if --publishable flag is set
|
|
22
|
+
let filteredResources = monorepo.resources;
|
|
23
|
+
if (flags.publishable) {
|
|
24
|
+
filteredResources = filteredResources.filter((r) => r.publish === true);
|
|
25
|
+
}
|
|
26
|
+
const resources = await Promise.all(filteredResources.map(async (config) => {
|
|
13
27
|
const component = monorepo.component(config.component);
|
|
14
28
|
const builder = ResourceFactory.factor(config.type, {
|
|
15
29
|
config,
|
|
@@ -22,10 +36,14 @@ export default class ResourcesIndex extends FlavoredCommand {
|
|
|
22
36
|
};
|
|
23
37
|
}));
|
|
24
38
|
if (!flags.json) {
|
|
39
|
+
const displayData = resources.map((r) => ({
|
|
40
|
+
...r,
|
|
41
|
+
publishable: r.publish ? '✓' : '',
|
|
42
|
+
}));
|
|
25
43
|
printTable({
|
|
26
44
|
...TABLE_DEFAULTS,
|
|
27
|
-
columns: ['id', 'name', 'type', 'reference'],
|
|
28
|
-
data:
|
|
45
|
+
columns: ['id', 'name', 'type', 'publishable', 'reference'],
|
|
46
|
+
data: displayData,
|
|
29
47
|
sort: {
|
|
30
48
|
id: 'asc',
|
|
31
49
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FlavoredCommand } from '../../index.js';
|
|
2
|
+
import { PublishResourceMeta } from '../../../monorepo/operations/resources/PublishResourcesOperation.js';
|
|
3
|
+
export default class ResourcesPublishCommand extends FlavoredCommand<typeof ResourcesPublishCommand> {
|
|
4
|
+
static args: {
|
|
5
|
+
resources: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
static enableJsonFlag: boolean;
|
|
13
|
+
static strict: boolean;
|
|
14
|
+
run(): Promise<Record<string, PublishResourceMeta>>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { FlavoredCommand, getContext } from '../../index.js';
|
|
3
|
+
import { PublishResourcesOperation, } from '../../../monorepo/operations/resources/PublishResourcesOperation.js';
|
|
4
|
+
export default class ResourcesPublishCommand extends FlavoredCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
resources: Args.string({
|
|
7
|
+
description: 'List of resources to publish (defaults to all publishable)',
|
|
8
|
+
required: false,
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Publish resources to their registries';
|
|
12
|
+
static examples = [
|
|
13
|
+
`<%= config.bin %> <%= command.id %> --flavor production`,
|
|
14
|
+
`<%= config.bin %> <%= command.id %> api:image --flavor production`,
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
'dry-run': Flags.boolean({
|
|
18
|
+
required: false,
|
|
19
|
+
description: 'Do not publish, just show what would be published',
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
static enableJsonFlag = true;
|
|
23
|
+
static strict = false;
|
|
24
|
+
async run() {
|
|
25
|
+
const { argv, flags } = await this.parse(ResourcesPublishCommand);
|
|
26
|
+
const { monorepo } = getContext();
|
|
27
|
+
// If no resources specified, publish all publishable resources
|
|
28
|
+
const toPublish = argv.length > 0 ? argv : undefined;
|
|
29
|
+
return monorepo.run(new PublishResourcesOperation(), {
|
|
30
|
+
dryRun: flags['dry-run'],
|
|
31
|
+
silent: flags.json,
|
|
32
|
+
resources: toPublish,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -47,6 +47,10 @@ export type ResourceConfig = {
|
|
|
47
47
|
} & {
|
|
48
48
|
type: string;
|
|
49
49
|
params?: unknown;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this resource should be published. Defaults to false.
|
|
52
|
+
*/
|
|
53
|
+
publish?: boolean;
|
|
50
54
|
dependencies?: QualifiedIdentifier[];
|
|
51
55
|
};
|
|
52
56
|
export type JsonPatchOperation = JsonPatchAddOperation | JsonPatchRemoveOperation | JsonPatchReplaceOperation | JsonPatchMoveOperation | JsonPatchCopyOperation;
|
|
@@ -105,10 +109,24 @@ export interface DefaultsConfig {
|
|
|
105
109
|
labels?: {
|
|
106
110
|
[k: string]: string;
|
|
107
111
|
};
|
|
112
|
+
publish?: DockerPublishConfig;
|
|
108
113
|
[k: string]: unknown;
|
|
109
114
|
};
|
|
110
115
|
kubernetes?: KubernetesConfig;
|
|
111
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Configuration for publishing docker images
|
|
119
|
+
*/
|
|
120
|
+
export interface DockerPublishConfig {
|
|
121
|
+
/**
|
|
122
|
+
* Registry to push images to (e.g., ghcr.io/myorg, docker.io/mycompany)
|
|
123
|
+
*/
|
|
124
|
+
registry?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Tag to use when publishing (overrides the build tag)
|
|
127
|
+
*/
|
|
128
|
+
tag?: string;
|
|
129
|
+
}
|
|
112
130
|
/**
|
|
113
131
|
* Kubernetes configuration for the project
|
|
114
132
|
*/
|
|
@@ -135,6 +135,9 @@
|
|
|
135
135
|
"additionalProperties": {
|
|
136
136
|
"type": "string"
|
|
137
137
|
}
|
|
138
|
+
},
|
|
139
|
+
"publish": {
|
|
140
|
+
"$ref": "#/definitions/DockerPublishConfig"
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
},
|
|
@@ -245,6 +248,21 @@
|
|
|
245
248
|
},
|
|
246
249
|
"additionalProperties": false
|
|
247
250
|
},
|
|
251
|
+
"DockerPublishConfig": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"description": "Configuration for publishing docker images",
|
|
254
|
+
"properties": {
|
|
255
|
+
"registry": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"description": "Registry to push images to (e.g., ghcr.io/myorg, docker.io/mycompany)"
|
|
258
|
+
},
|
|
259
|
+
"tag": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"description": "Tag to use when publishing (overrides the build tag)"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"additionalProperties": false
|
|
265
|
+
},
|
|
248
266
|
"DockerImageConfig": {
|
|
249
267
|
"type": "object",
|
|
250
268
|
"properties": {
|
|
@@ -285,6 +303,10 @@
|
|
|
285
303
|
"dockerfile": {
|
|
286
304
|
"type": "string",
|
|
287
305
|
"description": "The Dockerfile to use"
|
|
306
|
+
},
|
|
307
|
+
"publish": {
|
|
308
|
+
"$ref": "#/definitions/DockerPublishConfig",
|
|
309
|
+
"description": "Publishing configuration for this image (overrides defaults.docker.publish)"
|
|
288
310
|
}
|
|
289
311
|
},
|
|
290
312
|
"additionalProperties": false
|
|
@@ -308,6 +330,10 @@
|
|
|
308
330
|
"properties": {
|
|
309
331
|
"type": { "type": "string" },
|
|
310
332
|
"params": {},
|
|
333
|
+
"publish": {
|
|
334
|
+
"type": "boolean",
|
|
335
|
+
"description": "Whether this resource should be published. Defaults to false."
|
|
336
|
+
},
|
|
311
337
|
"dependencies": {
|
|
312
338
|
"type": "array",
|
|
313
339
|
"items": { "$ref": "#/definitions/QualifiedIdentifier" },
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface DockerAuthConfig {
|
|
2
|
+
password: string;
|
|
3
|
+
serveraddress?: string;
|
|
4
|
+
username: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Get Docker authentication credentials for pushing an image.
|
|
8
|
+
*
|
|
9
|
+
* Resolution order:
|
|
10
|
+
* 1. DOCKER_USERNAME and DOCKER_PASSWORD environment variables
|
|
11
|
+
* 2. Credential helper from credHelpers (registry-specific)
|
|
12
|
+
* 3. Default credential store from credsStore
|
|
13
|
+
* 4. Base64-encoded credentials from auths
|
|
14
|
+
* 5. Return undefined to let Docker use its defaults
|
|
15
|
+
*
|
|
16
|
+
* @param imageRef - The full image reference (e.g., "registry.example.com/foo/bar:tag")
|
|
17
|
+
* @returns Authentication config or undefined if relying on Docker defaults
|
|
18
|
+
*/
|
|
19
|
+
export declare function getDockerAuthConfig(imageRef: string): Promise<DockerAuthConfig | undefined>;
|
|
20
|
+
export {};
|