Automating the Mule Application Build & Deployment Phase – Mule Maven Jenkins Pipeline (CI/CD)

Written by blog_mdtpn6

November 21, 2019

MuleSoft provides Maven plugins that can automate the process of creating a new build that is triggered on every project change on different run-time environments. 

There are various ways to Install Mule Runtime –

  • Standalone Server
  • Cluster
  • CloudHub
  • Server Group

This article will detail a step-by-step guide on how to configure a Jenkins and Mule Maven project for continuous integration and delivery. The article also will attempt to demonstrate two deployment process scenarios, one to a standalone Mule runtime server and another on CloudHub.

Installation Prerequisites

  1. Jenkins 2.190.2
  2. Mule Runtime 3.9.3
  3. Maven 3.6.2
  4. Java 1.8
  5. Git 2.23.0
  6. Bitbucket for code repository
  7. Source tree to commit the code 
  8. Postman

Important Note: In order to connect and fetch resources from the Enterprise Maven Repository, you should contact the mule support center to receive your Enterprise Maven credentials and that will need to be entered into your settings.xml file (usually present within the $USER_HOME/.m2/ directory on your machine). 

Procedure:

1. Configure maven:

  • Download maven and set the environment variable

2. Configure settings.xml:

  • Go to your $USER_HOME/.m2/ directory.
  • Open settings XML adds the following section within the <servers> tag and replace YOUR_ID and YOUR_PASSWORD with the credentials provided to you by MuleSoft Support. 
  • Add the following section within the <profiles> tag to point to the location of the Enterprise Repository, referencing the same name above “Any Name”:

3. Download Git and set the environment variable

4. Install and Configure Jenkins:

  • Download and Install the Jenkins
  • Login into Jenkins
  • Create Jenkins credentials
  • Installed maven, git and pipeline plugin
  • Go to Global Tool configuration and add the maven, JDK and git path
  • Create a Jenkins Item with necessary details:

5. Create Mule-Maven Application

  • Add the below plugin into pom.xml file
  • In the property file, add the anypoint username, password and environment.

CloudHub:

Mule Standalone Server:

6. Commit Code: Make some changes in the code and commit the code into Bitbucket repository through SourceTree. The Jenkins job will start automatically, and the mule application will be deployed/redeployed in the Cloudhub and Standalone Mule runtime.

7. Check the Jenkins Deployment Result

8. Application Testing: Test the application through postman.

Conclusion

The advantages of automated deployment to different environments triggered by changes are immense:

  • Increase the chances of Go-to-market faster
  • Release more often
  • Configure it once
  • Developers can develop
  • Anyone can deploy
  • Chances of error are reduced
  • Immediate feedback

For any feedback or comments please send us an email at hello@inceptasolutions.com

You May Also Like…

Open API Strategy in HealthCare

Open API Strategy in HealthCare

The story of open interfaces began at the start of the 20th century with AT&T opening up their telephone interface...

0 Comments

Submit a Comment

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

Subscribe

Connect With Us

Our Office

Incepta Solutions
7-100, 5045 Orbitor Drive,
Mississauga,
ON, L4W 4Y4

Contact Us

(855) 818-0018
hello@inceptasolutions.com

Office Hours

Mon-Fri: 9am - 5pm
Sat-Sun: Closed