hereya-cli 0.48.0 → 0.49.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 +139 -34
- package/dist/commands/flow/add/index.d.ts +15 -0
- package/dist/commands/flow/add/index.js +90 -0
- package/dist/commands/flow/down/index.js +8 -17
- package/dist/commands/flow/env/index.d.ts +15 -0
- package/dist/commands/flow/env/index.js +64 -0
- package/dist/commands/flow/remove/index.d.ts +14 -0
- package/dist/commands/flow/remove/index.js +75 -0
- package/dist/commands/flow/run/index.js +8 -17
- package/dist/commands/flow/up/index.js +8 -17
- package/dist/lib/flow-utils.d.ts +7 -0
- package/dist/lib/flow-utils.js +22 -0
- package/dist/lib/parameter/index.js +0 -14
- package/oclif.manifest.json +188 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
hereya-cli
|
|
2
2
|
=================
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
The package manager for infrastructure resources.
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
[](https://oclif.io)
|
|
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
|
|
|
20
20
|
$ hereya COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ hereya (--version)
|
|
23
|
-
hereya-cli/0.
|
|
23
|
+
hereya-cli/0.49.0 linux-x64 node-v22.17.1
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -40,7 +40,10 @@ USAGE
|
|
|
40
40
|
* [`hereya down`](#hereya-down)
|
|
41
41
|
* [`hereya env [NAME]`](#hereya-env-name)
|
|
42
42
|
* [`hereya env set [NAME]`](#hereya-env-set-name)
|
|
43
|
+
* [`hereya flow add PACKAGE`](#hereya-flow-add-package)
|
|
43
44
|
* [`hereya flow down`](#hereya-flow-down)
|
|
45
|
+
* [`hereya flow env [NAME]`](#hereya-flow-env-name)
|
|
46
|
+
* [`hereya flow remove PACKAGE`](#hereya-flow-remove-package)
|
|
44
47
|
* [`hereya flow run CMD`](#hereya-flow-run-cmd)
|
|
45
48
|
* [`hereya flow up`](#hereya-flow-up)
|
|
46
49
|
* [`hereya help [COMMAND]`](#hereya-help-command)
|
|
@@ -95,7 +98,7 @@ EXAMPLES
|
|
|
95
98
|
$ hereya add cloudy/docker_postgres
|
|
96
99
|
```
|
|
97
100
|
|
|
98
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
101
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/add/index.ts)_
|
|
99
102
|
|
|
100
103
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
101
104
|
|
|
@@ -120,7 +123,7 @@ EXAMPLES
|
|
|
120
123
|
$ hereya bootstrap local
|
|
121
124
|
```
|
|
122
125
|
|
|
123
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
126
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/bootstrap/index.ts)_
|
|
124
127
|
|
|
125
128
|
## `hereya config export-backend [FILE]`
|
|
126
129
|
|
|
@@ -142,7 +145,7 @@ EXAMPLES
|
|
|
142
145
|
$ hereya config export-backend ./path/to/export.json
|
|
143
146
|
```
|
|
144
147
|
|
|
145
|
-
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
148
|
+
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/config/export-backend/index.ts)_
|
|
146
149
|
|
|
147
150
|
## `hereya config get-backend`
|
|
148
151
|
|
|
@@ -159,7 +162,7 @@ EXAMPLES
|
|
|
159
162
|
$ hereya config get-backend
|
|
160
163
|
```
|
|
161
164
|
|
|
162
|
-
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
165
|
+
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/config/get-backend/index.ts)_
|
|
163
166
|
|
|
164
167
|
## `hereya config import-backend FILE`
|
|
165
168
|
|
|
@@ -179,7 +182,7 @@ EXAMPLES
|
|
|
179
182
|
$ hereya config import-backend ./path/to/cloud-backend.json
|
|
180
183
|
```
|
|
181
184
|
|
|
182
|
-
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
185
|
+
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/config/import-backend/index.ts)_
|
|
183
186
|
|
|
184
187
|
## `hereya config use-backend TYPE`
|
|
185
188
|
|
|
@@ -201,7 +204,7 @@ EXAMPLES
|
|
|
201
204
|
$ hereya config use-backend local
|
|
202
205
|
```
|
|
203
206
|
|
|
204
|
-
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
207
|
+
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/config/use-backend/index.ts)_
|
|
205
208
|
|
|
206
209
|
## `hereya delete-state`
|
|
207
210
|
|
|
@@ -227,7 +230,7 @@ EXAMPLES
|
|
|
227
230
|
$ hereya delete-state --workspace staging
|
|
228
231
|
```
|
|
229
232
|
|
|
230
|
-
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
233
|
+
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/delete-state/index.ts)_
|
|
231
234
|
|
|
232
235
|
## `hereya deploy`
|
|
233
236
|
|
|
@@ -252,7 +255,7 @@ EXAMPLES
|
|
|
252
255
|
$ hereya deploy
|
|
253
256
|
```
|
|
254
257
|
|
|
255
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
258
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/deploy/index.ts)_
|
|
256
259
|
|
|
257
260
|
## `hereya down`
|
|
258
261
|
|
|
@@ -279,7 +282,7 @@ EXAMPLES
|
|
|
279
282
|
$ hereya down
|
|
280
283
|
```
|
|
281
284
|
|
|
282
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
285
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/down/index.ts)_
|
|
283
286
|
|
|
284
287
|
## `hereya env [NAME]`
|
|
285
288
|
|
|
@@ -310,7 +313,7 @@ EXAMPLES
|
|
|
310
313
|
$ hereya env -w dev -l
|
|
311
314
|
```
|
|
312
315
|
|
|
313
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
316
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/env/index.ts)_
|
|
314
317
|
|
|
315
318
|
## `hereya env set [NAME]`
|
|
316
319
|
|
|
@@ -337,7 +340,45 @@ EXAMPLES
|
|
|
337
340
|
$ hereya env set FOO -v bar -w dev
|
|
338
341
|
```
|
|
339
342
|
|
|
340
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
343
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/env/set/index.ts)_
|
|
344
|
+
|
|
345
|
+
## `hereya flow add PACKAGE`
|
|
346
|
+
|
|
347
|
+
Add a package to the project in a git branch-based workspace
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
USAGE
|
|
351
|
+
$ hereya flow add PACKAGE [--chdir <value>] [--debug] [-p <value>...] [--profile <value>]
|
|
352
|
+
|
|
353
|
+
ARGUMENTS
|
|
354
|
+
PACKAGE The package to add, specified as a GitHub repository in the format owner/repository.
|
|
355
|
+
To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to
|
|
356
|
+
$HEREYA_REGISTRY_URL/owner/repository.
|
|
357
|
+
For local packages, use the format local/path/to/package where path/to/package is the path to the package on
|
|
358
|
+
your local machine.
|
|
359
|
+
|
|
360
|
+
FLAGS
|
|
361
|
+
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
|
|
362
|
+
multiple times.
|
|
363
|
+
--chdir=<value> Directory where the command will be executed.
|
|
364
|
+
If not specified, it defaults to the current working directory.
|
|
365
|
+
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
|
|
366
|
+
environment variable.
|
|
367
|
+
--debug enable debug mode
|
|
368
|
+
--profile=<value> profile to use for the workspace (will be appended to workspace name)
|
|
369
|
+
|
|
370
|
+
DESCRIPTION
|
|
371
|
+
Add a package to the project in a git branch-based workspace
|
|
372
|
+
|
|
373
|
+
EXAMPLES
|
|
374
|
+
$ hereya flow add cloudy/docker_postgres
|
|
375
|
+
|
|
376
|
+
$ hereya flow add cloudy/docker_postgres --profile staging
|
|
377
|
+
|
|
378
|
+
$ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/flow/add/index.ts)_
|
|
341
382
|
|
|
342
383
|
## `hereya flow down`
|
|
343
384
|
|
|
@@ -371,7 +412,71 @@ EXAMPLES
|
|
|
371
412
|
$ hereya flow down --pin
|
|
372
413
|
```
|
|
373
414
|
|
|
374
|
-
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
415
|
+
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/flow/down/index.ts)_
|
|
416
|
+
|
|
417
|
+
## `hereya flow env [NAME]`
|
|
418
|
+
|
|
419
|
+
Print project environment variables for a git branch-based workspace
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
USAGE
|
|
423
|
+
$ hereya flow env [NAME] [--chdir <value>] [-l] [--pin] [--profile <value>]
|
|
424
|
+
|
|
425
|
+
ARGUMENTS
|
|
426
|
+
NAME name of the env to display
|
|
427
|
+
|
|
428
|
+
FLAGS
|
|
429
|
+
-l, --list list only the env vars without values
|
|
430
|
+
--chdir=<value> project root directory
|
|
431
|
+
--pin append git commit SHA to workspace name for commit-specific isolation
|
|
432
|
+
--profile=<value> profile to use for the workspace (will be appended to workspace name)
|
|
433
|
+
|
|
434
|
+
DESCRIPTION
|
|
435
|
+
Print project environment variables for a git branch-based workspace
|
|
436
|
+
|
|
437
|
+
EXAMPLES
|
|
438
|
+
$ hereya flow env
|
|
439
|
+
|
|
440
|
+
$ hereya flow env myEnv
|
|
441
|
+
|
|
442
|
+
$ hereya flow env --profile staging
|
|
443
|
+
|
|
444
|
+
$ hereya flow env --pin
|
|
445
|
+
|
|
446
|
+
$ hereya flow env -l
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/flow/env/index.ts)_
|
|
450
|
+
|
|
451
|
+
## `hereya flow remove PACKAGE`
|
|
452
|
+
|
|
453
|
+
Remove a package from the project in a git branch-based workspace
|
|
454
|
+
|
|
455
|
+
```
|
|
456
|
+
USAGE
|
|
457
|
+
$ hereya flow remove PACKAGE [--chdir <value>] [--debug] [--profile <value>]
|
|
458
|
+
|
|
459
|
+
ARGUMENTS
|
|
460
|
+
PACKAGE Remove a previously added package.
|
|
461
|
+
|
|
462
|
+
FLAGS
|
|
463
|
+
--chdir=<value> Directory where the command will be executed.
|
|
464
|
+
If not specified, it defaults to the current working directory.
|
|
465
|
+
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment
|
|
466
|
+
variable.
|
|
467
|
+
--debug enable debug mode
|
|
468
|
+
--profile=<value> profile to use for the workspace (will be appended to workspace name)
|
|
469
|
+
|
|
470
|
+
DESCRIPTION
|
|
471
|
+
Remove a package from the project in a git branch-based workspace
|
|
472
|
+
|
|
473
|
+
EXAMPLES
|
|
474
|
+
$ hereya flow remove cloudy/docker_postgres
|
|
475
|
+
|
|
476
|
+
$ hereya flow remove cloudy/docker_postgres --profile staging
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/flow/remove/index.ts)_
|
|
375
480
|
|
|
376
481
|
## `hereya flow run CMD`
|
|
377
482
|
|
|
@@ -400,7 +505,7 @@ EXAMPLES
|
|
|
400
505
|
$ hereya flow run --pin -- npm test
|
|
401
506
|
```
|
|
402
507
|
|
|
403
|
-
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
508
|
+
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/flow/run/index.ts)_
|
|
404
509
|
|
|
405
510
|
## `hereya flow up`
|
|
406
511
|
|
|
@@ -434,7 +539,7 @@ EXAMPLES
|
|
|
434
539
|
$ hereya flow up --pin
|
|
435
540
|
```
|
|
436
541
|
|
|
437
|
-
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
542
|
+
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/flow/up/index.ts)_
|
|
438
543
|
|
|
439
544
|
## `hereya help [COMMAND]`
|
|
440
545
|
|
|
@@ -491,7 +596,7 @@ EXAMPLES
|
|
|
491
596
|
$ hereya import org/my-package -f state.tfstate -w my-workspace
|
|
492
597
|
```
|
|
493
598
|
|
|
494
|
-
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
599
|
+
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/import/index.ts)_
|
|
495
600
|
|
|
496
601
|
## `hereya init PROJECT`
|
|
497
602
|
|
|
@@ -517,7 +622,7 @@ EXAMPLES
|
|
|
517
622
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
518
623
|
```
|
|
519
624
|
|
|
520
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
625
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/init/index.ts)_
|
|
521
626
|
|
|
522
627
|
## `hereya login [URL]`
|
|
523
628
|
|
|
@@ -546,7 +651,7 @@ EXAMPLES
|
|
|
546
651
|
$ hereya login --token=your-token https://cloud.hereya.dev
|
|
547
652
|
```
|
|
548
653
|
|
|
549
|
-
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
654
|
+
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/login/index.ts)_
|
|
550
655
|
|
|
551
656
|
## `hereya logout`
|
|
552
657
|
|
|
@@ -563,7 +668,7 @@ EXAMPLES
|
|
|
563
668
|
$ hereya logout
|
|
564
669
|
```
|
|
565
670
|
|
|
566
|
-
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
671
|
+
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/logout/index.ts)_
|
|
567
672
|
|
|
568
673
|
## `hereya remove PACKAGE`
|
|
569
674
|
|
|
@@ -591,7 +696,7 @@ EXAMPLES
|
|
|
591
696
|
$ hereya remove cloudy/docker_postgres
|
|
592
697
|
```
|
|
593
698
|
|
|
594
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
699
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/remove/index.ts)_
|
|
595
700
|
|
|
596
701
|
## `hereya run CMD`
|
|
597
702
|
|
|
@@ -617,7 +722,7 @@ EXAMPLES
|
|
|
617
722
|
$ hereya run -w uat -- node index.js
|
|
618
723
|
```
|
|
619
724
|
|
|
620
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
725
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/run/index.ts)_
|
|
621
726
|
|
|
622
727
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
623
728
|
|
|
@@ -642,7 +747,7 @@ EXAMPLES
|
|
|
642
747
|
$ hereya unbootstrap local
|
|
643
748
|
```
|
|
644
749
|
|
|
645
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
750
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/unbootstrap/index.ts)_
|
|
646
751
|
|
|
647
752
|
## `hereya undeploy`
|
|
648
753
|
|
|
@@ -667,7 +772,7 @@ EXAMPLES
|
|
|
667
772
|
$ hereya undeploy
|
|
668
773
|
```
|
|
669
774
|
|
|
670
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
775
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/undeploy/index.ts)_
|
|
671
776
|
|
|
672
777
|
## `hereya up`
|
|
673
778
|
|
|
@@ -694,7 +799,7 @@ EXAMPLES
|
|
|
694
799
|
$ hereya up
|
|
695
800
|
```
|
|
696
801
|
|
|
697
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
802
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/up/index.ts)_
|
|
698
803
|
|
|
699
804
|
## `hereya workspace create NAME`
|
|
700
805
|
|
|
@@ -718,7 +823,7 @@ EXAMPLES
|
|
|
718
823
|
$ hereya workspace create dev
|
|
719
824
|
```
|
|
720
825
|
|
|
721
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
826
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/create/index.ts)_
|
|
722
827
|
|
|
723
828
|
## `hereya workspace delete NAME`
|
|
724
829
|
|
|
@@ -738,7 +843,7 @@ EXAMPLES
|
|
|
738
843
|
$ hereya workspace delete dev
|
|
739
844
|
```
|
|
740
845
|
|
|
741
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
846
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/delete/index.ts)_
|
|
742
847
|
|
|
743
848
|
## `hereya workspace env [NAME]`
|
|
744
849
|
|
|
@@ -764,7 +869,7 @@ EXAMPLES
|
|
|
764
869
|
$ hereya workspace env myEnv -w dev
|
|
765
870
|
```
|
|
766
871
|
|
|
767
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
872
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/env/index.ts)_
|
|
768
873
|
|
|
769
874
|
## `hereya workspace env set`
|
|
770
875
|
|
|
@@ -788,7 +893,7 @@ EXAMPLES
|
|
|
788
893
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
789
894
|
```
|
|
790
895
|
|
|
791
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
896
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/env/set/index.ts)_
|
|
792
897
|
|
|
793
898
|
## `hereya workspace env unset`
|
|
794
899
|
|
|
@@ -809,7 +914,7 @@ EXAMPLES
|
|
|
809
914
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
810
915
|
```
|
|
811
916
|
|
|
812
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
917
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/env/unset/index.ts)_
|
|
813
918
|
|
|
814
919
|
## `hereya workspace install PACKAGE`
|
|
815
920
|
|
|
@@ -836,7 +941,7 @@ EXAMPLES
|
|
|
836
941
|
$ hereya workspace install hereya/aws-cognito
|
|
837
942
|
```
|
|
838
943
|
|
|
839
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
944
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/install/index.ts)_
|
|
840
945
|
|
|
841
946
|
## `hereya workspace list`
|
|
842
947
|
|
|
@@ -853,7 +958,7 @@ EXAMPLES
|
|
|
853
958
|
$ hereya workspace list
|
|
854
959
|
```
|
|
855
960
|
|
|
856
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
961
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/list/index.ts)_
|
|
857
962
|
|
|
858
963
|
## `hereya workspace set-profile PROFILE`
|
|
859
964
|
|
|
@@ -876,7 +981,7 @@ EXAMPLES
|
|
|
876
981
|
$ hereya workspace set-profile prod-profile -w production
|
|
877
982
|
```
|
|
878
983
|
|
|
879
|
-
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
984
|
+
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/set-profile/index.ts)_
|
|
880
985
|
|
|
881
986
|
## `hereya workspace uninstall PACKAGE`
|
|
882
987
|
|
|
@@ -903,5 +1008,5 @@ EXAMPLES
|
|
|
903
1008
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
904
1009
|
```
|
|
905
1010
|
|
|
906
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1011
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.49.0/src/commands/workspace/uninstall/index.ts)_
|
|
907
1012
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class FlowAdd extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
package: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
parameter: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { getConfigManager } from '../../../lib/config/index.js';
|
|
3
|
+
import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
|
|
4
|
+
import { setDebug } from '../../../lib/log.js';
|
|
5
|
+
import Add from '../../add/index.js';
|
|
6
|
+
import WorkspaceCreate from '../../workspace/create/index.js';
|
|
7
|
+
export default class FlowAdd extends Command {
|
|
8
|
+
static args = {
|
|
9
|
+
package: Args.string({
|
|
10
|
+
description: `
|
|
11
|
+
The package to add, specified as a GitHub repository in the format owner/repository.
|
|
12
|
+
To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to $HEREYA_REGISTRY_URL/owner/repository.
|
|
13
|
+
For local packages, use the format local/path/to/package where path/to/package is the path to the package on your local machine.
|
|
14
|
+
`,
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
static description = 'Add a package to the project in a git branch-based workspace';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> <%= command.id %> cloudy/docker_postgres',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> cloudy/docker_postgres --profile staging',
|
|
22
|
+
'<%= config.bin %> <%= command.id %> cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin',
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
chdir: Flags.string({
|
|
26
|
+
description: `
|
|
27
|
+
Directory where the command will be executed.
|
|
28
|
+
If not specified, it defaults to the current working directory.
|
|
29
|
+
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.
|
|
30
|
+
`,
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
debug: Flags.boolean({
|
|
34
|
+
default: false,
|
|
35
|
+
description: 'enable debug mode',
|
|
36
|
+
}),
|
|
37
|
+
parameter: Flags.string({
|
|
38
|
+
char: 'p',
|
|
39
|
+
default: [],
|
|
40
|
+
description: "parameter for the package, in the form of 'key=value'. Can be specified multiple times.",
|
|
41
|
+
multiple: true,
|
|
42
|
+
}),
|
|
43
|
+
profile: Flags.string({
|
|
44
|
+
description: 'profile to use for the workspace (will be appended to workspace name)',
|
|
45
|
+
required: false,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
async run() {
|
|
49
|
+
const { args, flags } = await this.parse(FlowAdd);
|
|
50
|
+
setDebug(flags.debug);
|
|
51
|
+
const projectRootDir = flags.chdir || process.env.HEREYA_PROJECT_ROOT_DIR;
|
|
52
|
+
// Load project config
|
|
53
|
+
const configManager = getConfigManager();
|
|
54
|
+
const loadConfigOutput = await configManager.loadConfig({ projectRootDir });
|
|
55
|
+
if (!loadConfigOutput.found) {
|
|
56
|
+
this.error("Project not initialized. Run 'hereya init' first.");
|
|
57
|
+
}
|
|
58
|
+
// Build workspace name using flow utility (no pin support)
|
|
59
|
+
const workspaceName = await buildFlowWorkspaceName({
|
|
60
|
+
pin: false,
|
|
61
|
+
profile: flags.profile,
|
|
62
|
+
project: loadConfigOutput.config.project,
|
|
63
|
+
projectRootDir,
|
|
64
|
+
});
|
|
65
|
+
// Create workspace with mirror
|
|
66
|
+
const createArgs = [workspaceName, '--mirror', loadConfigOutput.config.workspace];
|
|
67
|
+
if (projectRootDir) {
|
|
68
|
+
createArgs.push('--chdir', projectRootDir);
|
|
69
|
+
}
|
|
70
|
+
if (flags.debug) {
|
|
71
|
+
createArgs.push('--debug');
|
|
72
|
+
}
|
|
73
|
+
if (flags.profile) {
|
|
74
|
+
createArgs.push('--profile', flags.profile);
|
|
75
|
+
}
|
|
76
|
+
await WorkspaceCreate.run(createArgs);
|
|
77
|
+
// Build args for add command
|
|
78
|
+
const addArgs = [args.package, '--workspace', workspaceName];
|
|
79
|
+
// Pass through all flags
|
|
80
|
+
if (flags.chdir)
|
|
81
|
+
addArgs.push('--chdir', flags.chdir);
|
|
82
|
+
if (flags.debug)
|
|
83
|
+
addArgs.push('--debug');
|
|
84
|
+
// Pass through parameters
|
|
85
|
+
for (const param of flags.parameter) {
|
|
86
|
+
addArgs.push('--parameter', param);
|
|
87
|
+
}
|
|
88
|
+
await Add.run(addArgs);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import { getConfigManager } from '../../../lib/config/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
|
|
4
4
|
import { setDebug } from '../../../lib/log.js';
|
|
5
5
|
import DeleteState from '../../delete-state/index.js';
|
|
6
6
|
import Down from '../../down/index.js';
|
|
@@ -56,22 +56,13 @@ export default class FlowDown extends Command {
|
|
|
56
56
|
if (!loadConfigOutput.found) {
|
|
57
57
|
this.error("Project not initialized. Run 'hereya init' first.");
|
|
58
58
|
}
|
|
59
|
-
//
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
// Get commit SHA if pin flag is set
|
|
67
|
-
const commitSHA = flags.pin ? await gitUtils.getShortCommitSHA(projectRootDir) : null;
|
|
68
|
-
// Build workspace name parts
|
|
69
|
-
const parts = [loadConfigOutput.config.project, sanitizedBranch];
|
|
70
|
-
if (flags.profile)
|
|
71
|
-
parts.push(flags.profile);
|
|
72
|
-
if (commitSHA)
|
|
73
|
-
parts.push(commitSHA);
|
|
74
|
-
const workspaceName = parts.join('---');
|
|
59
|
+
// Build workspace name using flow utility
|
|
60
|
+
const workspaceName = await buildFlowWorkspaceName({
|
|
61
|
+
pin: flags.pin,
|
|
62
|
+
profile: flags.profile,
|
|
63
|
+
project: loadConfigOutput.config.project,
|
|
64
|
+
projectRootDir,
|
|
65
|
+
});
|
|
75
66
|
// Create workspace with mirror
|
|
76
67
|
const createArgs = [workspaceName, '--mirror', loadConfigOutput.config.workspace];
|
|
77
68
|
if (projectRootDir) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class FlowEnv extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
pin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { getConfigManager } from '../../../lib/config/index.js';
|
|
3
|
+
import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
|
|
4
|
+
import Env from '../../env/index.js';
|
|
5
|
+
export default class FlowEnv extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
name: Args.string({ description: 'name of the env to display', required: false }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Print project environment variables for a git branch-based workspace';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %>',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> myEnv',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --profile staging',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --pin',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> -l',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
chdir: Flags.string({
|
|
19
|
+
description: 'project root directory',
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
list: Flags.boolean({
|
|
23
|
+
char: 'l',
|
|
24
|
+
description: 'list only the env vars without values',
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
pin: Flags.boolean({
|
|
28
|
+
description: 'append git commit SHA to workspace name for commit-specific isolation',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
profile: Flags.string({
|
|
32
|
+
description: 'profile to use for the workspace (will be appended to workspace name)',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const { args, flags } = await this.parse(FlowEnv);
|
|
38
|
+
const projectRootDir = flags.chdir || process.env.HEREYA_PROJECT_ROOT_DIR;
|
|
39
|
+
// Load project config
|
|
40
|
+
const configManager = getConfigManager();
|
|
41
|
+
const loadConfigOutput = await configManager.loadConfig({ projectRootDir });
|
|
42
|
+
if (!loadConfigOutput.found) {
|
|
43
|
+
this.error("Project not initialized. Run 'hereya init' first.");
|
|
44
|
+
}
|
|
45
|
+
// Build workspace name using flow utility
|
|
46
|
+
const workspaceName = await buildFlowWorkspaceName({
|
|
47
|
+
pin: flags.pin,
|
|
48
|
+
profile: flags.profile,
|
|
49
|
+
project: loadConfigOutput.config.project,
|
|
50
|
+
projectRootDir,
|
|
51
|
+
});
|
|
52
|
+
// Build args for env command
|
|
53
|
+
const envArgs = ['--workspace', workspaceName];
|
|
54
|
+
// Pass through all flags
|
|
55
|
+
if (flags.chdir)
|
|
56
|
+
envArgs.push('--chdir', flags.chdir);
|
|
57
|
+
if (flags.list)
|
|
58
|
+
envArgs.push('--list');
|
|
59
|
+
// Add the env name argument if provided
|
|
60
|
+
if (args.name)
|
|
61
|
+
envArgs.push(args.name);
|
|
62
|
+
await Env.run(envArgs);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class FlowRemove extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
package: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { getConfigManager } from '../../../lib/config/index.js';
|
|
3
|
+
import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
|
|
4
|
+
import { setDebug } from '../../../lib/log.js';
|
|
5
|
+
import Remove from '../../remove/index.js';
|
|
6
|
+
import WorkspaceCreate from '../../workspace/create/index.js';
|
|
7
|
+
export default class FlowRemove extends Command {
|
|
8
|
+
static args = {
|
|
9
|
+
package: Args.string({
|
|
10
|
+
description: `Remove a previously added package.`,
|
|
11
|
+
required: true,
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
static description = 'Remove a package from the project in a git branch-based workspace';
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> <%= command.id %> cloudy/docker_postgres',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> cloudy/docker_postgres --profile staging',
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
chdir: Flags.string({
|
|
21
|
+
description: `
|
|
22
|
+
Directory where the command will be executed.
|
|
23
|
+
If not specified, it defaults to the current working directory.
|
|
24
|
+
Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.
|
|
25
|
+
`,
|
|
26
|
+
required: false,
|
|
27
|
+
}),
|
|
28
|
+
debug: Flags.boolean({
|
|
29
|
+
default: false,
|
|
30
|
+
description: 'enable debug mode',
|
|
31
|
+
}),
|
|
32
|
+
profile: Flags.string({
|
|
33
|
+
description: 'profile to use for the workspace (will be appended to workspace name)',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
async run() {
|
|
38
|
+
const { args, flags } = await this.parse(FlowRemove);
|
|
39
|
+
setDebug(flags.debug);
|
|
40
|
+
const projectRootDir = flags.chdir || process.env.HEREYA_PROJECT_ROOT_DIR;
|
|
41
|
+
// Load project config
|
|
42
|
+
const configManager = getConfigManager();
|
|
43
|
+
const loadConfigOutput = await configManager.loadConfig({ projectRootDir });
|
|
44
|
+
if (!loadConfigOutput.found) {
|
|
45
|
+
this.error("Project not initialized. Run 'hereya init' first.");
|
|
46
|
+
}
|
|
47
|
+
// Build workspace name using flow utility (no pin support)
|
|
48
|
+
const workspaceName = await buildFlowWorkspaceName({
|
|
49
|
+
pin: false,
|
|
50
|
+
profile: flags.profile,
|
|
51
|
+
project: loadConfigOutput.config.project,
|
|
52
|
+
projectRootDir,
|
|
53
|
+
});
|
|
54
|
+
// Create workspace with mirror
|
|
55
|
+
const createArgs = [workspaceName, '--mirror', loadConfigOutput.config.workspace];
|
|
56
|
+
if (projectRootDir) {
|
|
57
|
+
createArgs.push('--chdir', projectRootDir);
|
|
58
|
+
}
|
|
59
|
+
if (flags.debug) {
|
|
60
|
+
createArgs.push('--debug');
|
|
61
|
+
}
|
|
62
|
+
if (flags.profile) {
|
|
63
|
+
createArgs.push('--profile', flags.profile);
|
|
64
|
+
}
|
|
65
|
+
await WorkspaceCreate.run(createArgs);
|
|
66
|
+
// Build args for remove command
|
|
67
|
+
const removeArgs = [args.package, '--workspace', workspaceName];
|
|
68
|
+
// Pass through all flags
|
|
69
|
+
if (flags.chdir)
|
|
70
|
+
removeArgs.push('--chdir', flags.chdir);
|
|
71
|
+
if (flags.debug)
|
|
72
|
+
removeArgs.push('--debug');
|
|
73
|
+
await Remove.run(removeArgs);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import { getConfigManager } from '../../../lib/config/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
|
|
4
4
|
import Run from '../../run/index.js';
|
|
5
5
|
export default class FlowRun extends Command {
|
|
6
6
|
static args = {
|
|
@@ -36,22 +36,13 @@ export default class FlowRun extends Command {
|
|
|
36
36
|
if (!loadConfigOutput.found) {
|
|
37
37
|
this.error("Project not initialized. Run 'hereya init' first.");
|
|
38
38
|
}
|
|
39
|
-
//
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
// Get commit SHA if pin flag is set
|
|
47
|
-
const commitSHA = flags.pin ? await gitUtils.getShortCommitSHA(projectRootDir) : null;
|
|
48
|
-
// Build workspace name parts
|
|
49
|
-
const parts = [loadConfigOutput.config.project, sanitizedBranch];
|
|
50
|
-
if (flags.profile)
|
|
51
|
-
parts.push(flags.profile);
|
|
52
|
-
if (commitSHA)
|
|
53
|
-
parts.push(commitSHA);
|
|
54
|
-
const workspaceName = parts.join('---');
|
|
39
|
+
// Build workspace name using flow utility
|
|
40
|
+
const workspaceName = await buildFlowWorkspaceName({
|
|
41
|
+
pin: flags.pin,
|
|
42
|
+
profile: flags.profile,
|
|
43
|
+
project: loadConfigOutput.config.project,
|
|
44
|
+
projectRootDir,
|
|
45
|
+
});
|
|
55
46
|
// Build args for run command
|
|
56
47
|
const runArgs = ['--workspace', workspaceName];
|
|
57
48
|
// Pass through chdir flag
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import { getConfigManager } from '../../../lib/config/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { buildFlowWorkspaceName } from '../../../lib/flow-utils.js';
|
|
4
4
|
import { setDebug } from '../../../lib/log.js';
|
|
5
5
|
import Up from '../../up/index.js';
|
|
6
6
|
import WorkspaceCreate from '../../workspace/create/index.js';
|
|
@@ -54,22 +54,13 @@ export default class FlowUp extends Command {
|
|
|
54
54
|
if (!loadConfigOutput.found) {
|
|
55
55
|
this.error("Project not initialized. Run 'hereya init' first.");
|
|
56
56
|
}
|
|
57
|
-
//
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
// Get commit SHA if pin flag is set
|
|
65
|
-
const commitSHA = flags.pin ? await gitUtils.getShortCommitSHA(projectRootDir) : null;
|
|
66
|
-
// Build workspace name parts
|
|
67
|
-
const parts = [loadConfigOutput.config.project, sanitizedBranch];
|
|
68
|
-
if (flags.profile)
|
|
69
|
-
parts.push(flags.profile);
|
|
70
|
-
if (commitSHA)
|
|
71
|
-
parts.push(commitSHA);
|
|
72
|
-
const workspaceName = parts.join('---');
|
|
57
|
+
// Build workspace name using flow utility
|
|
58
|
+
const workspaceName = await buildFlowWorkspaceName({
|
|
59
|
+
pin: flags.pin,
|
|
60
|
+
profile: flags.profile,
|
|
61
|
+
project: loadConfigOutput.config.project,
|
|
62
|
+
projectRootDir,
|
|
63
|
+
});
|
|
73
64
|
// Create workspace with mirror
|
|
74
65
|
const createArgs = [workspaceName, '--mirror', loadConfigOutput.config.workspace];
|
|
75
66
|
if (projectRootDir) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { gitUtils } from './git-utils.js';
|
|
2
|
+
export async function buildFlowWorkspaceName(options) {
|
|
3
|
+
const { pin, profile, project, projectRootDir } = options;
|
|
4
|
+
// Get current git branch
|
|
5
|
+
const gitBranch = await gitUtils.getCurrentGitBranch(projectRootDir);
|
|
6
|
+
// Sanitize branch name
|
|
7
|
+
const sanitizedBranch = gitUtils.sanitizeBranchName(gitBranch);
|
|
8
|
+
if (!sanitizedBranch) {
|
|
9
|
+
throw new Error('Branch name contains only special characters and cannot be used for workspace name');
|
|
10
|
+
}
|
|
11
|
+
// Get commit SHA if pin is enabled
|
|
12
|
+
const commitSHA = pin ? await gitUtils.getShortCommitSHA(projectRootDir) : null;
|
|
13
|
+
// Build workspace name parts
|
|
14
|
+
const parts = [project, sanitizedBranch];
|
|
15
|
+
if (profile) {
|
|
16
|
+
parts.push(profile);
|
|
17
|
+
}
|
|
18
|
+
if (commitSHA) {
|
|
19
|
+
parts.push(commitSHA);
|
|
20
|
+
}
|
|
21
|
+
return parts.join('---');
|
|
22
|
+
}
|
|
@@ -45,20 +45,6 @@ export class ParameterManager {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const pkgName = getPackageCanonicalName(input.package);
|
|
48
|
-
const paramFilesExist = await Promise.all([
|
|
49
|
-
[`${pkgName}.yaml`, `${pkgName}.yml`],
|
|
50
|
-
[`${pkgName}.${input.workspace}.yaml`, `${pkgName}.${input.workspace}.yml`],
|
|
51
|
-
].map(async ([filename, altFilename]) => {
|
|
52
|
-
const filePath = await getAnyPath(path.join(await this.getParametersFolder(input.projectRootDir), filename), path.join(await this.getParametersFolder(input.projectRootDir), altFilename));
|
|
53
|
-
const { found } = await load(filePath);
|
|
54
|
-
return found;
|
|
55
|
-
}));
|
|
56
|
-
if (paramFilesExist.some(Boolean)) {
|
|
57
|
-
return {
|
|
58
|
-
filePath: null,
|
|
59
|
-
saved: false,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
48
|
const filePath = path.join(await this.getParametersFolder(input.projectRootDir), `${pkgName}.yaml`);
|
|
63
49
|
await save(input.parameters, filePath);
|
|
64
50
|
return {
|
package/oclif.manifest.json
CHANGED
|
@@ -939,6 +939,71 @@
|
|
|
939
939
|
"index.js"
|
|
940
940
|
]
|
|
941
941
|
},
|
|
942
|
+
"flow:add": {
|
|
943
|
+
"aliases": [],
|
|
944
|
+
"args": {
|
|
945
|
+
"package": {
|
|
946
|
+
"description": "\n The package to add, specified as a GitHub repository in the format owner/repository.\n To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to $HEREYA_REGISTRY_URL/owner/repository.\n For local packages, use the format local/path/to/package where path/to/package is the path to the package on your local machine.\n ",
|
|
947
|
+
"name": "package",
|
|
948
|
+
"required": true
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"description": "Add a package to the project in a git branch-based workspace",
|
|
952
|
+
"examples": [
|
|
953
|
+
"<%= config.bin %> <%= command.id %> cloudy/docker_postgres",
|
|
954
|
+
"<%= config.bin %> <%= command.id %> cloudy/docker_postgres --profile staging",
|
|
955
|
+
"<%= config.bin %> <%= command.id %> cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin"
|
|
956
|
+
],
|
|
957
|
+
"flags": {
|
|
958
|
+
"chdir": {
|
|
959
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
960
|
+
"name": "chdir",
|
|
961
|
+
"required": false,
|
|
962
|
+
"hasDynamicHelp": false,
|
|
963
|
+
"multiple": false,
|
|
964
|
+
"type": "option"
|
|
965
|
+
},
|
|
966
|
+
"debug": {
|
|
967
|
+
"description": "enable debug mode",
|
|
968
|
+
"name": "debug",
|
|
969
|
+
"allowNo": false,
|
|
970
|
+
"type": "boolean"
|
|
971
|
+
},
|
|
972
|
+
"parameter": {
|
|
973
|
+
"char": "p",
|
|
974
|
+
"description": "parameter for the package, in the form of 'key=value'. Can be specified multiple times.",
|
|
975
|
+
"name": "parameter",
|
|
976
|
+
"default": [],
|
|
977
|
+
"hasDynamicHelp": false,
|
|
978
|
+
"multiple": true,
|
|
979
|
+
"type": "option"
|
|
980
|
+
},
|
|
981
|
+
"profile": {
|
|
982
|
+
"description": "profile to use for the workspace (will be appended to workspace name)",
|
|
983
|
+
"name": "profile",
|
|
984
|
+
"required": false,
|
|
985
|
+
"hasDynamicHelp": false,
|
|
986
|
+
"multiple": false,
|
|
987
|
+
"type": "option"
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
"hasDynamicHelp": false,
|
|
991
|
+
"hiddenAliases": [],
|
|
992
|
+
"id": "flow:add",
|
|
993
|
+
"pluginAlias": "hereya-cli",
|
|
994
|
+
"pluginName": "hereya-cli",
|
|
995
|
+
"pluginType": "core",
|
|
996
|
+
"strict": true,
|
|
997
|
+
"enableJsonFlag": false,
|
|
998
|
+
"isESM": true,
|
|
999
|
+
"relativePath": [
|
|
1000
|
+
"dist",
|
|
1001
|
+
"commands",
|
|
1002
|
+
"flow",
|
|
1003
|
+
"add",
|
|
1004
|
+
"index.js"
|
|
1005
|
+
]
|
|
1006
|
+
},
|
|
942
1007
|
"flow:down": {
|
|
943
1008
|
"aliases": [],
|
|
944
1009
|
"args": {},
|
|
@@ -1013,6 +1078,128 @@
|
|
|
1013
1078
|
"index.js"
|
|
1014
1079
|
]
|
|
1015
1080
|
},
|
|
1081
|
+
"flow:env": {
|
|
1082
|
+
"aliases": [],
|
|
1083
|
+
"args": {
|
|
1084
|
+
"name": {
|
|
1085
|
+
"description": "name of the env to display",
|
|
1086
|
+
"name": "name",
|
|
1087
|
+
"required": false
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
"description": "Print project environment variables for a git branch-based workspace",
|
|
1091
|
+
"examples": [
|
|
1092
|
+
"<%= config.bin %> <%= command.id %>",
|
|
1093
|
+
"<%= config.bin %> <%= command.id %> myEnv",
|
|
1094
|
+
"<%= config.bin %> <%= command.id %> --profile staging",
|
|
1095
|
+
"<%= config.bin %> <%= command.id %> --pin",
|
|
1096
|
+
"<%= config.bin %> <%= command.id %> -l"
|
|
1097
|
+
],
|
|
1098
|
+
"flags": {
|
|
1099
|
+
"chdir": {
|
|
1100
|
+
"description": "project root directory",
|
|
1101
|
+
"name": "chdir",
|
|
1102
|
+
"required": false,
|
|
1103
|
+
"hasDynamicHelp": false,
|
|
1104
|
+
"multiple": false,
|
|
1105
|
+
"type": "option"
|
|
1106
|
+
},
|
|
1107
|
+
"list": {
|
|
1108
|
+
"char": "l",
|
|
1109
|
+
"description": "list only the env vars without values",
|
|
1110
|
+
"name": "list",
|
|
1111
|
+
"required": false,
|
|
1112
|
+
"allowNo": false,
|
|
1113
|
+
"type": "boolean"
|
|
1114
|
+
},
|
|
1115
|
+
"pin": {
|
|
1116
|
+
"description": "append git commit SHA to workspace name for commit-specific isolation",
|
|
1117
|
+
"name": "pin",
|
|
1118
|
+
"required": false,
|
|
1119
|
+
"allowNo": false,
|
|
1120
|
+
"type": "boolean"
|
|
1121
|
+
},
|
|
1122
|
+
"profile": {
|
|
1123
|
+
"description": "profile to use for the workspace (will be appended to workspace name)",
|
|
1124
|
+
"name": "profile",
|
|
1125
|
+
"required": false,
|
|
1126
|
+
"hasDynamicHelp": false,
|
|
1127
|
+
"multiple": false,
|
|
1128
|
+
"type": "option"
|
|
1129
|
+
}
|
|
1130
|
+
},
|
|
1131
|
+
"hasDynamicHelp": false,
|
|
1132
|
+
"hiddenAliases": [],
|
|
1133
|
+
"id": "flow:env",
|
|
1134
|
+
"pluginAlias": "hereya-cli",
|
|
1135
|
+
"pluginName": "hereya-cli",
|
|
1136
|
+
"pluginType": "core",
|
|
1137
|
+
"strict": true,
|
|
1138
|
+
"enableJsonFlag": false,
|
|
1139
|
+
"isESM": true,
|
|
1140
|
+
"relativePath": [
|
|
1141
|
+
"dist",
|
|
1142
|
+
"commands",
|
|
1143
|
+
"flow",
|
|
1144
|
+
"env",
|
|
1145
|
+
"index.js"
|
|
1146
|
+
]
|
|
1147
|
+
},
|
|
1148
|
+
"flow:remove": {
|
|
1149
|
+
"aliases": [],
|
|
1150
|
+
"args": {
|
|
1151
|
+
"package": {
|
|
1152
|
+
"description": "Remove a previously added package.",
|
|
1153
|
+
"name": "package",
|
|
1154
|
+
"required": true
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
"description": "Remove a package from the project in a git branch-based workspace",
|
|
1158
|
+
"examples": [
|
|
1159
|
+
"<%= config.bin %> <%= command.id %> cloudy/docker_postgres",
|
|
1160
|
+
"<%= config.bin %> <%= command.id %> cloudy/docker_postgres --profile staging"
|
|
1161
|
+
],
|
|
1162
|
+
"flags": {
|
|
1163
|
+
"chdir": {
|
|
1164
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
1165
|
+
"name": "chdir",
|
|
1166
|
+
"required": false,
|
|
1167
|
+
"hasDynamicHelp": false,
|
|
1168
|
+
"multiple": false,
|
|
1169
|
+
"type": "option"
|
|
1170
|
+
},
|
|
1171
|
+
"debug": {
|
|
1172
|
+
"description": "enable debug mode",
|
|
1173
|
+
"name": "debug",
|
|
1174
|
+
"allowNo": false,
|
|
1175
|
+
"type": "boolean"
|
|
1176
|
+
},
|
|
1177
|
+
"profile": {
|
|
1178
|
+
"description": "profile to use for the workspace (will be appended to workspace name)",
|
|
1179
|
+
"name": "profile",
|
|
1180
|
+
"required": false,
|
|
1181
|
+
"hasDynamicHelp": false,
|
|
1182
|
+
"multiple": false,
|
|
1183
|
+
"type": "option"
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
"hasDynamicHelp": false,
|
|
1187
|
+
"hiddenAliases": [],
|
|
1188
|
+
"id": "flow:remove",
|
|
1189
|
+
"pluginAlias": "hereya-cli",
|
|
1190
|
+
"pluginName": "hereya-cli",
|
|
1191
|
+
"pluginType": "core",
|
|
1192
|
+
"strict": true,
|
|
1193
|
+
"enableJsonFlag": false,
|
|
1194
|
+
"isESM": true,
|
|
1195
|
+
"relativePath": [
|
|
1196
|
+
"dist",
|
|
1197
|
+
"commands",
|
|
1198
|
+
"flow",
|
|
1199
|
+
"remove",
|
|
1200
|
+
"index.js"
|
|
1201
|
+
]
|
|
1202
|
+
},
|
|
1016
1203
|
"flow:run": {
|
|
1017
1204
|
"aliases": [],
|
|
1018
1205
|
"args": {
|
|
@@ -1583,5 +1770,5 @@
|
|
|
1583
1770
|
]
|
|
1584
1771
|
}
|
|
1585
1772
|
},
|
|
1586
|
-
"version": "0.
|
|
1773
|
+
"version": "0.49.0"
|
|
1587
1774
|
}
|