MuleSoft CI/CD: Deployment Automation Using Jenkins for Mule 4 Applications

By | June 27, 2021

While working with MuleSoft Integration Projects implemented with AnyPoint Studio, deployment automation is always required as a desired DevOps practice for Continuous Integration and Continuous Delivery.

In this Tutorial, you will learn how to achieve Deployment Automation in MuleSoft by using Jenkins as Automation tool, Git as Source Code versioning system and maven as Build tool.

MuleSoft CI/CD: Pre-Requisites for Setting Up Environment for Deployment Automation

In order to be able to do automation deployment for MuleSoft project implemented in AnyPoint Studio, you need to have following as pre-requisites:

  • Java should be installed and added to Path. Also,  JAVA_HOME should be set in environment variable.
  • Maven should be installed and added to Path. You can download maven from the below link:

https://maven.apache.org/download.cgi

  • Git should be installed in your machine in order to use Git Bash or Git GUI for pushing code to Github repository.

Git download link: https://git-scm.com/downloads

Also, make sure that you have an account on Github as you will need to create repository in Github and code will be pushed to that repository.

  • You need to have Jenkins installed in your machine and it should be up & running. You will also need to install required Plugins in Jenkins including Git plugin, Maven Plugin and Pipeline Integration Plugin.

Jenkins can be downloaded from: https://www.jenkins.io/download/

MuleSoft CI/CD Deployment Automation Steps

Once you have met all the pre-requisites, following are the brief steps that you need to follow to achieve Automated deployment to Cloudhub.

  • Create Github Account and Create a Github Repository.
  • Using GitBash in your machine, add Github repository.
  • Create a Project in AnyPoint Studio. Make sure to add cloudhub deployment configurations in your maven configurations in pom.xml file:

<configuration>
<cloudHubDeployment>
<uri>https://anypoint.mulesoft.com</uri>
<muleVersion>4.3.0</muleVersion>
<username>your_anypoint_user</username>
<password>anypoint_password</password>
<applicationName>CICD-Test</applicationName>
<environment>Sandbox</environment>
<workers>1</workers>
<workerType>Micro</workerType>
<objectStoreV2>true</objectStoreV2>
</cloudHubDeployment>
</configuration>

 

 

Make sure that you update the configuration values as per your account and deployment options.

  • Now push your code to Github repository by using git commands for adding, committing and pushing the code respectively.
  • Now login to Jenkins and create pipeline items for Code checkout, code build and code deployments.

You can refer to below video where I have demonstrated this entire CI/CD deployment in step by step which will help you to understand how to achieve deployment automation in MuleSoft with Jenkins Pipelines:

You can refer to another tutorial on this blog where I explained how to deploy  MuleSoft Application to Cloudhub from Runtime Manager.

If you have any questions or any feedback, feel free to comment below and don’t forget to subscribe to the channel to get more content like this in future.

Ajmal Abbasi

Ajmal Hussain Abbasi is Integration Consultant By Profession with 13+ years experience in Integration domain mainly with TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Cloud, TIBCO Flogo, TIBCO Mashery, TIBCO Spotfire, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in various sectors by using his skills in TIBCO Flogo, TIBCO API Management (Mashery), TCI, Tibco Designer, TIBCO Business Studio, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi has experience with MuleSoft ESB as well. Ajmal Abbasi is also experienced in the area of API Management particularly with WSO2 API management platforms. Ajmal Abbasi is also experienced in developing solutions using Core Java and J2EE Technologies. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn - YouTube

One thought on “MuleSoft CI/CD: Deployment Automation Using Jenkins for Mule 4 Applications

  1. Pingback: MuleSoft API Lifecycle Management : API Lifecycle Stages

Leave a Reply

Your email address will not be published. Required fields are marked *