Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antromeo/entando-bundle-cli
https://github.com/antromeo/entando-bundle-cli
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/antromeo/entando-bundle-cli
- Owner: antromeo
- License: gpl-3.0
- Created: 2023-12-30T15:28:11.000Z (10 months ago)
- Default Branch: develop
- Last Pushed: 2024-02-23T15:11:35.000Z (9 months ago)
- Last Synced: 2024-10-11T11:13:44.610Z (28 days ago)
- Language: TypeScript
- Size: 1.46 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# entando-bundle-cli
Entando Bundle CLI, a tool to create and publish Entando bundles.
[![entando](https://img.shields.io/badge/entando-doc-brightgreen.svg)](https://dev.entando.org)
[![Build Status](https://github.com/entando/entando-bundle-cli/actions/workflows/post-merge.yml/badge.svg)](https://github.com/entando/entando-bundle-cli/actions/workflows/post-merge.yml/badge.svg?branch=develop)* [entando-bundle-cli](#entando-bundle-cli)
* [Usage](#usage)
* [Commands](#commands)
* [Environment variables](#environment-variables)
* [Development environment setup](#development-environment-setup)# Usage
```sh-session
$ npm install -g @entando/entando-bundle-cli
$ entando-bundle-cli COMMAND
running command...
$ entando-bundle-cli (--version)
@entando/entando-bundle-cli/1.3.0-SNAPSHOT darwin-x64 node-v14.20.0
$ entando-bundle-cli --help [COMMAND]
USAGE
$ entando-bundle-cli COMMAND
...
```# Commands
* [`entando-bundle-cli api add MFENAME CLAIMNAME`](#entando-bundle-cli-api-add-mfename-claimname)
* [`entando-bundle-cli api add-ext MFENAME CLAIMNAME`](#entando-bundle-cli-api-add-ext-mfename-claimname)
* [`entando-bundle-cli api rm MFENAME CLAIMNAME`](#entando-bundle-cli-api-rm-mfename-claimname)
* [`entando-bundle-cli build [component...] [--all-ms | --all-mfe | --all]`](#entando-bundle-cli-build-component---all-ms----all-mfe----all)
* [`entando-bundle-cli convert`](#entando-bundle-cli-convert)
* [`entando-bundle-cli generate-cr`](#entando-bundle-cli-generate-cr)
* [`entando-bundle-cli help [COMMAND]`](#entando-bundle-cli-help-command)
* [`entando-bundle-cli images`](#entando-bundle-cli-images)
* [`entando-bundle-cli info`](#entando-bundle-cli-info)
* [`entando-bundle-cli init NAME`](#entando-bundle-cli-init-name)
* [`entando-bundle-cli list`](#entando-bundle-cli-list)
* [`entando-bundle-cli mfe add NAME`](#entando-bundle-cli-mfe-add-name)
* [`entando-bundle-cli mfe rm NAME`](#entando-bundle-cli-mfe-rm-name)
* [`entando-bundle-cli ms add NAME`](#entando-bundle-cli-ms-add-name)
* [`entando-bundle-cli ms rm NAME`](#entando-bundle-cli-ms-rm-name)
* [`entando-bundle-cli pack`](#entando-bundle-cli-pack)
* [`entando-bundle-cli publish`](#entando-bundle-cli-publish)
* [`entando-bundle-cli run [component...] [--all-ms | --all-mfe | --all]`](#entando-bundle-cli-run-component---all-ms----all-mfe----all)
* [`entando-bundle-cli svc disable SERVICENAME`](#entando-bundle-cli-svc-disable-servicename)
* [`entando-bundle-cli svc enable SERVICENAME`](#entando-bundle-cli-svc-enable-servicename)
* [`entando-bundle-cli svc list`](#entando-bundle-cli-svc-list)
* [`entando-bundle-cli svc logs [service...] [--all]`](#entando-bundle-cli-svc-logs-service---all)
* [`entando-bundle-cli svc restart [service...] [--all]`](#entando-bundle-cli-svc-restart-service---all)
* [`entando-bundle-cli svc start [service...] [--all]`](#entando-bundle-cli-svc-start-service---all)
* [`entando-bundle-cli svc stop [service...] [--all]`](#entando-bundle-cli-svc-stop-service---all)## `entando-bundle-cli api add MFENAME CLAIMNAME`
Add an internal API claim to the specified MFE component
```
USAGE
$ entando-bundle-cli api add [MFENAME] [CLAIMNAME] --serviceName --serviceUrlARGUMENTS
MFENAME Name of the Micro Frontend component
CLAIMNAME Name of the API claimFLAGS
--serviceName= (required) Microservice name within the Bundle
--serviceUrl= (required) Local microservice URLDESCRIPTION
Add an internal API claim to the specified MFE componentEXAMPLES
$ entando-bundle-cli api add mfe1 ms1-api --serviceName ms1 --serviceUrl http://localhost:8080
```## `entando-bundle-cli api add-ext MFENAME CLAIMNAME`
Add an external API claim to the specified MFE component
```
USAGE
$ entando-bundle-cli api add-ext [MFENAME] [CLAIMNAME] [--serviceName --bundle ]ARGUMENTS
MFENAME Name of the Micro Frontend component
CLAIMNAME Name of the API claimFLAGS
--bundle= Target Bundle Docker repository with the format [docker://]/ or
[docker://]//
--serviceName= Microservice name within the target BundleDESCRIPTION
Add an external API claim to the specified MFE componentEXAMPLES
$ entando-bundle-cli api add-ext mfe1 ms1-api --bundle registry.hub.docker.com/my-org/my-bundle --serviceName ms1
```## `entando-bundle-cli api rm MFENAME CLAIMNAME`
Remove an API claim from the specified MFE component
```
USAGE
$ entando-bundle-cli api rm [MFENAME] [CLAIMNAME]ARGUMENTS
MFENAME Name of the Micro Frontend component
CLAIMNAME Name of the API claimDESCRIPTION
Remove an API claim from the specified MFE componentEXAMPLES
$ entando-bundle-cli api rm my-mfe my-api-claim
```## `entando-bundle-cli build [component...] [--all-ms | --all-mfe | --all]`
Build bundle components
```
USAGE
$ entando-bundle-cli build [component...] [--all-ms | --all-mfe | --all]FLAGS
--all Build all the bundle components
--all-mfe Build all the bundle micro frontends
--all-ms Build all the bundle microservices
--fail-fast Allow to fail the build command as soon as one of the sub-tasks fails
--max-parallel= Maximum number of processes running at the same time. Default value is 3
--stdout Print build output to stdout instead of filesDESCRIPTION
Build bundle componentsEXAMPLES
$ entando-bundle-cli build my-component$ entando-bundle-cli build my-component-1 my-component-2
$ entando-bundle-cli build --all-ms
$ entando-bundle-cli build --all-mfe
$ entando-bundle-cli build --all
```_See code: [dist/commands/build.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/build.ts)_
## `entando-bundle-cli convert`
Perform bundle conversion from v1 to v5
```
USAGE
$ entando-bundle-cli convert [--bundle-path ] [--svc-path ]FLAGS
--bundle-path= the root folder is the one containing the descriptor.yaml file
--svc-path= the services folder is the one containing the Docker Compose filesDESCRIPTION
Perform bundle conversion from v1 to v5
```_See code: [dist/commands/convert.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/convert.ts)_
## `entando-bundle-cli generate-cr`
Generate the Entando Custom Resource (CR) for a bundle project
```
USAGE
$ entando-bundle-cli generate-cr [-i ] [-d] [-f -o ] [-t ]FLAGS
-d, --digest Include Docker images digests
-f, --force Suppress the confirmation prompt in case of file overwrite
-i, --image= Name of the bundle Docker image with the format [docker://]/ or
[docker://]//
-o, --output= Write the result to the specified output file
-t, --tagtypes=... Accepted tag types, comma separated values. Accepted values are dev, prodDESCRIPTION
Generate the Entando Custom Resource (CR) for a bundle projectEXAMPLES
$ entando-bundle-cli generate-cr$ entando-bundle-cli generate-cr --image=my-org/my-bundle
$ entando-bundle-cli generate-cr -i my-registry/my-org/my-bundle
$ entando-bundle-cli generate-cr --image=my-org/my-bundle --digest
$ entando-bundle-cli generate-cr -o my-cr.yml
$ entando-bundle-cli generate-cr -t prod,dev
```_See code: [dist/commands/generate-cr.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/generate-cr.ts)_
## `entando-bundle-cli help [COMMAND]`
Display help for entando-bundle-cli.
```
USAGE
$ entando-bundle-cli help [COMMAND] [-n]ARGUMENTS
COMMAND Command to show help for.FLAGS
-n, --nested-commands Include all nested commands in the output.DESCRIPTION
Display help for entando-bundle-cli.
```_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_
## `entando-bundle-cli images`
List the Docker images and their corresponding tags that are included in the bundle
```
USAGE
$ entando-bundle-cli imagesDESCRIPTION
List the Docker images and their corresponding tags that are included in the bundle
```_See code: [dist/commands/images.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/images.ts)_
## `entando-bundle-cli info`
Show status information for the bundle project
```
USAGE
$ entando-bundle-cli infoDESCRIPTION
Show status information for the bundle projectEXAMPLES
$ entando-bundle-cli info
```_See code: [dist/commands/info.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/info.ts)_
## `entando-bundle-cli init NAME`
Perform the scaffolding of a bundle project
```
USAGE
$ entando-bundle-cli init [NAME] [--version ] [--hub-api-key [--hub-url
--from-hub]]ARGUMENTS
NAME Bundle project nameFLAGS
--from-hub Initializes a bundle project from the Entando Hub
--hub-api-key= Private Entando Hub API key
--hub-url= Custom Entando Hub url
--version= Project versionDESCRIPTION
Perform the scaffolding of a bundle projectEXAMPLES
$ entando-bundle-cli init my-bundle$ entando-bundle-cli init my-bundle --version=0.0.1
$ entando-bundle-cli init my-bundle --from-hub
$ entando-bundle-cli init my-bundle --from-hub --hub-url=https://www.entando.com/entando-hub-api?catalogId=1 --hub-api-key=1234567890
```_See code: [dist/commands/init.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/init.ts)_
## `entando-bundle-cli list`
List the available components in the bundle
```
USAGE
$ entando-bundle-cli list [--ms] [--mfe]FLAGS
--mfe List only Micro Frontend components
--ms List only microservice componentsDESCRIPTION
List the available components in the bundleEXAMPLES
$ entando-bundle-cli list$ entando-bundle-cli list --ms
$ entando-bundle-cli list --ms --mfe
```_See code: [dist/commands/list.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/list.ts)_
## `entando-bundle-cli mfe add NAME`
Add a Micro Frontend component to the bundle
```
USAGE
$ entando-bundle-cli mfe add [NAME] [--stack react|angular|custom] [--type
app-builder|widget|widget-config] [--slot primary-header|primary-menu|content]ARGUMENTS
NAME Name of the Micro Frontend componentFLAGS
--slot= Micro Frontend App Builder slot (only if type=app-builder)
--stack= [default: react] Micro Frontend stack
--type= [default: widget] Micro Frontend type
DESCRIPTION
Add a Micro Frontend component to the bundleEXAMPLES
$ entando-bundle-cli mfe add my-mfe$ entando-bundle-cli mfe add my-mfe --stack react
```## `entando-bundle-cli mfe rm NAME`
Remove a Micro Frontend component to the bundle
```
USAGE
$ entando-bundle-cli mfe rm [NAME]ARGUMENTS
NAME Name of the Micro Frontend componentDESCRIPTION
Remove a Micro Frontend component to the bundleEXAMPLES
$ entando-bundle-cli mfe rm my-mfe
```## `entando-bundle-cli ms add NAME`
Add a microservice component to the bundle
```
USAGE
$ entando-bundle-cli ms add [NAME] [--stack node|spring-boot|custom]ARGUMENTS
NAME Name of the microservice componentFLAGS
--stack= [default: spring-boot] Microservice stack
DESCRIPTION
Add a microservice component to the bundleEXAMPLES
$ entando-bundle-cli ms add my-ms$ entando-bundle-cli ms add my-ms --stack spring-boot
```## `entando-bundle-cli ms rm NAME`
Remove a microservice component from the current bundle
```
USAGE
$ entando-bundle-cli ms rm [NAME]ARGUMENTS
NAME Microservice nameDESCRIPTION
Remove a microservice component from the current bundleEXAMPLES
$ entando-bundle-cli ms rm my-microservice
```## `entando-bundle-cli pack`
Generate the bundle Docker images
```
USAGE
$ entando-bundle-cli pack [-o ] [-r ] [-f ] [--stdout] [--max-parallel ]
[-s] [--fail-fast] [--skip-claims-validation]FLAGS
-f, --file= Bundle Dockerfile (by default it is automatically generated)
-o, --org= Docker organization name
-r, --registry= Docker registry (default is registry.hub.docker.com)
-s, --skip-docker-build Skip the building of Docker images
--fail-fast Allow to fail the pack command as soon as one of the sub-tasks fails
--max-parallel= Maximum number of processes running at the same time. Default value is 3
--skip-claims-validation Skip the validation of Api Claims
--stdout Log build output to standard outputDESCRIPTION
Generate the bundle Docker imagesEXAMPLES
$ entando-bundle-cli pack$ entando-bundle-cli pack --org=my-org
$ entando-bundle-cli pack -f my-Dockerfile
```_See code: [dist/commands/pack.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/pack.ts)_
## `entando-bundle-cli publish`
Publish bundle Docker images
```
USAGE
$ entando-bundle-cli publish [-r ] [-o ]FLAGS
-o, --org= Docker organization name
-r, --registry= Docker registry (default is registry.hub.docker.com)DESCRIPTION
Publish bundle Docker imagesEXAMPLES
$ entando-bundle-cli publish --registry registry.hub.docker.com --org my-docker-organization
```_See code: [dist/commands/publish.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/publish.ts)_
## `entando-bundle-cli run [component...] [--all-ms | --all-mfe | --all]`
Run bundle components
```
USAGE
$ entando-bundle-cli run [component...] [--all-ms | --all-mfe | --all]FLAGS
--all Run all the bundle components
--all-mfe Run all the bundle micro frontends
--all-ms Run all the bundle microservicesDESCRIPTION
Run bundle componentsEXAMPLES
$ entando-bundle-cli run my-component$ entando-bundle-cli run my-component-1 my-component-2
$ entando-bundle-cli run --all-ms
$ entando-bundle-cli run --all-mfe
$ entando-bundle-cli run --all
```_See code: [dist/commands/run.ts](https://github.com/entando/entando-bundle-cli/blob/v1.3.0-SNAPSHOT/dist/commands/run.ts)_
## `entando-bundle-cli svc disable SERVICENAME`
Disable auxiliary services
```
USAGE
$ entando-bundle-cli svc disable [SERVICENAME] [-r]ARGUMENTS
SERVICENAME Name of an available serviceFLAGS
-r, --[no-]remove Remove service configuration and data in svc folderDESCRIPTION
Disable auxiliary servicesEXAMPLES
$ entando-bundle-cli svc disable external-service$ entando-bundle-cli svc disable external-service --remove
$ entando-bundle-cli svc disable external-service --no-remove
```## `entando-bundle-cli svc enable SERVICENAME`
Enable auxiliary services
```
USAGE
$ entando-bundle-cli svc enable [SERVICENAME]ARGUMENTS
SERVICENAME Name of an available serviceDESCRIPTION
Enable auxiliary servicesEXAMPLES
$ entando-bundle-cli svc enable external-service
```## `entando-bundle-cli svc list`
List auxiliary services
```
USAGE
$ entando-bundle-cli svc list [--available]FLAGS
--available List all available servicesDESCRIPTION
List auxiliary servicesEXAMPLES
$ entando-bundle-cli svc list
```## `entando-bundle-cli svc logs [service...] [--all]`
Display running auxiliary services logs
```
USAGE
$ entando-bundle-cli svc logs [service...] [--all]FLAGS
--all Display logs of all enabled services in the bundle descriptorDESCRIPTION
Display running auxiliary services logsEXAMPLES
$ entando-bundle-cli svc logs --all$ entando-bundle-cli svc logs ext-service
$ entando-bundle-cli svc logs ext-service1 ext-service2
```## `entando-bundle-cli svc restart [service...] [--all]`
Restart running auxiliary services
```
USAGE
$ entando-bundle-cli svc restart [service...] [--all]FLAGS
--all Restarts all enabled services in the bundle descriptorDESCRIPTION
Restart running auxiliary servicesEXAMPLES
$ entando-bundle-cli svc restart --all$ entando-bundle-cli svc restart ext-service
$ entando-bundle-cli svc restart ext-service1 ext-service2
```## `entando-bundle-cli svc start [service...] [--all]`
Start enabled auxiliary services
```
USAGE
$ entando-bundle-cli svc start [service...] [--all]FLAGS
--all Starts all enabled services in the bundle descriptorDESCRIPTION
Start enabled auxiliary servicesEXAMPLES
$ entando-bundle-cli svc start --all$ entando-bundle-cli svc start ext-service
$ entando-bundle-cli svc start ext-service1 ext-service2
```## `entando-bundle-cli svc stop [service...] [--all]`
Stop running auxiliary services
```
USAGE
$ entando-bundle-cli svc stop [service...] [--all]FLAGS
--all Stops all enabled services in the bundle descriptorDESCRIPTION
Stop running auxiliary servicesEXAMPLES
$ entando-bundle-cli svc stop --all$ entando-bundle-cli svc stop ext-service
$ entando-bundle-cli svc stop ext-service1 ext-service2
```# Environment variables
- `ENTANDO_BUNDLE_CLI_BIN_NAME`: customizes CLI name that appears in `USAGE` and `EXAMPLES` sections of the help (`entando-bundle-cli` by default)
- `ENTANDO_BUNDLE_CLI_INIT_SUPPRESS_NO_ENTANDO_JSON_WARNING`: Disables the warning about missing entando.json in bundles initialized from Hub (`false` by default)
- `ENTANDO_CLI_BASE_URL`: Entando app base URL
- `ENTANDO_CLI_CRANE_BIN`: path to the crane executable
- `ENTANDO_CLI_DEBUG`: boolean flag (`true`|`false`) used to enable debug logging (`false` by default)
- `ENTANDO_CLI_DEFAULT_DOCKER_REGISTRY`: Default Docker registry (`registry.hub.docker.com` by default)
- `ENTANDO_CLI_DEFAULT_HUB`: default domain of your Entando Hub - default sets to `https://entando.com/entando-hub-api`
- `ENTANDO_CLI_ECR_TOKEN`: ECR/CM API authentication token
- `ENTANDO_CLI_ECR_URL`: URL of ECR/CM API# Development environment setup
It is suggested to install [nvm](https://github.com/nvm-sh/nvm). From the project root folder run:
```sh-session
nvm install
nvm use
```If you are receiving `command not found` errors while executing pre-commit hooks with Husky using `nvm`, please refer to https://typicode.github.io/husky/#/?id=command-not-found
## Debugging
To print debug information define a static `debug` function using the `debugFactory`:
```
private static debug = debugFactory(MyClass)
```Debug output can be enabled using the following environment variable:
```
ENTANDO_CLI_DEBUG=true
```Debug output is sent to stderr, so you can redirect it to a file in the following way:
```
entando-bundle-cli command 2>log.txt
```