How to Implement CI/CD for MuleSoft Projects?

Written by Ali Akthar

Technical Account Manager

Organizations today are doing the rapid development, testing, and launching of new services as per business demands while following the DevOps model using agile practices. On the other hand, businesses rely heavily on APIs from internal systems, third-party fintech communities, or external business partners to run mission-critical operations. For business and IT to manage all this, Continuous Integration (CI) and Continuous Deployment (CD) brings faster deployment results and better code quality.

What is Continuous Integration (CI)?

Continuous integration (CI) is the development practice of automating the integration of code changes from multiple developers into a single shared repository. It is a key DevOps practice, allowing developers to frequently merge code changes into a central repository where builds and tests run, which means each integration is verified by an automated build and automated unit testing.

A source code version control system is the core of the CI process.

What is Continuous Deployment (CD)?

Continuous Deployment (CD) is the software release process that accommodates the changes, bugs fixes, etc., using automated testing and put them into production.

The software release cycle has evolved over time. With Continuous deployment, there is no necessity for a code merge or error tracking. Instead, all the deployment process is automated, allowing organizations to focus on the core business needs instead of technology-related issues.

How CI/CD can be Implemented in Mule Projects?

MuleSoft Anypoint Platform allows organizations to develop, manage and test APIs. The entry point is building automation. As the organizations are building more and more applications, the main concern relies on assembling applications correctly when it requires changes and updates. Harness the Power of the Anypoint Platform with Royal Cyber team of experts.

Applications built on Anypoint Platform (Mule apps) are often composite applications, containing multiple connectors, multiple file systems, artifacts like .jar files, databases, and tests that have specific configurations. In addition, all those connectors, databases, and tests have specific configurations. If you have to alter those configurations every time you make a change to the Mule application, that is going to slow you down. The added advantage of the MuleSoft application is the use of built-in and supported build automation tools like Maven to address these concerns.

Maven

Maven is a project management utility that MuleSoft implements to improve project development. In addition, Mule provides built-in Maven functionality.

Using Maven as your build tool, you can create a build that gets triggered on every project change and automatically runs all its unit and functional tests.

The advantages of CI are:

  • Provides early notification of issues in the software development lifecycle.
  • Ensures code gets fully tested before release.
  • Successfully tested branches ensure better success when merging to the master branch.

Organizations can deploy Mule applications using:

  • The API Manager
  • The Runtime Manager Agent

Organizations can create functional tests with MUnit Unit Testing. The mule-maven-plugin supports deployments to:

  • CloudHub
  • Runtime Fabric
  • On-premises Mule instances
  • Standalone deployment
  • Using Anypoint Runtime Manager REST API
  • Using Runtime Manager agent

In addition to that, organizations can use external CI tools such as Jenkins, Cruise Control, Hudson, TeamCity, Bamboo, Snap, etc.

  • For collaborations, organizations can use slack, Jira, Trello, ServiceNow, etc.
  • For monitoring purposes, organizations can use Nagios, Ganglia, New Relic, etc.
  • For Source Code Management, organizations can use Git, GitHub, Bitbucket, etc.
  • For logging purposes, organizations can use Elastic, Loggly, Splunk, Kibana, etc.

A typical CI/CD pipeline starts with a central repository that keeps the API artifacts. A new change that is introduced needs to be fully tested before promoting to the upper environment. Tying the CI/CD pipeline with a widely used Version Control System like GIT or Bitbucket makes it easy to automate this fully.

Building a Pipeline

In CI/CD, it is essential, to begin with, the proper steps by first creating a new pipeline, and for that, organizations need to have a source code repository. DevOps tool can integrate with any source code repository tool. Once it is done, the DevOps tool requires authorization to create a new pipeline. Once the pipeline is created, source code from the repository will integrate into the build. During the build process, Maven connects to many repositories to download dependencies.

Automation Testing

In CI/CD, automated testing tools are used to run an automated test against each build. Organizations can use homegrown Royal Cyber TEAF for automated testing, or Appium, Cucumber, JUnit, Test Complete, etc.

Build

Once the testing is complete, the build version is delivered to production.

How did this CICD in Mule help our client?

About the client: The client is a Leading Bank in the Middle East that implemented MuleSoft as an integration platform.

Challenge: The client’s business and technology demands were changing rapidly, and they had to integrate with new and older systems, many third-party service providers for data verifications. Therefore, the bank opted for microservices-based architecture to use experienced APIs for re-useability purposes. In addition, to reduce the development and testing timelines, they had to look for a solution that could help them with development, integration, and testing automation.

Solution: The team proposed and implemented a CICD process to automate the integration, testing, and deployment using Jenkins, Mule Maven plugin, and GitHub. The bank started using this as part of the technology operations and has successfully automated its key banking processes.

Conclusion

DevOps brings a rise in CI/CD implementation. At present, CI/CD practices are the most widely accepted choice to shorten software development and delivery cycle time. Read this Case Study to learn how a leading retailer has improved the Sales Cycle using MuleSoft Integration. Royal Cyber has helped numerous organizations implement DevOps successfully and unlocked new capabilities with its API-led approach to connectivity. For more information, you can email us at [email protected].

Leave a Reply