# Export and Publish a Bundle
# Overview
Use the Entando bundler command to export a bundle of Entando components from an existing Entando application. An Entando bundle can be used to do the initial install of Entando components into an Entando application, migrate Entando components from one environment to another (e.g. Dev to QA), to provide a template for building a new Entando application, or as the skeleton of an Entando solution. The output of this command is the same bundle directory structure created by an Entando project including a bundle descriptor file.
# Prerequisites
- Use the Entando CLI to verify you have the prerequisites in place for this tutorial (e.g. git, entando-bundler).
ent check-env develop
- You'll also need a running Entando application.
- You'll need admin access to Keycloak or admin access to Kubernetes to set it up.
The tutorial assumes you're using an Entando quickstart application. You may need to adjust the specific URLs, credentials, namespaces, etc. for a custom application.
# Export an Entando Bundle
# Setup the Keycloak client
You'll need to setup a Keycloak client with the appropriate permissions for the bundler to access all of the necessary Entando APIs.
- Find the secret for the Keycloak admin account. If you already have the admin credentials, then you can skip to step 3.
kubectl get secrets -n entando
In a quickstart application, the secret is named quickstart-kc-admin-secret
- Determine the admin password using the secret name.
kubectl get secret quickstart-kc-admin-secret -n entando -o go-template="{{println}}Username: {{.data.username | base64decode}}{{println}}Password: {{.data.password | base64decode}}{{println}}{{println}}"
Example output:
Username: entando_keycloak_admin
Password: 1pTZev82Ee
- Login to Keycloak using the admin credentials. The URL will be something like
http://<YOUR-DOMAIN-OR-IP>/auth
. You can use this command to verify the URL.
kubectl describe ingress/quickstart-kc-ingress
- Go to
Clients
→Create
- Enter a
Client ID
of your choice, e.g.entando-bundler
, and clickSave
. - The
Settings
tab should be shown. Edit the following values:
Access Type:
confidentialService Accounts Enabled:
OnValid Redirect URLs:
*Web Origins:
*
- Click
Save
- Go to the
Service Account Roles
tab - Select
Client Roles
→quickstart-server
- Select
Available Roles
→superuser
. - Click
Add Selected
to addsuperuser
to theAssigned Roles
. This change will be saved automatically. - Go to the
Credentials
tab and copy theSecret
shown there. You'll need this in the next section.
# Create env.json
- Create a directory where you'll run the bundler and change to that directory.
mkdir testBundle; cd testBundle
- Create an
env.json
file with the environment URLs and client credentials. TheclientId
andclientSecret
are from steps 5 and 12 above.
{
"coreBaseApi": "http://<YOUR-DOMAIN-OR-IP>/entando-de-app",
"k8ssvcApi": "http://<YOUR-DOMAIN-OR-IP>/k8s",
"clientId": "<YOUR-CLIENT-ID>",
"clientSecret": "<YOUR-CLIENT-SECRET>"
}
# Run the Bundler
- Create a child directory to hold the bundler output. Using the name
bundle
allows you to easily use theent prj
command with this bundle.
mkdir bundle
- Run the bundler command with your preferred settings.
ent bundler from-env --location bundle --code my-test-bundle --description “My Test Bundle”
The bundler will inspect the application using the Entando APIs, collect information about the individual components, construct the appropriate descriptor files, and finally assemble the top-level descriptor file.
$ ls bundle
assets contentModels contents fragments labels pageModels resources
categories contentTypes descriptor.yaml groups languages pages widgets
At this point you have a full Entando project structure. You can inspect the output to edit the exported components or you could deploy it to another Entando application.