# 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

# Export an Entando Bundle

# Set Up the Keycloak Client

Configure a Keycloak client to grant the ent CLI access to the required Entando APIs.

  1. 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
  1. Go to ClientsCreate

  2. Enter a Client ID of your choice, e.g. entando-bundler

  3. Click Save

  4. The Settings tab should be shown. Edit the values as follows:

    • Access Type: confidential
    • Service Accounts Enabled: On
    • Valid Redirect URLs: *
    • Web Origins: *
  5. Click Save

  6. Go to the Service Account Roles tab

  7. Select Client Rolesquickstart

  8. Select Available Rolessuperuser

  9. Click Add Selected to add superuser to the Assigned Roles. This change will be saved automatically.

  10. Go to the Credentials tab and copy the Secret shown there for use in the next section

# Create the env.json Configuration File

  1. Create a directory where you'll run the bundler and switch to that directory:
mkdir testBundle; cd testBundle
  1. Create an env.json file using your environment URLs and client credentials. Refer to the client configuration for the clientId and clientSecret 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

  1. Create a child directory to store the bundler output. Choosing the name bundle allows you to easily use the ent prj command with this bundle.
mkdir bundle
  1. 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.


To convert this project to a docker-based bundle, continue with the steps below.

# Construct the Docker-based Bundle Structure

  1. Initialize a new bundle and switch to that directory:
ent bundle init YOUR-BUNDLE-NAME
  1. Copy the resources from the testBundle/bundle directory to the YOUR-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.

  1. 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