This blog series introduces you to Entando’s Command Line Interface (ENT) which simplifies building and deploying applications for Kubernetes.
$ ent bundler -h
Usage: entando-bundle [options] [command]
A tool to interact with Entando's Digital-Exchange bundles
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
from-npm [options] Generates an Entando's Content Digital-Exchange bundle k8s custom
resource
from-git [options] Generates an Entando's Content Digital-Exchange bundle k8s custom
resource using repository
from-env [options] Generates an Entando Bundle from an existing environment into the
current or selected location
Entando Bundler has 3 primary commands:
$ ent bundler from-env -h
Usage: entando-bundle from-env [options]
Generates an Entando Bundle from an existing environment into the current or selected location
Options:
--env The location for the env.json file containing the description of the
environment to export (default: "env.json")
--location The location for where to store the generated Bundle (default: "./")
--code The code (unique identifier) for the Bundle
--description The description of the Bundle
-h, --help output usage information
{
# Access to Entando APIs
"coreBaseApi": "http:///entando-de-app",
# Access to Entando Cluster Infrastructure APIs
"k8ssvcApi": "http:///k8s",
# Keycloak Client ID to access Entando APIs
"clientId": "",
# Keycloak Secret
"clientSecret": ""
}
ent kubectl get ingress -n entando -o jsonpath='{.items[2].spec.rules[*].host}{.items[2].spec.rules[*].http.paths[0].path}{"\n"}'
Sample Output: quickstart-entando.192.168.64.40.nip.io/entando-de-app
Note: The jsonpath is a convenience command to get the URL directly, but you can also look up the URLs using standard kubectl commands.
ent kubectl get ingress -n entando -o yaml
ent kubectl get ingress -n entando -o jsonpath='{.items[1].spec.rules[*].host}{.items[1].spec.rules[*].http.paths[*].path}{"\n"}'
Sample Output: quickstart-eci-entando.192.168.64.40.nip.io/k8s
{
"coreBaseApi": "http://quickstart-entando.192.168.64.40.nip.io/entando-de-app",
"k8ssvcApi": "http://quickstart-eci-entando.192.168.64.40.nip.io/k8s",
"clientId": "entando-bundler",
"clientSecret": "da95278e-40db-4be4-9aaf-88eaf2b6070b"
}
$ ent bundler
? What do you want to do? (Use arrow keys)
Generate a custom-resource based on an existing bundle project
❯ Create a new bundle using components from an environment
In our case, let’s export the components from an existing environment.
? Please select an env.json file with the environment variables: (env.json)
Press enter to select the default location to read your env.json from the current working directory.
? Which type of components do you want to add to the bundle? (Use arrow keys)
❯ All components
Pages
Page templates
UX Fragments
Microfrontends / Widgets
Microservices
Content Types
Contents
CMS Assets
Groups
Categories
Labels
Select “All components” to export the entire application.
Collecting all components from the provided environment...
Collecting widgets
Collecting pageModels
Collecting fragments
Collecting pages
Collecting groups
Collecting contentTypes
Collecting contentModels
Collecting assets
Collecting contents
Collecting plugins
Collecting categories
Collecting labels
Collecting languages
? Do you want to generate the Bundle with the selected components? (Y/n) y
? Where do you want to generate the Bundle? (./)
Press enter to generate the bundle and its components in the current working directory.
? What's the code for the Bundle?
Enter a unique identifier for the bundle (e.g., “export-bundle”).
? Please add a description to the Bundle:
Enter a description for the bundle (e.g., “Sample Export Bundle”).
Generating bundle...
Collecting File:
...
Processing widget: hello-widget
...
Processing pageModel: 1-2-column
...
Processing fragment: breadcrumb
...
Processing page: homepage
...
Processing contentType: bnr
...
Processing content: bnr2
...
Processing contentModel: 2-column-content
...
Processing labels
Processing languages
Saving bundle descriptor at ./descriptor.yaml
$ ent bundler from-env \
--env env.json \
--code export-bundle \
--description "Sample Export Bundle"
ent bundler from-git --name=example-bundle --namespace=entando --repository=https://your/remote/repository.git --dry-run > example-bundle.yaml
The output of the command is a Kubernetes Custom Resource yaml.
Developers should use the “ent prj” commands to simplify their development lifecycle, but we’ll also cover how Entando uses Kubernetes Custom Resources to deploy updates to your application.