DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Securing and Monitoring Your Data Pipeline: Best Practices for Kafka, AWS RDS, Lambda, and API Gateway Integration
  • Streamlining AWS Lambda Deployments
  • Testcontainers: From Zero To Hero [Video]
  • AppOps with Kubernetes and Devtron - The Perfect Fit

Trending

  • Docker Base Images Demystified: A Practical Guide
  • AI Meets Vector Databases: Redefining Data Retrieval in the Age of Intelligence
  • The Modern Data Stack Is Overrated — Here’s What Works
  • Accelerating AI Inference With TensorRT
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Continuous Integration and Delivery With AWS Code Pipeline

Continuous Integration and Delivery With AWS Code Pipeline

This article is intended to present a concise illustration of how to configure a CI/CD process for Mule Applications using AWS Source Code engines.

By 
Sadik Ali user avatar
Sadik Ali
DZone Core CORE ·
Dec. 04, 20 · Analysis
Likes (4)
Comment
Save
Tweet
Share
11.1K Views

Join the DZone community and get the full member experience.

Join For Free

Agenda: 

  • Introduction    
  • Should-Have    
  • AWS CodeBuild configuration
  • AWS CodePipeline configuration

Introduction 

This article is intended to present a concise illustration of how to configure a CI/CD process for Mule Applications using AWS Source Code engines like AWS CodeCommit, CodeBuild, and CodePipeline.

Should-Have  

  1. MuleSoft Project with maven
  2. Mule enterprise credentials
    • AWS permission to:
      1. Create branches in repositories
      2. Execute git actions in repositories: pull, commit, merge, push.
      3. Configure mandatory roles for CodeBuild and CodePipeline
      4. Configure CodeBuild MuleSoft Project
      5. Configure CodePipeline

AWS CodeBuild Configuration

Create AWS CodeCommit repository for MuleSoft project: 

  • Login with Admin user in AWS console:
    aws console
  • Once successful login, find CodeCommit.
  • Open CodeCommit and create a repository for the required MuleSoft project. For instance, below, one sample project repository is created in CodeCommit.codecommit
  • With repository: Multiple branches created as per requirement..go to the branch in MuleMeetup.branches
  • With Admin user in console, Identity and Access Management (IAM) section and create a user who is authorized to perform a pull, commit, merge, push on MuleMeetup repository.
    • Create a user group:
    • aws groups
    • Create user and assign role and associate with a group created in the above step — these steps to segregate users into a group to assign roles based on roles and responsibilities.             

user groups

  • Generate HTTPS Git credentials for AWS CodeCommit for the IAM user and download it; it will authenticate the user to act on codes in the repository.

HTTPS git credentials

AWS CodePipeline Configuration

  • Now, all configurations are done to start building CodeBuild.
    • Go to CodeBuild with Admin login in the console and look for CodeBuild tool in the console panel.
    •   Create Buildproject process. As we are not using AWS Bucket here and deploying code cloudhub hence bucket configuration is not required in this article. 
      • Follow the below entries while configuring the process as below:

create build project 

source

environment image

buildspec

cloudwatch logs

  • Now login with IAM user as created in the above step and checkout code in Anypoint Studio.
    • Open CodeCommit tool and go to respective repository and branch to clone associate studio code to clone URL.

      mulemeetup
    • set payload
    • Follow files and folders in the project as recommended by CodeBuild as below.

codecommit

  • Buildspec.yml → Code with instructions for the pipeline phases execution. It will cover the different phases in this guide.
Shell
 




x


 
1
version: 0.1
2
env:
3
  variables:
4
    JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"  
5
phases:
6
  pre_build:
7
    commands:
8
      - cp ./mulesoftmeetup/settings.xml /root/.m2/settings.xml      
9
      - cd mulesoftmeetup/
10
      - mvn clean test 
11
  build:
12
    commands:       
13
      - mvn package -DskipTests
14
  post_build:
15
    commands:      
16
      - mvn deploy -DmuleDeploy -DskipTests 
17
artifacts:
18
  files:
19
  - target/*.jar
20
  discard-paths: yes
21
cache:
22
  paths:
23
  - '/root/.m2/**/*'



  • pom.xml → POM configuration file of the Mule app.
XML
 




xxxxxxxxxx
1
34


 
1
<plugin>
2
                <groupId>org.mule.tools.maven</groupId>
3
                <artifactId>mule-maven-plugin</artifactId>
4
                <version>3.3.5</version>
5
                <extensions>true</extensions>
6
                <configuration>
7
                    <cloudHubDeployment>
8
                        <objectStoreV2>true</objectStoreV2>
9
                        <uri>https://anypoint.mulesoft.com</uri>
10
                        <muleVersion>${app.runtime}</muleVersion>
11
                        <username>${username}</username>
12
                        <password>${password}</password>
13
                        <!-- <businessGroup>${businessGroup}</businessGroup> -->
14
                        <workers>1</workers>
15
                        <workerType>Micro</workerType>
16
                        <region>us-west-1</region>
17
                        <environment>Sandbox</environment>
18
                        <applicationName>mulemeetup</applicationName>
19
                        <properties>
20
                            <key>app</key>
21
                        </properties>
22
                    </cloudHubDeployment>
23
                    <executions>
24
                        <execution>
25
                            <id>deploy</id>
26
                            <goals>
27
                                <goal>deploy</goal>
28
                            </goals>
29

          
30
                        </execution>
31
                    </executions>
32
                    <classifier>mule-application</classifier>
33
                </configuration>
34
            </plugin>



Now are all set to build the application and log in with the user who is authorized to execute the build process in CodeBuild.

aws services

Once we execute the Build process, we can monitor the con dashboard or tail-logs to validate the status of execution.

codebuild

With the Tail log, we can see maven dependencies are being downloaded and build/deployment is successful.

build logs

runtime manager

Now we can build process to CI/CD process using AWS CodeCommit/CodeBuild.

AWS Continuous Integration/Deployment Pipeline (software) Delivery (commerce) Integration

Opinions expressed by DZone contributors are their own.

Related

  • Securing and Monitoring Your Data Pipeline: Best Practices for Kafka, AWS RDS, Lambda, and API Gateway Integration
  • Streamlining AWS Lambda Deployments
  • Testcontainers: From Zero To Hero [Video]
  • AppOps with Kubernetes and Devtron - The Perfect Fit

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!