CI/CD Using Maven With Connected Applications in Anypoint Platform for Runtime Fabric
Define the essential arrangements and actions to practice Connected Apps instead of the common User/Password (Anypoint credential) in a CICD pipeline.
Join the DZone community and get the full member experience.Join For Free
The objective of this article is to define the essential arrangements and actions to practice Connected Apps instead of the common User/Password (Anypoint credential) in a CICD pipeline.
Connected Apps help users authorize their access without sharing sensitive credentials or giving full authority of their accounts to third people and Users can also withdraw introduction to them at any time. These Apps will use a Client ID and Secret that will allow them to do some actions, for instance, deploy, publish assets to Exchange, apply/promote policies, etc. But they will not be able to login into the platform.
- Access to BitBucket Server and project repo configured in BitBucket tool.
- Bamboo should have access to MuleSoft Platform APIs.
- Maven version 3.x.x installed and configured in Bamboo (alternative is to use maven wrapper)
- Create Connected APP and copy client_id and secret to be configured maven CICD process which is associated with the Bamboo tool.
To follow the below approach, the user has to design API in the Design center then to publish in exchange. Once it is published in exchange, the developer imports API from Design Center in Anypoint studio to implement business logic and commit code to BitBucket repository.
Once code is committed in the BitBucket repository, the CICD process will execute and operate with the sequence as defined in the below pic...
As API is designed and published in exchange and customized code has been committed in the repository. Now, we need to configure the plan and deployment environment in Bamboo once associated with the BitBucket repository.
Below steps for Bamboo tool to perform steps #4,#5, #6,#7 and #8.
Configure Build Step as Below
Configure Deployment Environment and associate with plan as above...
Initiate Deployment Environment Configuration
Configure steps in Task [SandBox]
Command Configured in Task
Task - Script for login (To get token using connected app credentials.)
Create API Instance
Install and Deploy Application
Once the above steps are done, the configuration is done. Start plan execution to publish the application to exchange which is required for Runtime Fabric application.
Once the plan executed is successful, you will able to see green status of build-in bamboo.
Now, MuleSoft application artifacts will be published to exchange.
Now in the final stage of deployment in the configured environment. Execute the process manually or self trigger.
Once Deploy profile executed with success, we will able see in API manager and Runtime Manager that application is deployed and API status changed to activated state.
API Manager (API Status changed to Active)
Runtime Manager (Application status will be in Running state)
Opinions expressed by DZone contributors are their own.