Contact Us 1-800-596-4880

Deploying Mule Apps to CloudHub

logo cloud IDE Cloud IDE

logo desktop IDE Desktop IDE

Open Beta Release: The cloud IDE and AsyncAPI implementation support are in open beta. Any use of Anypoint Code Builder in its beta state is subject to the applicable beta services terms and conditions, available from the IDE.

You can use Anypoint Code Builder to deploy your Mule application to CloudHub.

Anypoint Code Builder can deploy applications only to the 1.0 version of CloudHub. To deploy to CloudHub 2.0, create a deployable JAR file, and follow a deployment procedure identified in Export to a Deployable JAR File.

Before You Begin

Deploy an App to CloudHub

When you deploy an application to CloudHub, Anypoint Code Builder configures a default deploy.json file in your src/main/resources directory. If you intend to configure properties at deployment time, for example, to create secure properties, Anypoint Code Builder prompts you to modify deploy.json during deployment the deployment process.

To deploy your app to CloudHub:

  1. In the activity bar of the IDE, click the (Anypoint Code Builder) icon.

  2. Open the configuration XML file for the Mule app to deploy.

  3. Click the (Deploy to CloudHub) icon.

    Alternatively, open the Command Palette and select MuleSoft: Deploy to CloudHub.

  4. If prompted, click Allow to allow sign in using Anypoint Platform and select the business group.

    If the project doesn’t already have a deploy.json file, Anypoint Code Builder prompts that a deployment configuration file has been created and opens it for you to review, for example:

    Review deploy.json file

    The applicationName property defines part of the URL that you use to access your application on CloudHub.

    This name must be unique across all applications deployed to CloudHub.

  5. After reviewing the deployment configuration, click Deploy to deploy the application to CloudHub.

  6. At the prompt, select the environment to deploy to.

    Anypoint Code Builder packages the application and deploys it to CloudHub. The Output panel opens with Mule Maven Output selected:

    Output panel with Mule Maven Output selected
  7. After deployment completes, click Open in Runtime Manager.

    Your app opens in Runtime Manager in Anypoint Platform.

    The domain name of the application varies, but it follows a similar structure such as: app-with-40-schedulers.us-w1.cloudhub.io.

  8. Open your preferred REST client and make a GET request to the domain name as displayed in Runtime Manager, for example, http://app-with-100-schedulers.us-w1.cloudhub.io/api/flights.

Change a Value in deploy.json

Use auto-complete to select a preconfigured value in deploy.json.

Using auto-complete to select a value for deploy.json

  1. Open deploy.json from the Explorer.

    The file is located in the project’s src/main/resources directory. The file opens to a deploy.json tab in the IDE.

  2. In deploy.json, highlight the value to update.

  3. Press Ctrl+Space.

  4. Select a different value.

Deployment Properties

The deploy.json file contains the following properties for deployments of Mule applications to CloudHub from Anypoint Code Builder.

Property Description Host

runtime

Provides the Mule runtime version used by the project.

CloudHub

workersize

Sets the worker memory relative to a single worker or a number of available workers. The default is 0.1. For more information, see CloudHub Workers in the CloudHub documentation.

CloudHub

applicationName

Provides the hyphenated, lowercase name of the Mule application.

CloudHub

workers

Sets the number of Mule runtime instances for running this Mule application. The default is 1. For more information, see CloudHub Workers in the CloudHub documentation.

CloudHub

autoStart

Indicates whether to start the application automatically after the deployment process completes. The default value is true.

CloudHub