Our November Meetup in London took us through MuleSoft and CICD. Our guest speaker Michael Jakeman (Solutions Architect at Slalom), covered various components of an automated testing & deployment (CI / CD) cycle with MuleSoft, with some unique insights. An insightful presentation on the steps that will help us achieve minimal human involvement in the deployment of release, automated builds, and automated deployments.
8. ABHISHEK
KUMAR A Mulesoft ESB integration developer with
worth 9 yrs experience in designing,
development, integrating applications for
MuleSoft ESB. Worked on the integration and
implementation of applications on cloud, On-
premises and hybrid model for various
domains like domains like Banking/Finance,
Retail, Manufacturing, Energy & Utilities.
10. ABOUT ME
• 5 years working with MuleSoft
• Built multiple CICD pipelines, and multiple
iterations of each
• Focus on enabling the developer
experience
• Building reusable self describing RESTful
APIs in both Mule 3 and Mule 4
• I like houseplants
14. PHASE 1 - BRANCHING STRATEGY
• Git Flow (other strategies are available)
• feature/.* > Development
• develop > SIT
• release/.* > UAT
• master > Production
15. PHASE 1 - MULE MAVEN PLUGIN
• Configured in the pom.xml
• Arguments passed in from maven
commands
• Can deploy to:
• Cloudhub (include the version!)
• Runtime Fabric
• On premise
• Please include the version in your
runtime application name!
16. PHASE 1 - ANYPOINT CLI
• Requires configuration installation on the Jenkins server
• Username and passwords can be managed in Jenkins Credentials
17. PHASE 1 - JENKINSFILE
• Jenkins configuration as code
• No more configuring Jenkins jobs!
• Configuration managed in source code
• Developers can configure how
applications will be deployed
18. PHASE 1 - SHARED LIBRARIES
• Applications can call the same function
• Reduces customization in Jenkinsfiles
• Maintain multiple runnable versions of
your pipeline
• Protects against major changes
19.
20. PHASE 1 - BENEFITS
• Quick to implement
• Reduces human intervention
• Shared libraries reduce duplicate code
• Pipeline is ‘versionable’
21. PHASE 1 - DRAWBACKS
• Applications are build and deployed for each environment
• No concept of ‘rollback’ if the deployment fails
• Assets are only stored on the Jenkins instance
• No configuration of the API, only the deployed Application
22. PHASE 2 • Publish to repository (eg
Nexus, Artifactory)
• Promote functionality
• Run automated tests
23. PHASE 2 - PUBLISH
• Immutable artifacts
• Storage of previous versions
• Managed in the pom.xml
• Parent poms are your friend
24. PHASE 2 - PROMOTE
• Shared Library
• Using Anypoint Platform APIs
• Anypoint System API
• Enhanced promote functionality
25. PHASE 2 - TEST
• Force MUnit tests
• Integrate performance testing
• JUnit
• BlazeMeter
• Integration testing
• Cucumber
• Automated testing allows gives you
repeatable tests that give you confidence
your application can be promoted
26.
27. PHASE 2 - BENEFITS
• Immutable assets stored in a repository
• How do you define your configuration of an API?
• Confidence with each deployment due to testing
• In a position to release to the next environment
28. PHASE 2 - DRAWBACKS
• It takes time to develop promote functionality
• Re-work to change from a branch based release strategy
• Rolling back changes are hard, what do you do if your tests change?
• Have you stored your configuration from the previous build?
30. PHASE 3 - DECOUPLE BUILD & RELEASE
• Remove your Mule Maven Plugin or
Anypoint CLI
• Requires ‘deployer’ functionality
• Automate API Discovery
• Automate policy management
• Deploy can use existing functionality used
to promote
31. PHASE 3 - AUTOMATE RELEASE
• Chain together your environments
• Deploy to an environment
• Test in the environment
• Repeat
• Ensure that Jenkinsfiles use your Shared Libraries methods
• It’s easier to change your code in one place and not in 150 APIs… Trust me!
32. PHASE 3 - CODE QUALITY
• Create rules for your developers
• Make sure they know what the rules are!
• Enforce naming conventions and developer standards
• Report on API standards
33.
34. PHASE 3 - BENEFITS
• Automated release to any environment
• Ability to roll back applications (by redeploying older versions)
35. PHASE 3 - DRAWBACKS
• Rolling back is complicated
• Requires versioned storage of secure properties
• Not truly continuous, would need to revisit branching strategy
• Unsure if a built object will deploy
37. ANYPOINT SYSTEM API
• Mule Maven Plugin and Anypoint CLI only allows username and passwords
managed in Anypoint Platform
• Ability to create a single endpoint that can create an API
• Allows configuration of an API
• Allows release of an Application
• Standards are enforceable
38. RAML GENERATOR
• Best practices around RAML
• Imports shared libraries and common components
39. MAVEN ARCHETYPE
• Create a customizable Mule project fit for your needs
• Import common components readily available
40. API GENERATOR
• Create a repository in source control
• Create the application based on best standards
• Import the RAML published from design center
• Generate application flows
• Generate MUnit flows
• Create Jenkins Job
• Create API in API Manager
• Deploy application into development environment
41. AUTOMATE DOCUMENTATION
• Don’t write any more API documentation.
• Need to know if an API is public or private?
• Business owners, Data owners?
• What developers have worked on the project?
• Customised security and authentication details.