DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Testing Serverless Functions
  • Set Up a CI/CD Pipeline for An Angular 7 Application From Azure DevOps to AWS S3 - Part 2
  • Recipe To Implement the Jenkins Pipeline For MuleSoft Application [Videos]
  • Test Automation: Maven Profiles and Parallelization in Azure Pipelines Using IaaS

Trending

  • How AI Agents Are Transforming Enterprise Automation Architecture
  • 5 Subtle Indicators Your Development Environment Is Under Siege
  • Build Your First AI Model in Python: A Beginner's Guide (1 of 3)
  • Java 23 Features: A Deep Dive Into the Newest Enhancements
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Deploying a Mule Application to CloudHub Via AWS, Azure, and Jenkins

Deploying a Mule Application to CloudHub Via AWS, Azure, and Jenkins

Learn how to deploy a Mule application to CloudHub via AWS, Azure, and Jenkins using mule-maven-plugin.

By 
Rishab Aggarwal user avatar
Rishab Aggarwal
·
Rito Chakraborty user avatar
Rito Chakraborty
·
Manish Kumar user avatar
Manish Kumar
·
Updated Jan. 22, 19 · Tutorial
Likes (9)
Comment
Save
Tweet
Share
27.1K Views

Join the DZone community and get the full member experience.

Join For Free

What are we trying to accomplish:

  • Create a release pipeline that automates your software delivery process using AWS CodePipeLine, Azure DevOps and Jenkins.
  • Automate code deployments by connecting your pipeline to Source Repo -> code changes committed to your source code repository and trigger Maven commands on different phases to perform further action with respect to application deployment.
  • Use Mule Maven Plugin to automate deployment on CloudHub by extracting information from POM. AWS CodeBuild, Azure DevOps, and Jenkins will initiate the corresponding Maven command to trigger the deployment on CloudHub after application packing is completed.

For the purpose of this article, we created a simple Mule 4 project and configured mule-maven-plugin 3.1.6 for deploying to CloudHub.

<plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>3.1.6</version>
                <extensions>true</extensions>
                <configuration>
                       <cloudHubDeployment>
                              <uri>https://anypoint.mulesoft.com</uri>
                              <muleVersion>${mule.version}</muleVersion>
                              <username>${cloud.user}</username>
                              <password>${cloud.password}</password>
                              <applicationName>${cloudhubAppName}</applicationName>
                              <environment>${cloud.env}</environment>
                              <businessGroup>${anypoint.businessGroup}</businessGroup>
                              <workerType>${cloudhub.workerType}</workerType>
                             <properties>
                                    <key>value</key>
                             </properties>
                       </cloudHubDeployment>
                </configuration>
            </plugin>

Now we just need to run following maven command to deploy to CloudHub.

mvn package deploy -DmuleDeploy -Dcloud.env=Sandbox -Danypoint.businessGroup=<BusinessGroup> -Dcloudhub.workerType=Small -DcloudhubAppName=ramlapikitmule4 -Dmule.version=4.1.5 -Dcloud.user=<username> -Dcloud.password=<****>

Now we just need to run the above command via AWS, Azure, and Jenkins.

AWS Pipeline

AWS CodePipeline is an Amazon Web Services product that automates the software deployment process, allowing a developer to quickly model, visualize and deliver code for new features and updates. This method is called continuous delivery.

High-Level Architecture:

Image title

Login to your AWS console and choose the region in which code build service has to be used.

Image title

Now you will be prompted for Project Name and Description.

Then you will be asked for the source of the project.

Image title

Then we need to configure environment details on which the project will be built i.e. mvn commands will be executed.

Image title

No service role is required for deploying to CloudHub.

Image title

Build spec file is expected here, this will have pre/post build specifications.

Image title

Sample buildspec.yml required for building and deploying Mule 4 project.

version: 0.2

phases:
  pre_build:
    commands:
      - echo Mule build-deployment phase initiated...
      - mvn test
  build:
    commands:
      - echo Build started on `date`
      - mvn package
  post_build:
    commands:
      - echo Build completed on `date`
      - mvn deploy -DmuleDeploy -Dcloud.env=Sandbox -Danypoint.businessGroup=<BusinessGroup> -Dcloudhub.workerType=Small -DcloudhubAppName=ramlapikitmule4 -Dmule.version=4.1.5 -Dcloud.user=<username> -Dcloud.password=<****>

We didn't configure artifacts and logs for this code build configuration.

After completing the build phase, we ran our pipeline and it was successful.

Image title

You can now log in to CloudHub and your project will be successfully deployed there.

Azure DevOps

Azure DevOps is everything you need to build your software product from beginning to end. Learn how Azure DevOps helps you plan your project with Agile tools, manages your code using Git, and deploys your code through the best CI/CD system on the planet.

The overall architecture for Azure:

Image title

For deploying our project using Azure DevOps, we create a Repo on Azure cloud. Then, you need to go to pipelines and create a new pipeline:

Image title

When you click on create new pipeline, you will be asked to select the source of the project:

Image title

Then you will be asked to select an agent on which you want to build the project. We selected Ubuntu 1604 as we have a maven project.

Image title

You will then need to configure the maven phase and publish the artifact.

mvn compile test (goals have to be added here).

Image title

In publish artifact, we upload the artifact that we need during the deployment stage.

In the triggers tab, you can select the checkbox, "Enable Continuos Integration" to make sure Azure builds your project if the developer pushed the code in Repo.

Click on releases tab beneath build -> New release pipeline.

Now you will be required to add a stage and few deployment tasks inside that stage.

Image title

Now you will have to configure deployment tasks.

Image title

In download artifacts, we download the artifacts that we uploaded after the build.

package mule:deploy (goals have to be added here) in Maven task.

Now when you will run, you should get a success message.

Image title

Jenkins

For deploying to CloudHub via Jenkins, just follow the attached link.

https://github.com/manishkumarsah/BuildAndDeployThroughJenkinsPipeline

Conclusion

In this article, we have demonstrated how easy it is to configure an AWS Pipeline, Azure DevOps using Mule 4 Maven plugin. 

AWS azure Jenkins (software) application Continuous Integration/Deployment Amazon Web Services Pipeline (software) Apache Maven

Opinions expressed by DZone contributors are their own.

Related

  • Testing Serverless Functions
  • Set Up a CI/CD Pipeline for An Angular 7 Application From Azure DevOps to AWS S3 - Part 2
  • Recipe To Implement the Jenkins Pipeline For MuleSoft Application [Videos]
  • Test Automation: Maven Profiles and Parallelization in Azure Pipelines Using IaaS

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!