Over a million developers have joined DZone.

Using Continuous Deployment with CloudHub

DZone's Guide to

Using Continuous Deployment with CloudHub

· Integration Zone
Free Resource

Discover how Microservices are a type of software architecture where large applications are made up of small, self-contained units working together through APIs that are not dependent on a specific language. Brought to you in partnership with AppDynamics.

Originally authored by Alberto Pose


After creating a basic Mule App, you might be wondering how to automate the process of deploying a Mule App to CloudHub. In this post, we are introducing a Maven plugin that enables that use case. As a result a Mule App will be deployed automatically to CloudHub after a Maven build. This is achieved using the goal cloudhub-deploy from the Mule AppKit Maven Plugin.

In a ideal development workflow, each time the project builds the Mule Application will be deployed to the cloud providing a cutting edge instance that can be used for QA of the latest snapshot. Both Bamboo or Jenkins can be configured in order to run Maven and deploy the Mule App to CloudHub.

Show me the code

Given an existing Mule App (created using the Mule Application Archetype), we have a Maven pom.xml file. Check that the project has as packaging type mule. Then, add the following to the build > plugins pom.xml section:

            <!-- This can be changed to any Maven phase -->
                <!-- Where the app will be deployed -->
                <!-- Max wait time in millisecs before timeout -->
The property cloudhub.domain must be set in the properties block. This is where the app is going to be deployed:
    <!-- This is the domain where the app will be 
        deployed: i.e. mydomain.cloudhub.io -->
And in the settings.xml file a server must be added together with some valid credentials for CloudHub so that the deploy can take place. This will be the credentials used for the deploy:
Include the plugin repository (where the AppKit Maven Plugin is hosted) in the pom.xml file:

    <name>MuleSoft Release Repository</name>
    <name>MuleSoft Snapshot Repository</name>

After that, run the deploy maven goal:

$ mvn clean deploy
and the app will be deployed to CloudHub.

Wait! I don’t want to deploy my artifacts yet!

As deploy Maven Phase is related also with Artifact Deployment, it can be better to change the plugin deployment phase to verify. On that way, and by doing mvn clean verify, it can achieve the same result without having to upload the resulting Maven artifact to a remote repository.

That’s great but where can I find some usage examples?

Some working examples can be found in Mule Appkit integration tests: here and here.

Happy Hacking!

Discover the six challenges and best practices in managing microservice performance, brought to you in partnership with AppDynamics.


Published at DZone with permission of Ross Mason, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}