hereya-cli 0.92.2 → 0.93.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
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g hereya-cli
|
|
|
21
21
|
$ hereya COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ hereya (--version)
|
|
24
|
-
hereya-cli/0.
|
|
24
|
+
hereya-cli/0.93.0 linux-x64 node-v24.14.1
|
|
25
25
|
$ hereya --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ hereya COMMAND
|
|
@@ -50,6 +50,7 @@ USAGE
|
|
|
50
50
|
* [`hereya devenv install`](#hereya-devenv-install)
|
|
51
51
|
* [`hereya devenv project init PROJECT`](#hereya-devenv-project-init-project)
|
|
52
52
|
* [`hereya devenv project uninit PROJECT`](#hereya-devenv-project-uninit-project)
|
|
53
|
+
* [`hereya devenv sleep`](#hereya-devenv-sleep)
|
|
53
54
|
* [`hereya devenv ssh`](#hereya-devenv-ssh)
|
|
54
55
|
* [`hereya devenv uninstall`](#hereya-devenv-uninstall)
|
|
55
56
|
* [`hereya doc PACKAGE`](#hereya-doc-package)
|
|
@@ -128,7 +129,7 @@ EXAMPLES
|
|
|
128
129
|
$ hereya add cloudy/docker_postgres
|
|
129
130
|
```
|
|
130
131
|
|
|
131
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
132
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/add/index.ts)_
|
|
132
133
|
|
|
133
134
|
## `hereya app deploy NAME`
|
|
134
135
|
|
|
@@ -162,7 +163,7 @@ EXAMPLES
|
|
|
162
163
|
$ hereya app deploy my-org/my-app -w prod -p organizationId=org-123
|
|
163
164
|
```
|
|
164
165
|
|
|
165
|
-
_See code: [src/commands/app/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
166
|
+
_See code: [src/commands/app/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/deploy/index.ts)_
|
|
166
167
|
|
|
167
168
|
## `hereya app deployments NAME`
|
|
168
169
|
|
|
@@ -182,7 +183,7 @@ EXAMPLES
|
|
|
182
183
|
$ hereya app deployments my-org/my-app
|
|
183
184
|
```
|
|
184
185
|
|
|
185
|
-
_See code: [src/commands/app/deployments/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
186
|
+
_See code: [src/commands/app/deployments/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/deployments/index.ts)_
|
|
186
187
|
|
|
187
188
|
## `hereya app destroy NAME`
|
|
188
189
|
|
|
@@ -211,7 +212,7 @@ EXAMPLES
|
|
|
211
212
|
$ hereya app destroy my-org/my-app -w my-workspace
|
|
212
213
|
```
|
|
213
214
|
|
|
214
|
-
_See code: [src/commands/app/destroy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
215
|
+
_See code: [src/commands/app/destroy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/destroy/index.ts)_
|
|
215
216
|
|
|
216
217
|
## `hereya app env NAME [KEY]`
|
|
217
218
|
|
|
@@ -237,7 +238,7 @@ EXAMPLES
|
|
|
237
238
|
$ hereya app env my-org/my-app -w my-workspace DATABASE_URL
|
|
238
239
|
```
|
|
239
240
|
|
|
240
|
-
_See code: [src/commands/app/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
241
|
+
_See code: [src/commands/app/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/env/index.ts)_
|
|
241
242
|
|
|
242
243
|
## `hereya app list`
|
|
243
244
|
|
|
@@ -254,7 +255,7 @@ EXAMPLES
|
|
|
254
255
|
$ hereya app list
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
_See code: [src/commands/app/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
258
|
+
_See code: [src/commands/app/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/list/index.ts)_
|
|
258
259
|
|
|
259
260
|
## `hereya app new DIRNAME`
|
|
260
261
|
|
|
@@ -280,7 +281,7 @@ EXAMPLES
|
|
|
280
281
|
$ hereya app new ./my-app -n my-org/my-app --description "An ai-app-builder app"
|
|
281
282
|
```
|
|
282
283
|
|
|
283
|
-
_See code: [src/commands/app/new/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
284
|
+
_See code: [src/commands/app/new/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/new/index.ts)_
|
|
284
285
|
|
|
285
286
|
## `hereya app status NAME`
|
|
286
287
|
|
|
@@ -303,7 +304,7 @@ EXAMPLES
|
|
|
303
304
|
$ hereya app status my-org/my-app -w my-workspace
|
|
304
305
|
```
|
|
305
306
|
|
|
306
|
-
_See code: [src/commands/app/status/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
307
|
+
_See code: [src/commands/app/status/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/status/index.ts)_
|
|
307
308
|
|
|
308
309
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
309
310
|
|
|
@@ -328,7 +329,7 @@ EXAMPLES
|
|
|
328
329
|
$ hereya bootstrap local
|
|
329
330
|
```
|
|
330
331
|
|
|
331
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
332
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/bootstrap/index.ts)_
|
|
332
333
|
|
|
333
334
|
## `hereya clone PROJECT`
|
|
334
335
|
|
|
@@ -353,7 +354,7 @@ EXAMPLES
|
|
|
353
354
|
$ hereya clone myProject --chdir=./myProject
|
|
354
355
|
```
|
|
355
356
|
|
|
356
|
-
_See code: [src/commands/clone/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
357
|
+
_See code: [src/commands/clone/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/clone/index.ts)_
|
|
357
358
|
|
|
358
359
|
## `hereya config export-backend [FILE]`
|
|
359
360
|
|
|
@@ -375,7 +376,7 @@ EXAMPLES
|
|
|
375
376
|
$ hereya config export-backend ./path/to/export.json
|
|
376
377
|
```
|
|
377
378
|
|
|
378
|
-
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
379
|
+
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/export-backend/index.ts)_
|
|
379
380
|
|
|
380
381
|
## `hereya config get-backend`
|
|
381
382
|
|
|
@@ -392,7 +393,7 @@ EXAMPLES
|
|
|
392
393
|
$ hereya config get-backend
|
|
393
394
|
```
|
|
394
395
|
|
|
395
|
-
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
396
|
+
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/get-backend/index.ts)_
|
|
396
397
|
|
|
397
398
|
## `hereya config import-backend FILE`
|
|
398
399
|
|
|
@@ -412,7 +413,7 @@ EXAMPLES
|
|
|
412
413
|
$ hereya config import-backend ./path/to/cloud-backend.json
|
|
413
414
|
```
|
|
414
415
|
|
|
415
|
-
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
416
|
+
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/import-backend/index.ts)_
|
|
416
417
|
|
|
417
418
|
## `hereya config use-backend TYPE`
|
|
418
419
|
|
|
@@ -434,7 +435,7 @@ EXAMPLES
|
|
|
434
435
|
$ hereya config use-backend local
|
|
435
436
|
```
|
|
436
437
|
|
|
437
|
-
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
438
|
+
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/use-backend/index.ts)_
|
|
438
439
|
|
|
439
440
|
## `hereya delete-state`
|
|
440
441
|
|
|
@@ -460,7 +461,7 @@ EXAMPLES
|
|
|
460
461
|
$ hereya delete-state --workspace staging
|
|
461
462
|
```
|
|
462
463
|
|
|
463
|
-
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
464
|
+
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/delete-state/index.ts)_
|
|
464
465
|
|
|
465
466
|
## `hereya deploy`
|
|
466
467
|
|
|
@@ -486,7 +487,7 @@ EXAMPLES
|
|
|
486
487
|
$ hereya deploy
|
|
487
488
|
```
|
|
488
489
|
|
|
489
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
490
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/deploy/index.ts)_
|
|
490
491
|
|
|
491
492
|
## `hereya devenv config`
|
|
492
493
|
|
|
@@ -506,7 +507,7 @@ EXAMPLES
|
|
|
506
507
|
$ hereya devenv config -w my-workspace
|
|
507
508
|
```
|
|
508
509
|
|
|
509
|
-
_See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
510
|
+
_See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/config/index.ts)_
|
|
510
511
|
|
|
511
512
|
## `hereya devenv install`
|
|
512
513
|
|
|
@@ -531,7 +532,7 @@ EXAMPLES
|
|
|
531
532
|
$ hereya devenv install -w my-workspace -p instanceType=t3.large
|
|
532
533
|
```
|
|
533
534
|
|
|
534
|
-
_See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
535
|
+
_See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/install/index.ts)_
|
|
535
536
|
|
|
536
537
|
## `hereya devenv project init PROJECT`
|
|
537
538
|
|
|
@@ -563,7 +564,7 @@ EXAMPLES
|
|
|
563
564
|
$ hereya devenv project init my-app -w my-workspace -t acme/node-starter -p region=us-east-1
|
|
564
565
|
```
|
|
565
566
|
|
|
566
|
-
_See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
567
|
+
_See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/project/init/index.ts)_
|
|
567
568
|
|
|
568
569
|
## `hereya devenv project uninit PROJECT`
|
|
569
570
|
|
|
@@ -589,7 +590,28 @@ EXAMPLES
|
|
|
589
590
|
$ hereya devenv project uninit my-app -w my-workspace --force
|
|
590
591
|
```
|
|
591
592
|
|
|
592
|
-
_See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
593
|
+
_See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/project/uninit/index.ts)_
|
|
594
|
+
|
|
595
|
+
## `hereya devenv sleep`
|
|
596
|
+
|
|
597
|
+
Stop the dev environment instance for a workspace (lifecycle=on-demand only).
|
|
598
|
+
|
|
599
|
+
```
|
|
600
|
+
USAGE
|
|
601
|
+
$ hereya devenv sleep -w <value> [--debug]
|
|
602
|
+
|
|
603
|
+
FLAGS
|
|
604
|
+
-w, --workspace=<value> (required) name of the workspace whose dev environment should be stopped
|
|
605
|
+
--debug enable debug mode
|
|
606
|
+
|
|
607
|
+
DESCRIPTION
|
|
608
|
+
Stop the dev environment instance for a workspace (lifecycle=on-demand only).
|
|
609
|
+
|
|
610
|
+
EXAMPLES
|
|
611
|
+
$ hereya devenv sleep -w my-workspace
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
_See code: [src/commands/devenv/sleep/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/sleep/index.ts)_
|
|
593
615
|
|
|
594
616
|
## `hereya devenv ssh`
|
|
595
617
|
|
|
@@ -609,7 +631,7 @@ EXAMPLES
|
|
|
609
631
|
$ hereya devenv ssh -w my-workspace
|
|
610
632
|
```
|
|
611
633
|
|
|
612
|
-
_See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
634
|
+
_See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/ssh/index.ts)_
|
|
613
635
|
|
|
614
636
|
## `hereya devenv uninstall`
|
|
615
637
|
|
|
@@ -630,7 +652,7 @@ EXAMPLES
|
|
|
630
652
|
$ hereya devenv uninstall -w my-workspace
|
|
631
653
|
```
|
|
632
654
|
|
|
633
|
-
_See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
655
|
+
_See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/uninstall/index.ts)_
|
|
634
656
|
|
|
635
657
|
## `hereya doc PACKAGE`
|
|
636
658
|
|
|
@@ -663,7 +685,7 @@ EXAMPLES
|
|
|
663
685
|
$ hereya doc my-package --no-doc
|
|
664
686
|
```
|
|
665
687
|
|
|
666
|
-
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
688
|
+
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/doc/index.ts)_
|
|
667
689
|
|
|
668
690
|
## `hereya docker run IMAGE`
|
|
669
691
|
|
|
@@ -694,7 +716,7 @@ EXAMPLES
|
|
|
694
716
|
$ hereya docker run myapp:latest -- --rm -v ./data:/data
|
|
695
717
|
```
|
|
696
718
|
|
|
697
|
-
_See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
719
|
+
_See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/docker/run/index.ts)_
|
|
698
720
|
|
|
699
721
|
## `hereya down`
|
|
700
722
|
|
|
@@ -721,7 +743,7 @@ EXAMPLES
|
|
|
721
743
|
$ hereya down
|
|
722
744
|
```
|
|
723
745
|
|
|
724
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
746
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/down/index.ts)_
|
|
725
747
|
|
|
726
748
|
## `hereya env [NAME]`
|
|
727
749
|
|
|
@@ -752,7 +774,7 @@ EXAMPLES
|
|
|
752
774
|
$ hereya env -w dev -l
|
|
753
775
|
```
|
|
754
776
|
|
|
755
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
777
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/env/index.ts)_
|
|
756
778
|
|
|
757
779
|
## `hereya env set [NAME]`
|
|
758
780
|
|
|
@@ -779,7 +801,7 @@ EXAMPLES
|
|
|
779
801
|
$ hereya env set FOO -v bar -w dev
|
|
780
802
|
```
|
|
781
803
|
|
|
782
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
804
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/env/set/index.ts)_
|
|
783
805
|
|
|
784
806
|
## `hereya executor start`
|
|
785
807
|
|
|
@@ -813,7 +835,7 @@ EXAMPLES
|
|
|
813
835
|
HEREYA_TOKEN=<token> HEREYA_CLOUD_URL=https://my-cloud.example.com hereya executor start -w my-workspace
|
|
814
836
|
```
|
|
815
837
|
|
|
816
|
-
_See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
838
|
+
_See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/executor/start/index.ts)_
|
|
817
839
|
|
|
818
840
|
## `hereya flow add PACKAGE`
|
|
819
841
|
|
|
@@ -851,7 +873,7 @@ EXAMPLES
|
|
|
851
873
|
$ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
|
|
852
874
|
```
|
|
853
875
|
|
|
854
|
-
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
876
|
+
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/add/index.ts)_
|
|
855
877
|
|
|
856
878
|
## `hereya flow docker run IMAGE`
|
|
857
879
|
|
|
@@ -881,7 +903,7 @@ EXAMPLES
|
|
|
881
903
|
$ hereya flow docker run --pin myapp:latest -- --rm
|
|
882
904
|
```
|
|
883
905
|
|
|
884
|
-
_See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
906
|
+
_See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/docker/run/index.ts)_
|
|
885
907
|
|
|
886
908
|
## `hereya flow down`
|
|
887
909
|
|
|
@@ -915,7 +937,7 @@ EXAMPLES
|
|
|
915
937
|
$ hereya flow down --pin
|
|
916
938
|
```
|
|
917
939
|
|
|
918
|
-
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
940
|
+
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/down/index.ts)_
|
|
919
941
|
|
|
920
942
|
## `hereya flow env [NAME]`
|
|
921
943
|
|
|
@@ -949,7 +971,7 @@ EXAMPLES
|
|
|
949
971
|
$ hereya flow env -l
|
|
950
972
|
```
|
|
951
973
|
|
|
952
|
-
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
974
|
+
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/env/index.ts)_
|
|
953
975
|
|
|
954
976
|
## `hereya flow provid PACKAGE`
|
|
955
977
|
|
|
@@ -978,7 +1000,7 @@ EXAMPLES
|
|
|
978
1000
|
$ hereya flow provid hereya/postgres --pin
|
|
979
1001
|
```
|
|
980
1002
|
|
|
981
|
-
_See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1003
|
+
_See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/provid/index.ts)_
|
|
982
1004
|
|
|
983
1005
|
## `hereya flow remove PACKAGE`
|
|
984
1006
|
|
|
@@ -1008,7 +1030,7 @@ EXAMPLES
|
|
|
1008
1030
|
$ hereya flow remove cloudy/docker_postgres --profile staging
|
|
1009
1031
|
```
|
|
1010
1032
|
|
|
1011
|
-
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1033
|
+
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/remove/index.ts)_
|
|
1012
1034
|
|
|
1013
1035
|
## `hereya flow run CMD`
|
|
1014
1036
|
|
|
@@ -1037,7 +1059,7 @@ EXAMPLES
|
|
|
1037
1059
|
$ hereya flow run --pin -- npm test
|
|
1038
1060
|
```
|
|
1039
1061
|
|
|
1040
|
-
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1062
|
+
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/run/index.ts)_
|
|
1041
1063
|
|
|
1042
1064
|
## `hereya flow up`
|
|
1043
1065
|
|
|
@@ -1071,7 +1093,7 @@ EXAMPLES
|
|
|
1071
1093
|
$ hereya flow up --pin
|
|
1072
1094
|
```
|
|
1073
1095
|
|
|
1074
|
-
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1096
|
+
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/up/index.ts)_
|
|
1075
1097
|
|
|
1076
1098
|
## `hereya help [COMMAND]`
|
|
1077
1099
|
|
|
@@ -1128,7 +1150,7 @@ EXAMPLES
|
|
|
1128
1150
|
$ hereya import org/my-package -f state.tfstate -w my-workspace
|
|
1129
1151
|
```
|
|
1130
1152
|
|
|
1131
|
-
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1153
|
+
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/import/index.ts)_
|
|
1132
1154
|
|
|
1133
1155
|
## `hereya import-repo PROJECT`
|
|
1134
1156
|
|
|
@@ -1158,7 +1180,7 @@ EXAMPLES
|
|
|
1158
1180
|
$ hereya import-repo myProject -w=dev -r=https://github.com/acme/api --clone --chdir=./api
|
|
1159
1181
|
```
|
|
1160
1182
|
|
|
1161
|
-
_See code: [src/commands/import-repo/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1183
|
+
_See code: [src/commands/import-repo/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/import-repo/index.ts)_
|
|
1162
1184
|
|
|
1163
1185
|
## `hereya init PROJECT`
|
|
1164
1186
|
|
|
@@ -1192,7 +1214,7 @@ EXAMPLES
|
|
|
1192
1214
|
$ hereya init myProject -w=dev -t=acme/node-starter -d=prod -p region=us-east-1
|
|
1193
1215
|
```
|
|
1194
1216
|
|
|
1195
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1217
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/init/index.ts)_
|
|
1196
1218
|
|
|
1197
1219
|
## `hereya list`
|
|
1198
1220
|
|
|
@@ -1209,7 +1231,7 @@ EXAMPLES
|
|
|
1209
1231
|
$ hereya list
|
|
1210
1232
|
```
|
|
1211
1233
|
|
|
1212
|
-
_See code: [src/commands/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1234
|
+
_See code: [src/commands/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/list/index.ts)_
|
|
1213
1235
|
|
|
1214
1236
|
## `hereya login [URL]`
|
|
1215
1237
|
|
|
@@ -1238,7 +1260,7 @@ EXAMPLES
|
|
|
1238
1260
|
$ hereya login --token=your-token https://cloud.hereya.dev
|
|
1239
1261
|
```
|
|
1240
1262
|
|
|
1241
|
-
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1263
|
+
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/login/index.ts)_
|
|
1242
1264
|
|
|
1243
1265
|
## `hereya logout`
|
|
1244
1266
|
|
|
@@ -1255,7 +1277,7 @@ EXAMPLES
|
|
|
1255
1277
|
$ hereya logout
|
|
1256
1278
|
```
|
|
1257
1279
|
|
|
1258
|
-
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1280
|
+
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/logout/index.ts)_
|
|
1259
1281
|
|
|
1260
1282
|
## `hereya provid PACKAGE`
|
|
1261
1283
|
|
|
@@ -1283,7 +1305,7 @@ EXAMPLES
|
|
|
1283
1305
|
$ hereya provid hereya/postgres --workspace staging
|
|
1284
1306
|
```
|
|
1285
1307
|
|
|
1286
|
-
_See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1308
|
+
_See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/provid/index.ts)_
|
|
1287
1309
|
|
|
1288
1310
|
## `hereya publish`
|
|
1289
1311
|
|
|
@@ -1306,7 +1328,7 @@ EXAMPLES
|
|
|
1306
1328
|
$ hereya publish --chdir=/path/to/package
|
|
1307
1329
|
```
|
|
1308
1330
|
|
|
1309
|
-
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1331
|
+
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/publish/index.ts)_
|
|
1310
1332
|
|
|
1311
1333
|
## `hereya remove PACKAGE`
|
|
1312
1334
|
|
|
@@ -1334,7 +1356,7 @@ EXAMPLES
|
|
|
1334
1356
|
$ hereya remove cloudy/docker_postgres
|
|
1335
1357
|
```
|
|
1336
1358
|
|
|
1337
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1359
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/remove/index.ts)_
|
|
1338
1360
|
|
|
1339
1361
|
## `hereya run CMD`
|
|
1340
1362
|
|
|
@@ -1360,7 +1382,7 @@ EXAMPLES
|
|
|
1360
1382
|
$ hereya run -w uat -- node index.js
|
|
1361
1383
|
```
|
|
1362
1384
|
|
|
1363
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1385
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/run/index.ts)_
|
|
1364
1386
|
|
|
1365
1387
|
## `hereya search QUERY`
|
|
1366
1388
|
|
|
@@ -1391,7 +1413,7 @@ EXAMPLES
|
|
|
1391
1413
|
$ hereya search database --json
|
|
1392
1414
|
```
|
|
1393
1415
|
|
|
1394
|
-
_See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1416
|
+
_See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/search/index.ts)_
|
|
1395
1417
|
|
|
1396
1418
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
1397
1419
|
|
|
@@ -1416,7 +1438,7 @@ EXAMPLES
|
|
|
1416
1438
|
$ hereya unbootstrap local
|
|
1417
1439
|
```
|
|
1418
1440
|
|
|
1419
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1441
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/unbootstrap/index.ts)_
|
|
1420
1442
|
|
|
1421
1443
|
## `hereya undeploy`
|
|
1422
1444
|
|
|
@@ -1442,7 +1464,7 @@ EXAMPLES
|
|
|
1442
1464
|
$ hereya undeploy
|
|
1443
1465
|
```
|
|
1444
1466
|
|
|
1445
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1467
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/undeploy/index.ts)_
|
|
1446
1468
|
|
|
1447
1469
|
## `hereya uninit PROJECT`
|
|
1448
1470
|
|
|
@@ -1470,7 +1492,7 @@ EXAMPLES
|
|
|
1470
1492
|
$ hereya uninit myProject -w dev -p prodWorkspace=prod
|
|
1471
1493
|
```
|
|
1472
1494
|
|
|
1473
|
-
_See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1495
|
+
_See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/uninit/index.ts)_
|
|
1474
1496
|
|
|
1475
1497
|
## `hereya up`
|
|
1476
1498
|
|
|
@@ -1497,7 +1519,7 @@ EXAMPLES
|
|
|
1497
1519
|
$ hereya up
|
|
1498
1520
|
```
|
|
1499
1521
|
|
|
1500
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1522
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/up/index.ts)_
|
|
1501
1523
|
|
|
1502
1524
|
## `hereya update [VERSION]`
|
|
1503
1525
|
|
|
@@ -1519,7 +1541,7 @@ EXAMPLES
|
|
|
1519
1541
|
$ hereya update 0.75.0
|
|
1520
1542
|
```
|
|
1521
1543
|
|
|
1522
|
-
_See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1544
|
+
_See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/update/index.ts)_
|
|
1523
1545
|
|
|
1524
1546
|
## `hereya workspace create NAME`
|
|
1525
1547
|
|
|
@@ -1544,7 +1566,7 @@ EXAMPLES
|
|
|
1544
1566
|
$ hereya workspace create dev
|
|
1545
1567
|
```
|
|
1546
1568
|
|
|
1547
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1569
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/create/index.ts)_
|
|
1548
1570
|
|
|
1549
1571
|
## `hereya workspace delete NAME`
|
|
1550
1572
|
|
|
@@ -1564,7 +1586,7 @@ EXAMPLES
|
|
|
1564
1586
|
$ hereya workspace delete dev
|
|
1565
1587
|
```
|
|
1566
1588
|
|
|
1567
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1589
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/delete/index.ts)_
|
|
1568
1590
|
|
|
1569
1591
|
## `hereya workspace env [NAME]`
|
|
1570
1592
|
|
|
@@ -1590,7 +1612,7 @@ EXAMPLES
|
|
|
1590
1612
|
$ hereya workspace env myEnv -w dev
|
|
1591
1613
|
```
|
|
1592
1614
|
|
|
1593
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1615
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/env/index.ts)_
|
|
1594
1616
|
|
|
1595
1617
|
## `hereya workspace env set`
|
|
1596
1618
|
|
|
@@ -1614,7 +1636,7 @@ EXAMPLES
|
|
|
1614
1636
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
1615
1637
|
```
|
|
1616
1638
|
|
|
1617
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1639
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/env/set/index.ts)_
|
|
1618
1640
|
|
|
1619
1641
|
## `hereya workspace env unset`
|
|
1620
1642
|
|
|
@@ -1635,7 +1657,7 @@ EXAMPLES
|
|
|
1635
1657
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
1636
1658
|
```
|
|
1637
1659
|
|
|
1638
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1660
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/env/unset/index.ts)_
|
|
1639
1661
|
|
|
1640
1662
|
## `hereya workspace executor install`
|
|
1641
1663
|
|
|
@@ -1662,7 +1684,7 @@ DESCRIPTION
|
|
|
1662
1684
|
- ephemeral: ASG scaled to 0 with a broker Lambda + OIDC for on-demand wake.
|
|
1663
1685
|
```
|
|
1664
1686
|
|
|
1665
|
-
_See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1687
|
+
_See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/executor/install/index.ts)_
|
|
1666
1688
|
|
|
1667
1689
|
## `hereya workspace executor token`
|
|
1668
1690
|
|
|
@@ -1679,7 +1701,7 @@ DESCRIPTION
|
|
|
1679
1701
|
Generate a workspace-scoped executor token for the remote executor
|
|
1680
1702
|
```
|
|
1681
1703
|
|
|
1682
|
-
_See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1704
|
+
_See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/executor/token/index.ts)_
|
|
1683
1705
|
|
|
1684
1706
|
## `hereya workspace executor uninstall`
|
|
1685
1707
|
|
|
@@ -1703,7 +1725,7 @@ DESCRIPTION
|
|
|
1703
1725
|
controls log output.
|
|
1704
1726
|
```
|
|
1705
1727
|
|
|
1706
|
-
_See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1728
|
+
_See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/executor/uninstall/index.ts)_
|
|
1707
1729
|
|
|
1708
1730
|
## `hereya workspace install PACKAGE`
|
|
1709
1731
|
|
|
@@ -1730,7 +1752,7 @@ EXAMPLES
|
|
|
1730
1752
|
$ hereya workspace install hereya/aws-cognito
|
|
1731
1753
|
```
|
|
1732
1754
|
|
|
1733
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1755
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/install/index.ts)_
|
|
1734
1756
|
|
|
1735
1757
|
## `hereya workspace list`
|
|
1736
1758
|
|
|
@@ -1754,7 +1776,7 @@ EXAMPLES
|
|
|
1754
1776
|
$ hereya workspace list --org personal
|
|
1755
1777
|
```
|
|
1756
1778
|
|
|
1757
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1779
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/list/index.ts)_
|
|
1758
1780
|
|
|
1759
1781
|
## `hereya workspace set-profile PROFILE`
|
|
1760
1782
|
|
|
@@ -1778,7 +1800,7 @@ EXAMPLES
|
|
|
1778
1800
|
$ hereya workspace set-profile prod-profile -w production
|
|
1779
1801
|
```
|
|
1780
1802
|
|
|
1781
|
-
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1803
|
+
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/set-profile/index.ts)_
|
|
1782
1804
|
|
|
1783
1805
|
## `hereya workspace uninstall PACKAGE`
|
|
1784
1806
|
|
|
@@ -1805,5 +1827,5 @@ EXAMPLES
|
|
|
1805
1827
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
1806
1828
|
```
|
|
1807
1829
|
|
|
1808
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1830
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/uninstall/index.ts)_
|
|
1809
1831
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class DevenvSleep extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
|
+
import { getBackend } from '../../../backend/index.js';
|
|
4
|
+
import { getExecutorForWorkspace } from '../../../executor/context.js';
|
|
5
|
+
import { getLogPath, isDebug, setDebug } from '../../../lib/log.js';
|
|
6
|
+
export default class DevenvSleep extends Command {
|
|
7
|
+
static description = 'Stop the dev environment instance for a workspace (lifecycle=on-demand only).';
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %> -w my-workspace'];
|
|
9
|
+
static flags = {
|
|
10
|
+
debug: Flags.boolean({
|
|
11
|
+
default: false,
|
|
12
|
+
description: 'enable debug mode',
|
|
13
|
+
}),
|
|
14
|
+
workspace: Flags.string({
|
|
15
|
+
char: 'w',
|
|
16
|
+
description: 'name of the workspace whose dev environment should be stopped',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(DevenvSleep);
|
|
22
|
+
setDebug(flags.debug);
|
|
23
|
+
const myLogger = new ListrLogger({ useIcons: false });
|
|
24
|
+
const task = new Listr([
|
|
25
|
+
{
|
|
26
|
+
async task(ctx, task) {
|
|
27
|
+
return task.newListr([
|
|
28
|
+
{
|
|
29
|
+
async task(ctx) {
|
|
30
|
+
const backend = await getBackend();
|
|
31
|
+
const getWorkspaceEnvOutput = await backend.getWorkspaceEnv({ workspace: flags.workspace });
|
|
32
|
+
if (!getWorkspaceEnvOutput.success) {
|
|
33
|
+
throw new Error(getWorkspaceEnvOutput.reason);
|
|
34
|
+
}
|
|
35
|
+
const executor$ = await getExecutorForWorkspace(flags.workspace);
|
|
36
|
+
if (!executor$.success) {
|
|
37
|
+
throw new Error(executor$.reason);
|
|
38
|
+
}
|
|
39
|
+
const { executor } = executor$;
|
|
40
|
+
const env = await executor.resolveEnvValues({ env: getWorkspaceEnvOutput.env });
|
|
41
|
+
if (!env.devEnvWakeUrl) {
|
|
42
|
+
throw new Error(`Workspace ${flags.workspace} was not provisioned with lifecycle=on-demand; nothing to sleep.`);
|
|
43
|
+
}
|
|
44
|
+
ctx.wakeUrl = env.devEnvWakeUrl;
|
|
45
|
+
ctx.wakeToken = env.devEnvWakeToken;
|
|
46
|
+
},
|
|
47
|
+
title: `Loading workspace ${flags.workspace}`,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
async task(ctx) {
|
|
51
|
+
const response = await fetch(`${ctx.wakeUrl}/sleep`, {
|
|
52
|
+
headers: { Authorization: `Bearer ${ctx.wakeToken}` },
|
|
53
|
+
method: 'POST',
|
|
54
|
+
});
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
const body = await response.text().catch(() => '');
|
|
57
|
+
throw new Error(`broker /sleep returned ${response.status}: ${body}`);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
title: 'Stopping dev environment',
|
|
61
|
+
},
|
|
62
|
+
]);
|
|
63
|
+
},
|
|
64
|
+
title: `Putting dev environment to sleep for workspace ${flags.workspace}`,
|
|
65
|
+
},
|
|
66
|
+
], { concurrent: false, rendererOptions: { collapseSubtasks: !isDebug() } });
|
|
67
|
+
try {
|
|
68
|
+
await task.run();
|
|
69
|
+
myLogger.log(ListrLogLevels.COMPLETED, 'Dev environment is now stopping');
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
this.error(`${error.message}
|
|
73
|
+
|
|
74
|
+
See ${getLogPath()} for more details`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { Listr } from 'listr2';
|
|
2
3
|
import { spawnSync } from 'node:child_process';
|
|
3
4
|
import { randomUUID } from 'node:crypto';
|
|
4
5
|
import fs from 'node:fs/promises';
|
|
@@ -6,7 +7,21 @@ import os from 'node:os';
|
|
|
6
7
|
import path from 'node:path';
|
|
7
8
|
import { getBackend } from '../../../backend/index.js';
|
|
8
9
|
import { getExecutorForWorkspace } from '../../../executor/context.js';
|
|
10
|
+
import { getLogPath } from '../../../lib/log.js';
|
|
9
11
|
import { setKeyFilePermissions } from '../../../lib/ssh-utils.js';
|
|
12
|
+
// Polling cadence and overall timeout for the wake broker. Overridable via env
|
|
13
|
+
// vars purely to keep tests fast — the defaults are the production values.
|
|
14
|
+
function getWakePollIntervalMs() {
|
|
15
|
+
return Number(process.env.HEREYA_WAKE_POLL_INTERVAL_MS) || 4000;
|
|
16
|
+
}
|
|
17
|
+
function getWakeTimeoutMs() {
|
|
18
|
+
return Number(process.env.HEREYA_WAKE_TIMEOUT_MS) || 90_000;
|
|
19
|
+
}
|
|
20
|
+
function sleep(ms) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
setTimeout(resolve, ms);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
10
25
|
export default class DevenvSsh extends Command {
|
|
11
26
|
static description = 'SSH into a dev environment instance.';
|
|
12
27
|
static examples = [
|
|
@@ -34,13 +49,26 @@ export default class DevenvSsh extends Command {
|
|
|
34
49
|
}
|
|
35
50
|
const { executor } = executor$;
|
|
36
51
|
env = await executor.resolveEnvValues({ env });
|
|
37
|
-
|
|
52
|
+
let sshHost = env.devEnvSshHost;
|
|
38
53
|
const sshPrivateKey = env.devEnvSshPrivateKey;
|
|
39
54
|
const sshUser = env.devEnvSshUser;
|
|
40
55
|
const sshHostDns = env.devEnvSshHostDns;
|
|
56
|
+
const wakeUrl = env.devEnvWakeUrl;
|
|
57
|
+
const wakeToken = env.devEnvWakeToken;
|
|
41
58
|
if (!sshHost || !sshPrivateKey || !sshUser) {
|
|
42
59
|
this.error('devEnvSshHost, devEnvSshPrivateKey, and devEnvSshUser must be set in the workspace environment');
|
|
43
60
|
}
|
|
61
|
+
if (wakeUrl && wakeToken) {
|
|
62
|
+
try {
|
|
63
|
+
const wakeResult = await this.wakeAndPoll(wakeUrl, wakeToken);
|
|
64
|
+
// Override sshHost with the freshly-resolved IP from the broker
|
|
65
|
+
sshHost = wakeResult.host;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
this.error(`Failed to wake dev environment: ${message}. See ${getLogPath()} for details.`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
44
72
|
const host = sshHostDns || sshHost;
|
|
45
73
|
const tempKeyPath = path.join(os.tmpdir(), `hereya-ssh-${randomUUID()}`);
|
|
46
74
|
try {
|
|
@@ -70,4 +98,64 @@ export default class DevenvSsh extends Command {
|
|
|
70
98
|
}
|
|
71
99
|
return Promise.resolve();
|
|
72
100
|
}
|
|
101
|
+
async fetchStatus(wakeUrl, wakeToken) {
|
|
102
|
+
const response = await fetch(`${wakeUrl}/status`, {
|
|
103
|
+
headers: { Authorization: `Bearer ${wakeToken}` },
|
|
104
|
+
method: 'GET',
|
|
105
|
+
});
|
|
106
|
+
if (!response.ok) {
|
|
107
|
+
const body = await response.text().catch(() => '');
|
|
108
|
+
throw new Error(`broker /status returned ${response.status}: ${body}`);
|
|
109
|
+
}
|
|
110
|
+
return response.json();
|
|
111
|
+
}
|
|
112
|
+
async postWake(wakeUrl, wakeToken) {
|
|
113
|
+
const response = await fetch(`${wakeUrl}/wake`, {
|
|
114
|
+
headers: { Authorization: `Bearer ${wakeToken}` },
|
|
115
|
+
method: 'POST',
|
|
116
|
+
});
|
|
117
|
+
if (!response.ok) {
|
|
118
|
+
const body = await response.text().catch(() => '');
|
|
119
|
+
throw new Error(`broker /wake returned ${response.status}: ${body}`);
|
|
120
|
+
}
|
|
121
|
+
return response.json();
|
|
122
|
+
}
|
|
123
|
+
async wakeAndPoll(wakeUrl, wakeToken) {
|
|
124
|
+
let resultHost = '';
|
|
125
|
+
const pollIntervalMs = getWakePollIntervalMs();
|
|
126
|
+
const timeoutMs = getWakeTimeoutMs();
|
|
127
|
+
const task = new Listr([
|
|
128
|
+
{
|
|
129
|
+
task: async () => {
|
|
130
|
+
const initial = await this.fetchStatus(wakeUrl, wakeToken);
|
|
131
|
+
if (initial.state === 'running' && initial.host) {
|
|
132
|
+
resultHost = initial.host;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
await this.postWake(wakeUrl, wakeToken);
|
|
136
|
+
const start = Date.now();
|
|
137
|
+
let done = false;
|
|
138
|
+
while (!done) {
|
|
139
|
+
if (Date.now() - start >= timeoutMs) {
|
|
140
|
+
throw new Error(`timed out waiting for dev environment to start after ${timeoutMs / 1000}s`);
|
|
141
|
+
}
|
|
142
|
+
// eslint-disable-next-line no-await-in-loop
|
|
143
|
+
await sleep(pollIntervalMs);
|
|
144
|
+
// eslint-disable-next-line no-await-in-loop
|
|
145
|
+
const status = await this.fetchStatus(wakeUrl, wakeToken);
|
|
146
|
+
if (status.state === 'running' && status.host) {
|
|
147
|
+
resultHost = status.host;
|
|
148
|
+
done = true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
title: 'Waking dev environment',
|
|
153
|
+
},
|
|
154
|
+
], { concurrent: false });
|
|
155
|
+
await task.run();
|
|
156
|
+
if (!resultHost) {
|
|
157
|
+
throw new Error('broker did not return a host after wake');
|
|
158
|
+
}
|
|
159
|
+
return { host: resultHost };
|
|
160
|
+
}
|
|
73
161
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -170,13 +170,12 @@
|
|
|
170
170
|
"index.js"
|
|
171
171
|
]
|
|
172
172
|
},
|
|
173
|
-
"
|
|
173
|
+
"deploy": {
|
|
174
174
|
"aliases": [],
|
|
175
175
|
"args": {},
|
|
176
|
-
"description": "
|
|
176
|
+
"description": "Deploy a hereya project using the project deployment package",
|
|
177
177
|
"examples": [
|
|
178
|
-
"<%= config.bin %> <%= command.id %>
|
|
179
|
-
"<%= config.bin %> <%= command.id %> --workspace staging"
|
|
178
|
+
"<%= config.bin %> <%= command.id %>"
|
|
180
179
|
],
|
|
181
180
|
"flags": {
|
|
182
181
|
"chdir": {
|
|
@@ -187,9 +186,21 @@
|
|
|
187
186
|
"multiple": false,
|
|
188
187
|
"type": "option"
|
|
189
188
|
},
|
|
189
|
+
"debug": {
|
|
190
|
+
"description": "enable debug mode",
|
|
191
|
+
"name": "debug",
|
|
192
|
+
"allowNo": false,
|
|
193
|
+
"type": "boolean"
|
|
194
|
+
},
|
|
195
|
+
"local": {
|
|
196
|
+
"description": "force local execution (skip remote executor)",
|
|
197
|
+
"name": "local",
|
|
198
|
+
"allowNo": false,
|
|
199
|
+
"type": "boolean"
|
|
200
|
+
},
|
|
190
201
|
"workspace": {
|
|
191
202
|
"char": "w",
|
|
192
|
-
"description": "workspace
|
|
203
|
+
"description": "name of the workspace to deploy the packages for",
|
|
193
204
|
"name": "workspace",
|
|
194
205
|
"required": true,
|
|
195
206
|
"hasDynamicHelp": false,
|
|
@@ -199,7 +210,7 @@
|
|
|
199
210
|
},
|
|
200
211
|
"hasDynamicHelp": false,
|
|
201
212
|
"hiddenAliases": [],
|
|
202
|
-
"id": "
|
|
213
|
+
"id": "deploy",
|
|
203
214
|
"pluginAlias": "hereya-cli",
|
|
204
215
|
"pluginName": "hereya-cli",
|
|
205
216
|
"pluginType": "core",
|
|
@@ -209,16 +220,17 @@
|
|
|
209
220
|
"relativePath": [
|
|
210
221
|
"dist",
|
|
211
222
|
"commands",
|
|
212
|
-
"
|
|
223
|
+
"deploy",
|
|
213
224
|
"index.js"
|
|
214
225
|
]
|
|
215
226
|
},
|
|
216
|
-
"
|
|
227
|
+
"delete-state": {
|
|
217
228
|
"aliases": [],
|
|
218
229
|
"args": {},
|
|
219
|
-
"description": "
|
|
230
|
+
"description": "Delete the remote state of a project for a given workspace",
|
|
220
231
|
"examples": [
|
|
221
|
-
"<%= config.bin %> <%= command.id %>"
|
|
232
|
+
"<%= config.bin %> <%= command.id %> -w dev",
|
|
233
|
+
"<%= config.bin %> <%= command.id %> --workspace staging"
|
|
222
234
|
],
|
|
223
235
|
"flags": {
|
|
224
236
|
"chdir": {
|
|
@@ -229,21 +241,9 @@
|
|
|
229
241
|
"multiple": false,
|
|
230
242
|
"type": "option"
|
|
231
243
|
},
|
|
232
|
-
"debug": {
|
|
233
|
-
"description": "enable debug mode",
|
|
234
|
-
"name": "debug",
|
|
235
|
-
"allowNo": false,
|
|
236
|
-
"type": "boolean"
|
|
237
|
-
},
|
|
238
|
-
"local": {
|
|
239
|
-
"description": "force local execution (skip remote executor)",
|
|
240
|
-
"name": "local",
|
|
241
|
-
"allowNo": false,
|
|
242
|
-
"type": "boolean"
|
|
243
|
-
},
|
|
244
244
|
"workspace": {
|
|
245
245
|
"char": "w",
|
|
246
|
-
"description": "
|
|
246
|
+
"description": "workspace name",
|
|
247
247
|
"name": "workspace",
|
|
248
248
|
"required": true,
|
|
249
249
|
"hasDynamicHelp": false,
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
},
|
|
254
254
|
"hasDynamicHelp": false,
|
|
255
255
|
"hiddenAliases": [],
|
|
256
|
-
"id": "
|
|
256
|
+
"id": "delete-state",
|
|
257
257
|
"pluginAlias": "hereya-cli",
|
|
258
258
|
"pluginName": "hereya-cli",
|
|
259
259
|
"pluginType": "core",
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
"relativePath": [
|
|
264
264
|
"dist",
|
|
265
265
|
"commands",
|
|
266
|
-
"
|
|
266
|
+
"delete-state",
|
|
267
267
|
"index.js"
|
|
268
268
|
]
|
|
269
269
|
},
|
|
@@ -1540,38 +1540,6 @@
|
|
|
1540
1540
|
"index.js"
|
|
1541
1541
|
]
|
|
1542
1542
|
},
|
|
1543
|
-
"config:export-backend": {
|
|
1544
|
-
"aliases": [],
|
|
1545
|
-
"args": {
|
|
1546
|
-
"file": {
|
|
1547
|
-
"description": "Path to save the export file. Defaults to cloud-backend.json in current directory",
|
|
1548
|
-
"name": "file",
|
|
1549
|
-
"required": false
|
|
1550
|
-
}
|
|
1551
|
-
},
|
|
1552
|
-
"description": "Export the cloud backend configuration to a file",
|
|
1553
|
-
"examples": [
|
|
1554
|
-
"<%= config.bin %> <%= command.id %>",
|
|
1555
|
-
"<%= config.bin %> <%= command.id %> ./path/to/export.json"
|
|
1556
|
-
],
|
|
1557
|
-
"flags": {},
|
|
1558
|
-
"hasDynamicHelp": false,
|
|
1559
|
-
"hiddenAliases": [],
|
|
1560
|
-
"id": "config:export-backend",
|
|
1561
|
-
"pluginAlias": "hereya-cli",
|
|
1562
|
-
"pluginName": "hereya-cli",
|
|
1563
|
-
"pluginType": "core",
|
|
1564
|
-
"strict": true,
|
|
1565
|
-
"enableJsonFlag": false,
|
|
1566
|
-
"isESM": true,
|
|
1567
|
-
"relativePath": [
|
|
1568
|
-
"dist",
|
|
1569
|
-
"commands",
|
|
1570
|
-
"config",
|
|
1571
|
-
"export-backend",
|
|
1572
|
-
"index.js"
|
|
1573
|
-
]
|
|
1574
|
-
},
|
|
1575
1543
|
"app:status": {
|
|
1576
1544
|
"aliases": [],
|
|
1577
1545
|
"args": {
|
|
@@ -1613,6 +1581,38 @@
|
|
|
1613
1581
|
"index.js"
|
|
1614
1582
|
]
|
|
1615
1583
|
},
|
|
1584
|
+
"config:export-backend": {
|
|
1585
|
+
"aliases": [],
|
|
1586
|
+
"args": {
|
|
1587
|
+
"file": {
|
|
1588
|
+
"description": "Path to save the export file. Defaults to cloud-backend.json in current directory",
|
|
1589
|
+
"name": "file",
|
|
1590
|
+
"required": false
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1593
|
+
"description": "Export the cloud backend configuration to a file",
|
|
1594
|
+
"examples": [
|
|
1595
|
+
"<%= config.bin %> <%= command.id %>",
|
|
1596
|
+
"<%= config.bin %> <%= command.id %> ./path/to/export.json"
|
|
1597
|
+
],
|
|
1598
|
+
"flags": {},
|
|
1599
|
+
"hasDynamicHelp": false,
|
|
1600
|
+
"hiddenAliases": [],
|
|
1601
|
+
"id": "config:export-backend",
|
|
1602
|
+
"pluginAlias": "hereya-cli",
|
|
1603
|
+
"pluginName": "hereya-cli",
|
|
1604
|
+
"pluginType": "core",
|
|
1605
|
+
"strict": true,
|
|
1606
|
+
"enableJsonFlag": false,
|
|
1607
|
+
"isESM": true,
|
|
1608
|
+
"relativePath": [
|
|
1609
|
+
"dist",
|
|
1610
|
+
"commands",
|
|
1611
|
+
"config",
|
|
1612
|
+
"export-backend",
|
|
1613
|
+
"index.js"
|
|
1614
|
+
]
|
|
1615
|
+
},
|
|
1616
1616
|
"config:get-backend": {
|
|
1617
1617
|
"aliases": [],
|
|
1618
1618
|
"args": {},
|
|
@@ -1802,6 +1802,47 @@
|
|
|
1802
1802
|
"index.js"
|
|
1803
1803
|
]
|
|
1804
1804
|
},
|
|
1805
|
+
"devenv:sleep": {
|
|
1806
|
+
"aliases": [],
|
|
1807
|
+
"args": {},
|
|
1808
|
+
"description": "Stop the dev environment instance for a workspace (lifecycle=on-demand only).",
|
|
1809
|
+
"examples": [
|
|
1810
|
+
"<%= config.bin %> <%= command.id %> -w my-workspace"
|
|
1811
|
+
],
|
|
1812
|
+
"flags": {
|
|
1813
|
+
"debug": {
|
|
1814
|
+
"description": "enable debug mode",
|
|
1815
|
+
"name": "debug",
|
|
1816
|
+
"allowNo": false,
|
|
1817
|
+
"type": "boolean"
|
|
1818
|
+
},
|
|
1819
|
+
"workspace": {
|
|
1820
|
+
"char": "w",
|
|
1821
|
+
"description": "name of the workspace whose dev environment should be stopped",
|
|
1822
|
+
"name": "workspace",
|
|
1823
|
+
"required": true,
|
|
1824
|
+
"hasDynamicHelp": false,
|
|
1825
|
+
"multiple": false,
|
|
1826
|
+
"type": "option"
|
|
1827
|
+
}
|
|
1828
|
+
},
|
|
1829
|
+
"hasDynamicHelp": false,
|
|
1830
|
+
"hiddenAliases": [],
|
|
1831
|
+
"id": "devenv:sleep",
|
|
1832
|
+
"pluginAlias": "hereya-cli",
|
|
1833
|
+
"pluginName": "hereya-cli",
|
|
1834
|
+
"pluginType": "core",
|
|
1835
|
+
"strict": true,
|
|
1836
|
+
"enableJsonFlag": false,
|
|
1837
|
+
"isESM": true,
|
|
1838
|
+
"relativePath": [
|
|
1839
|
+
"dist",
|
|
1840
|
+
"commands",
|
|
1841
|
+
"devenv",
|
|
1842
|
+
"sleep",
|
|
1843
|
+
"index.js"
|
|
1844
|
+
]
|
|
1845
|
+
},
|
|
1805
1846
|
"devenv:ssh": {
|
|
1806
1847
|
"aliases": [],
|
|
1807
1848
|
"args": {},
|
|
@@ -3320,5 +3361,5 @@
|
|
|
3320
3361
|
]
|
|
3321
3362
|
}
|
|
3322
3363
|
},
|
|
3323
|
-
"version": "0.
|
|
3364
|
+
"version": "0.93.0"
|
|
3324
3365
|
}
|