# Export and Publish a Bundle

# Overview

Use the bundler command to export a bundle of components from an existing Entando Application. An Entando Bundle can be used

  • For the initial install of Entando components into an Entando Application
  • To migrate Entando components from one environment to another (e.g. Dev to QA)
  • To provide a template for building a new Entando Application
  • As the skeleton of an Entando solution

This command generates the same bundle directory structure as an Entando project, including a bundle descriptor file.

# Prerequisites

  • Use the Entando CLI to verify prerequisites (e.g. git, entando-bundler):
ent check-env develop 

This tutorial assumes you're using an Entando quickstart application. You may need to adjust specific URLs, credentials, namespaces, etc., for a custom application.

# Export an Entando Bundle

# Set Up the Keycloak Client

Configure a Keycloak client to grant the bundler 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:
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: *
  1. Click Save
  2. Go to the Service Account Roles tab
  3. Select Client Rolesquickstart
  4. Select Available Rolessuperuser
  5. Click Add Selected to add superuser to the Assigned Roles. This change will be saved automatically.
  6. Go to the Credentials tab and copy the Secret shown there for use in the next section

# Create env.json

  1. Create a directory where you'll run the bundler and go to that directory:
mkdir testBundle; cd testBundle
  1. Create an env.json file with the 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-TEST-BUNDLE --description “Your Test 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! You can inspect the output to edit the exported components or deploy it to another Entando Application.