Deploying Mule Apps to CloudHub
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. |
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:
-
In the activity bar of the IDE, click the (Anypoint Code Builder) icon.
-
Open the configuration XML file for the Mule app to deploy.
-
Click the (Deploy to CloudHub) icon.
Alternatively, open the Command Palette and select
MuleSoft: Deploy to CloudHub
. -
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: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.
-
After reviewing the deployment configuration, click Deploy to deploy the application to CloudHub.
-
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:
-
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
. -
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
.
-
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. -
In
deploy.json
, highlight the value to update. -
Press Ctrl+Space.
-
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 |
---|---|---|
|
Provides the Mule runtime version used by the project. |
CloudHub |
|
Sets the worker memory relative to a single worker or a number of available workers. The default is |
CloudHub |
|
Provides the hyphenated, lowercase name of the Mule application. |
CloudHub |
|
Sets the number of Mule runtime instances for running this Mule application. The default is |
CloudHub |
|
Indicates whether to start the application automatically after the deployment process completes. The default value is |
CloudHub |