# Export and Publish a Bundle
The ent bundler command exports a bundle from an existing Entando Application to:
- Perform the initial install of components into an Entando Application
- Migrate bundles from one environment to another (e.g. Dev to QA)
- Provide a template for building a new application
This tutorial describes how to export a git-based Entando Bundle using the ent CLI. This package can be deployed to Entando or changed to a docker-based bundle to take advantage of Entando's latest composable methods. The procedure assumes you're using an Entando quickstart application. Otherwise, you may need to adjust specific URLs, credentials, namespaces, etc., for a custom application.
# Prerequisites
Verify dependencies with the Entando CLI:
ent check-env develop
# Export an Entando Bundle
# Set Up the Keycloak Client
Configure a Keycloak client to grant the ent CLI access to the required Entando APIs.
- Log in to Keycloak using the admin credentials. The URL will be similar to
http://YOUR-HOST-NAME/auth/
and can be verified with the following command:
ent kubectl describe ingress/default-sso-in-namespace-ingress -n entando
Go to
Clients
→Create
Enter a
Client ID
of your choice, e.g.entando-bundler
Click
Save
The
Settings
tab should be shown. Edit the values as follows:Access Type
: confidentialService Accounts Enabled
: OnValid Redirect URLs
: *Web Origins
: *
Click
Save
Go to the
Service Account Roles
tabSelect
Client Roles
→quickstart
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 for use in the next section
# Create the env.json
Configuration File
- Create a directory where you'll run the bundler and switch to that directory:
mkdir testBundle; cd testBundle
- Create an
env.json
file using your environment URLs and client credentials. Refer to the client configuration for theclientId
andclientSecret
values.
{
"coreBaseApi": "http://YOUR-HOST-NAME/entando-de-app",
"componentManagerApi": "http://YOUR-HOST-NAME/digital-exchange",
"clientId": "YOUR-CLIENT-ID",
"clientSecret": "YOUR-CLIENT-SECRET"
}
# Run the Bundler
- Create a child directory to store the bundler output. Choosing the name
bundle
allows you to easily use theent prj
command with this bundle.
mkdir bundle
- Run the bundler:
ent bundler from-env --location bundle --code YOUR-BUNDLE-NAME --description “Your Exported Bundle”
The bundler will inspect the application using Entando APIs, collect information about individual components, construct appropriate descriptor files, and assemble the top-level descriptor file.
$ ls bundle
assets contentModels contents fragments labels pageModels resources
categories contentTypes descriptor.yaml groups languages pages widgets
You now have a complete Entando project structure for a git-based bundle! You can inspect the output to edit the exported components or deploy it to another Entando Application.
Note:
To convert this project to a docker-based bundle, continue with the steps below.
# Construct the Docker-based Bundle Structure
- Initialize a new bundle and switch to that directory:
ent bundle init YOUR-BUNDLE-NAME
cd YOUR-BUNDLE-NAME
- Copy the resources from the
testBundle/bundle
directory to theYOUR-BUNDLE-NAME/platform
directory, with the exception of microservices (/plugins) and micro frontends (/widgets).
For micro frontends and microservices, migrate the source code manually to the corresponding folders inside your bundle directory. Note that non-MFE widgets are considered platform entities on Entando and should be placed in the platform/widgets
directory.
Use the ent bundle CLI tool to assist in the process of adding micro frontends and microservices. To define their specific attributes in the bundle descriptor, entando.json
, also check out the Entando Bundle details page.
- With the project structure in place, build and install your bundle.
ent bundle pack
ent bundle publish
ent bundle deploy
ent bundle install
Next Steps
- Manage APIs for your bundle.
- Learn about Selecting Default Databases.