GitLab CI/CD Pipeline for CloudHub 2.0 Deployment (with Auto Incrementing Version)

This document covers GitLab CI/CD Pipeline Script for deploying Mule App to CloudHub 2.0. If you are experienced in setting up CI/CD Pipeline for CloudHub 1.0 and have tried to re-use the same script for CloudHub 2.0, then you must have found that it doesn't work. The fact is that Mulesoft's CloudHub 2.0 deployments are tightly coupled with Anypoint Exchange, viz., every Mule App that is deployed in Runtime Manager must be linked with a corresponding instance in Anypoint Exchange. One common hurdle that Mule Developers face when setting up CloudHub 2.0 specific pipelines is how Mule App's version can be automatically incremented whenever a pipeline is started. This is again due to CloudHub 2.0 being tightly coupled with Anypoint Exchange. This document also covers logic to handle that in POM file. Let’s begin... Pre-requisites Mule App GitLab Account with available Runners & configured Deployment/Environment Variables Connected App in Anypoint Platform with Correct Perm...