SlideShare a Scribd company logo
1 of 39
Download to read offline
Continuous Integration and delivery
for Java based web applications using
Jenkins-Gradle-Artifactory
Sunil Dalal (@sunieldalal)
Full Stack Developer / Architect
What is Continuous Integration?
Continuous Integration is a software development practice where members of a team integrate their work
frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration
is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams
find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive
software more rapidly."
- Martin Fowler, ThoughtWorks Chief Scientist
What is Continuous Delivery?
Continuous Delivery is the natural extension of Continuous Integration: an approach in which teams
ensure that every change to the system is releasable, and that we can release any version at the push
of a button. Continuous Delivery aims to make releases boring, so we can deliver frequently and get
fast feedback on what users care about.
http://www.thoughtworks.com/continuous-delivery
It’s best thing happened in my developer life! CI and CD gives a great confidence to developer and
makes them more productive. CI/CD is a must for any successful software product.
- My View
Before Continuous Integration / Delivery?
• Manual Deployments.
• Manual Restarts.
• No Automated Test infrastructure. Only manual testing!
• Less confidence! Long turnaround time.
Why Continuous Integration / Delivery?
• Immediate feedback, faster turn around time.
• Enforces discipline of frequent automated testing.
• Better coding practices - Frequent code check-in pushes developers to create modular, less
complex code.
• Every commit can result in a release!
Continuous Integration / Delivery Workflow
CI / CD step by step
• Developers check out code into their local machines.
• Developer commit changes to the source code repository.
• The CI server monitors the source code repository and starts build process.
• The CI server builds the system and runs unit and integration tests.
• The CI server releases deployable artifacts for testing.
• The CI server assigns a build label to the version of the code it just built.
• The CI server informs the team of the successful build.
• If the build or tests fail, the CI server alerts the team.
• The team fix the issue at the earliest opportunity.
• Continue to continually integrate and test throughout the project
• On Approval, CI server deploys to test environments.
• CI Server runs functional / performance tests on Test environment.
• CI Server stage / Deploys to Production Environments (Can set up email based approval).
Reference: https://www.thoughtworks.com/continuous-integration
Tools Used
Tools Options
Source Code Repository Github, Perforce
Continuous Integration Server Jenkins
Binary Repository Manager Artifactory
Code Analysis Sonar Qube
Code Analysis Tools(Java) Checkstyle, PMD, Jacoco, FindBugs,
JDepend
Build Tools (Java) Gradle
Achieving CI / CD using Gradle / Jenkins /
Artifactory
CI/CD Workflow
Jenkins Workflow
Jenkins Workflow
Each Jenkins job executes one of the commands available via Gradle
gradle compile
gradle build
gradle test
Jenkins Build Step
Jenkins Build Step
Executes gradle build via Jenkins job
Jenkins Unit Test Step
Jenkins Build Step
Executes gradle test command via Jenkins job
Jenkins Code Analysis Step
Code Analysis Tools
• Checkstyle
Ideal for projects that want to enforce a coding standard. Discovers poor design, duplicated code and bug
patterns.
• FindBugs
Helps in discovering potential bugs, performance issues and bad coding practices.
• Jdepend
Helps in measuring design quality metrics like maintainability, reusability, extensibility.
• PMD
Finds unused, overly complex and inefficient code.
• JaCoCo
Used for Code Coverage. On the fly byte code instrumentation.
Code Analysis Tools - Checkstyle
Checkstyle is highly configurable and can be made to support almost any coding
standard.
Integrated by adding checstyle Gradle plugin in the project.
Code Analysis Tools - PMD
 PMD is a source code analyzer. It finds common programming flaws like unused
variables, empty catch blocks, unnecessary object creation, and so forth. It
supports Java, JavaScript, XML, XSL.
 Integrated by adding PMD Gradle plugin in the project.
Code Analysis Tools - JDepend
 JDepend traverses Java class file directories and generates design quality metrics
for each Java package. JDepend allows you to automatically measure the quality
of a design in terms of its extensibility, reusability, and maintainability to manage
package dependencies effectively.
 Integrated by adding Jdepend Gradle plugin in the project.
Code Analysis Tools - FindBugs
uses static analysis to look for bugs in Java code.
Integrated by adding FindBugs Gradle plugin in the project.
Code Analysis Tools - JaCoCo
 Used for Code Coverage. On the fly byte code instrumentation.
 In a continuous delivery pipeline, where packaging the deliverable is done after
executing the code analysis phase, we want to make sure that the source or byte
code isn’t modified after the compilation process to avoid unexpected behavior in
target enironment. That’s why, on-the-fly instrumentation should be preferred.
 Integrated by adding JaCoCo Gradle plugin in the project.
SONAR - Architect’s friend in managing code
quality
SonarQube is an open platform to manage code quality. As such, it covers the 7
axes of code quality.
Imports All Code analysis data in SONAR DB for further analysis..
SONAR Dashboard
26
CI – Publish
27
Artifactory Integration
28
Artifactory Dashboard
29
Deploy Artifacts
30
CI – Deploy
31
CI – Deploy
 Can Use scripts or Plugins which can directly deploy to Tomcat or any other
application Servers.
Common Questions
33
Great! what all plugins you guys have used
for Jenkins?
 Git Plugin to checkout source code from repo.
 Gitlab plugin for polling and start builds on each checkin.
 Gradle plugin to install gradle on CI and execute Gradle commands.
 Credentials Plugin to store the credentials securely.
 Build Pipeline plugin.
 Used Clone Workspace Plugin.
 Used Set Build Name Plugin.
 Parametrized Build Plugin.
 GitLab plugin for integration with Gitlab.
34
Great! what all plugins you guys have used
for Gradle?
35
Do we need to copy these gradle plugins to
every project? Code duplication?
 Keep it DRY (Don’t Repeat yourself)
 You can move all gradle plugins to your company wide gradle wrapper
 Individual projects can point to your company wide gradle wrapper to get new
updates.
36
Do you do build on each check in?
 Set up Git Jenkins SSH integration so that we can invoke build on each check in.
Works great for smaller teams.
 For larger teams, CI server polls the SCM and build every 10 minutes!
37
How to manage versioning for project?
 SNAPSHOT-BuildNumber for internal builds.
 RELEASE-x.0 for builds to be released.
 Versioning can be managed via gradle properties file where you can tag version type
as SNAPSHOT or RELEASE
 OR
 Make changes in your CI server to have jobs which can tag builds based on your
defined criteria.
 You can also have jobs which can promote builds from SNAPSHOT to RELEASE.
38
How do you do rollback?
 Rollback should be one click similar to deploy.
 Make your CI server Jobs intelligent to achieve this.
Twitter: @sunieldalal
Blog: http://sunieldalal.github.io/
Github: https://github.com/sunieldalal
LinkedIn: https://www.linkedin.com/in/sunieldalalThank you so much!

More Related Content

What's hot

Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)Hendrik Ebbers
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineSteffen Gebert
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CloudBees
 
Full-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJSFull-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJSVMware Tanzu
 
Server Add-ons for Front-end Developers
Server Add-ons for Front-end DevelopersServer Add-ons for Front-end Developers
Server Add-ons for Front-end DevelopersAtlassian
 
Transform Digital Business with DevOps
Transform Digital Business with DevOpsTransform Digital Business with DevOps
Transform Digital Business with DevOpsDaniel Oh
 
Prod-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized ApplicationsProd-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized ApplicationsVMware Tanzu
 
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...VMware Tanzu
 
Java APIs - the missing manual
Java APIs - the missing manualJava APIs - the missing manual
Java APIs - the missing manualHendrik Ebbers
 
Microservices Testing at Scale
Microservices Testing at ScaleMicroservices Testing at Scale
Microservices Testing at ScaleVMware Tanzu
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersAmazon Web Services
 
Continuous Integration & Drupal
Continuous Integration & DrupalContinuous Integration & Drupal
Continuous Integration & DrupalLimoenGroen
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Previewgraemerocher
 
How to Build a Better JIRA Add-on
How to Build a Better JIRA Add-onHow to Build a Better JIRA Add-on
How to Build a Better JIRA Add-onAtlassian
 
Serverless Delivery
Serverless DeliveryServerless Delivery
Serverless DeliveryCasey Lee
 
Configuration as Code in Bamboo
Configuration as Code in BambooConfiguration as Code in Bamboo
Configuration as Code in BambooAtlassian
 

What's hot (20)

From Continuous Integration to DevOps
From Continuous Integration to DevOpsFrom Continuous Integration to DevOps
From Continuous Integration to DevOps
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Java 11 OMG
Java 11 OMGJava 11 OMG
Java 11 OMG
 
Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)Java APIs- The missing manual (concurrency)
Java APIs- The missing manual (concurrency)
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipeline
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
 
Full-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJSFull-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJS
 
Server Add-ons for Front-end Developers
Server Add-ons for Front-end DevelopersServer Add-ons for Front-end Developers
Server Add-ons for Front-end Developers
 
Transform Digital Business with DevOps
Transform Digital Business with DevOpsTransform Digital Business with DevOps
Transform Digital Business with DevOps
 
Leveling Up Deployment Infrastructure
Leveling Up Deployment InfrastructureLeveling Up Deployment Infrastructure
Leveling Up Deployment Infrastructure
 
Prod-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized ApplicationsProd-Like Integration Testing for Distributed Containerized Applications
Prod-Like Integration Testing for Distributed Containerized Applications
 
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
 
Java APIs - the missing manual
Java APIs - the missing manualJava APIs - the missing manual
Java APIs - the missing manual
 
Microservices Testing at Scale
Microservices Testing at ScaleMicroservices Testing at Scale
Microservices Testing at Scale
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containers
 
Continuous Integration & Drupal
Continuous Integration & DrupalContinuous Integration & Drupal
Continuous Integration & Drupal
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
How to Build a Better JIRA Add-on
How to Build a Better JIRA Add-onHow to Build a Better JIRA Add-on
How to Build a Better JIRA Add-on
 
Serverless Delivery
Serverless DeliveryServerless Delivery
Serverless Delivery
 
Configuration as Code in Bamboo
Configuration as Code in BambooConfiguration as Code in Bamboo
Configuration as Code in Bamboo
 

Viewers also liked

Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java DevelopersNGINX, Inc.
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java DevelopersImesh Gunaratne
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentationmanolitto
 
Automate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City WorkshopAutomate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City WorkshopRed Gate Software
 
Iuandalucia programa2012
Iuandalucia programa2012Iuandalucia programa2012
Iuandalucia programa2012Lidia Milena
 
1:1 In a 5th Grade Classroom
1:1 In a 5th Grade Classroom1:1 In a 5th Grade Classroom
1:1 In a 5th Grade Classroombloomingdale5
 
Caderno literario pragmatha 56 abril 2014
Caderno literario pragmatha 56 abril 2014Caderno literario pragmatha 56 abril 2014
Caderno literario pragmatha 56 abril 2014elvandroburity
 
Sneak Peek to the Healthy Living Market
Sneak Peek to the Healthy Living MarketSneak Peek to the Healthy Living Market
Sneak Peek to the Healthy Living Marketbloomingdale5
 
SD36 Surrey - Inquiry teams Oct.2010
SD36 Surrey - Inquiry teams Oct.2010  SD36 Surrey - Inquiry teams Oct.2010
SD36 Surrey - Inquiry teams Oct.2010 christensen_lea
 
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...Serena Software
 
Joomladay Netherlands 2012 - Joomla in the Cloud
Joomladay Netherlands 2012  - Joomla in the CloudJoomladay Netherlands 2012  - Joomla in the Cloud
Joomladay Netherlands 2012 - Joomla in the CloudJohan Janssens
 
3 assignment of mis
3 assignment of mis3 assignment of mis
3 assignment of missapna-1988
 
Continuous Delivery in Java
Continuous Delivery in JavaContinuous Delivery in Java
Continuous Delivery in JavaXPeppers
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toNicolas Fränkel
 

Viewers also liked (20)

Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
 
Automate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City WorkshopAutomate Database Deployment - SQL In The City Workshop
Automate Database Deployment - SQL In The City Workshop
 
Iuandalucia programa2012
Iuandalucia programa2012Iuandalucia programa2012
Iuandalucia programa2012
 
1to1
1to11to1
1to1
 
Mi vida eres tu
Mi vida eres tuMi vida eres tu
Mi vida eres tu
 
1:1 In a 5th Grade Classroom
1:1 In a 5th Grade Classroom1:1 In a 5th Grade Classroom
1:1 In a 5th Grade Classroom
 
Caderno literario pragmatha 56 abril 2014
Caderno literario pragmatha 56 abril 2014Caderno literario pragmatha 56 abril 2014
Caderno literario pragmatha 56 abril 2014
 
Delo z besedilom
Delo z besedilomDelo z besedilom
Delo z besedilom
 
Jms.back.to.basic
Jms.back.to.basicJms.back.to.basic
Jms.back.to.basic
 
Granada roja 25
Granada roja 25Granada roja 25
Granada roja 25
 
Sneak Peek to the Healthy Living Market
Sneak Peek to the Healthy Living MarketSneak Peek to the Healthy Living Market
Sneak Peek to the Healthy Living Market
 
SD36 Surrey - Inquiry teams Oct.2010
SD36 Surrey - Inquiry teams Oct.2010  SD36 Surrey - Inquiry teams Oct.2010
SD36 Surrey - Inquiry teams Oct.2010
 
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
DevOps Drive-In: Automate Database Deployments in Your Continuous Delivery Pi...
 
Joomladay Netherlands 2012 - Joomla in the Cloud
Joomladay Netherlands 2012  - Joomla in the CloudJoomladay Netherlands 2012  - Joomla in the Cloud
Joomladay Netherlands 2012 - Joomla in the Cloud
 
3 assignment of mis
3 assignment of mis3 assignment of mis
3 assignment of mis
 
Continuous Delivery in Java
Continuous Delivery in JavaContinuous Delivery in Java
Continuous Delivery in Java
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 

Similar to Continuous integration and delivery for java based web applications

Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applicationsSunil Dalal
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueDevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueRapidValue
 
Continuous integration using jenkins
Continuous integration using jenkinsContinuous integration using jenkins
Continuous integration using jenkinsVinay H G
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
Lets talk about CI CD Pipeline in Agile
Lets talk about CI CD Pipeline in Agile Lets talk about CI CD Pipeline in Agile
Lets talk about CI CD Pipeline in Agile Poonam Panday
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopMichael Palotas
 
Agile a to z chapter 4 feedback loop
Agile a to z chapter 4 feedback loopAgile a to z chapter 4 feedback loop
Agile a to z chapter 4 feedback loopWajih Aslam
 
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOps
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOpsAgile A to Z Chapter 4 Feedback Loop Part 2 DevOps
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOpsAgile ME
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0Jasmine Conseil
 
Continuous integration and deployment with jenkins
Continuous integration and deployment with jenkinsContinuous integration and deployment with jenkins
Continuous integration and deployment with jenkinsMd. Shariful Islam ✅
 
Code review automation and functional tests on Carrefour
Code review automation and functional tests on CarrefourCode review automation and functional tests on Carrefour
Code review automation and functional tests on CarrefourDenis Santos
 
SCALABLE CI CD DEVOPS
SCALABLE CI CD DEVOPSSCALABLE CI CD DEVOPS
SCALABLE CI CD DEVOPSG R VISHAL
 
varun JENKINS.pptx
varun JENKINS.pptxvarun JENKINS.pptx
varun JENKINS.pptxVgPolampalli
 
End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020Abhijeet Vaikar
 
Continuous Everything
Continuous EverythingContinuous Everything
Continuous EverythingAndrea Tino
 
Our DevOps Journey: 6 Month Waterfalls to 1 Hour Code Deploys
Our DevOps Journey: 6 Month Waterfalls to 1 Hour Code DeploysOur DevOps Journey: 6 Month Waterfalls to 1 Hour Code Deploys
Our DevOps Journey: 6 Month Waterfalls to 1 Hour Code DeploysDynatrace
 
Continuous Integrations & Deployments
Continuous Integrations & DeploymentsContinuous Integrations & Deployments
Continuous Integrations & DeploymentsShinu Suresh
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0Jasmine Conseil
 

Similar to Continuous integration and delivery for java based web applications (20)

Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applications
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueDevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
 
Continuous integration using jenkins
Continuous integration using jenkinsContinuous integration using jenkins
Continuous integration using jenkins
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Lets talk about CI CD Pipeline in Agile
Lets talk about CI CD Pipeline in Agile Lets talk about CI CD Pipeline in Agile
Lets talk about CI CD Pipeline in Agile
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Agile a to z chapter 4 feedback loop
Agile a to z chapter 4 feedback loopAgile a to z chapter 4 feedback loop
Agile a to z chapter 4 feedback loop
 
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOps
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOpsAgile A to Z Chapter 4 Feedback Loop Part 2 DevOps
Agile A to Z Chapter 4 Feedback Loop Part 2 DevOps
 
DevOps & DevEx
DevOps & DevExDevOps & DevEx
DevOps & DevEx
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0
 
Continuous integration and deployment with jenkins
Continuous integration and deployment with jenkinsContinuous integration and deployment with jenkins
Continuous integration and deployment with jenkins
 
Code review automation and functional tests on Carrefour
Code review automation and functional tests on CarrefourCode review automation and functional tests on Carrefour
Code review automation and functional tests on Carrefour
 
SCALABLE CI CD DEVOPS
SCALABLE CI CD DEVOPSSCALABLE CI CD DEVOPS
SCALABLE CI CD DEVOPS
 
varun JENKINS.pptx
varun JENKINS.pptxvarun JENKINS.pptx
varun JENKINS.pptx
 
Continuous integration
Continuous integration Continuous integration
Continuous integration
 
End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020End-end tests as first class citizens - SeleniumConf 2020
End-end tests as first class citizens - SeleniumConf 2020
 
Continuous Everything
Continuous EverythingContinuous Everything
Continuous Everything
 
Our DevOps Journey: 6 Month Waterfalls to 1 Hour Code Deploys
Our DevOps Journey: 6 Month Waterfalls to 1 Hour Code DeploysOur DevOps Journey: 6 Month Waterfalls to 1 Hour Code Deploys
Our DevOps Journey: 6 Month Waterfalls to 1 Hour Code Deploys
 
Continuous Integrations & Deployments
Continuous Integrations & DeploymentsContinuous Integrations & Deployments
Continuous Integrations & Deployments
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

Continuous integration and delivery for java based web applications

  • 1. Continuous Integration and delivery for Java based web applications using Jenkins-Gradle-Artifactory Sunil Dalal (@sunieldalal) Full Stack Developer / Architect
  • 2. What is Continuous Integration? Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly." - Martin Fowler, ThoughtWorks Chief Scientist
  • 3. What is Continuous Delivery? Continuous Delivery is the natural extension of Continuous Integration: an approach in which teams ensure that every change to the system is releasable, and that we can release any version at the push of a button. Continuous Delivery aims to make releases boring, so we can deliver frequently and get fast feedback on what users care about. http://www.thoughtworks.com/continuous-delivery It’s best thing happened in my developer life! CI and CD gives a great confidence to developer and makes them more productive. CI/CD is a must for any successful software product. - My View
  • 4. Before Continuous Integration / Delivery? • Manual Deployments. • Manual Restarts. • No Automated Test infrastructure. Only manual testing! • Less confidence! Long turnaround time.
  • 5. Why Continuous Integration / Delivery? • Immediate feedback, faster turn around time. • Enforces discipline of frequent automated testing. • Better coding practices - Frequent code check-in pushes developers to create modular, less complex code. • Every commit can result in a release!
  • 6. Continuous Integration / Delivery Workflow
  • 7. CI / CD step by step • Developers check out code into their local machines. • Developer commit changes to the source code repository. • The CI server monitors the source code repository and starts build process. • The CI server builds the system and runs unit and integration tests. • The CI server releases deployable artifacts for testing. • The CI server assigns a build label to the version of the code it just built. • The CI server informs the team of the successful build. • If the build or tests fail, the CI server alerts the team. • The team fix the issue at the earliest opportunity. • Continue to continually integrate and test throughout the project • On Approval, CI server deploys to test environments. • CI Server runs functional / performance tests on Test environment. • CI Server stage / Deploys to Production Environments (Can set up email based approval). Reference: https://www.thoughtworks.com/continuous-integration
  • 8. Tools Used Tools Options Source Code Repository Github, Perforce Continuous Integration Server Jenkins Binary Repository Manager Artifactory Code Analysis Sonar Qube Code Analysis Tools(Java) Checkstyle, PMD, Jacoco, FindBugs, JDepend Build Tools (Java) Gradle
  • 9. Achieving CI / CD using Gradle / Jenkins / Artifactory
  • 12. Jenkins Workflow Each Jenkins job executes one of the commands available via Gradle gradle compile gradle build gradle test
  • 14. Jenkins Build Step Executes gradle build via Jenkins job
  • 16. Jenkins Build Step Executes gradle test command via Jenkins job
  • 18. Code Analysis Tools • Checkstyle Ideal for projects that want to enforce a coding standard. Discovers poor design, duplicated code and bug patterns. • FindBugs Helps in discovering potential bugs, performance issues and bad coding practices. • Jdepend Helps in measuring design quality metrics like maintainability, reusability, extensibility. • PMD Finds unused, overly complex and inefficient code. • JaCoCo Used for Code Coverage. On the fly byte code instrumentation.
  • 19. Code Analysis Tools - Checkstyle Checkstyle is highly configurable and can be made to support almost any coding standard. Integrated by adding checstyle Gradle plugin in the project.
  • 20. Code Analysis Tools - PMD  PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, XML, XSL.  Integrated by adding PMD Gradle plugin in the project.
  • 21. Code Analysis Tools - JDepend  JDepend traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to manage package dependencies effectively.  Integrated by adding Jdepend Gradle plugin in the project.
  • 22. Code Analysis Tools - FindBugs uses static analysis to look for bugs in Java code. Integrated by adding FindBugs Gradle plugin in the project.
  • 23. Code Analysis Tools - JaCoCo  Used for Code Coverage. On the fly byte code instrumentation.  In a continuous delivery pipeline, where packaging the deliverable is done after executing the code analysis phase, we want to make sure that the source or byte code isn’t modified after the compilation process to avoid unexpected behavior in target enironment. That’s why, on-the-fly instrumentation should be preferred.  Integrated by adding JaCoCo Gradle plugin in the project.
  • 24. SONAR - Architect’s friend in managing code quality SonarQube is an open platform to manage code quality. As such, it covers the 7 axes of code quality. Imports All Code analysis data in SONAR DB for further analysis..
  • 31. 31 CI – Deploy  Can Use scripts or Plugins which can directly deploy to Tomcat or any other application Servers.
  • 33. 33 Great! what all plugins you guys have used for Jenkins?  Git Plugin to checkout source code from repo.  Gitlab plugin for polling and start builds on each checkin.  Gradle plugin to install gradle on CI and execute Gradle commands.  Credentials Plugin to store the credentials securely.  Build Pipeline plugin.  Used Clone Workspace Plugin.  Used Set Build Name Plugin.  Parametrized Build Plugin.  GitLab plugin for integration with Gitlab.
  • 34. 34 Great! what all plugins you guys have used for Gradle?
  • 35. 35 Do we need to copy these gradle plugins to every project? Code duplication?  Keep it DRY (Don’t Repeat yourself)  You can move all gradle plugins to your company wide gradle wrapper  Individual projects can point to your company wide gradle wrapper to get new updates.
  • 36. 36 Do you do build on each check in?  Set up Git Jenkins SSH integration so that we can invoke build on each check in. Works great for smaller teams.  For larger teams, CI server polls the SCM and build every 10 minutes!
  • 37. 37 How to manage versioning for project?  SNAPSHOT-BuildNumber for internal builds.  RELEASE-x.0 for builds to be released.  Versioning can be managed via gradle properties file where you can tag version type as SNAPSHOT or RELEASE  OR  Make changes in your CI server to have jobs which can tag builds based on your defined criteria.  You can also have jobs which can promote builds from SNAPSHOT to RELEASE.
  • 38. 38 How do you do rollback?  Rollback should be one click similar to deploy.  Make your CI server Jobs intelligent to achieve this.
  • 39. Twitter: @sunieldalal Blog: http://sunieldalal.github.io/ Github: https://github.com/sunieldalal LinkedIn: https://www.linkedin.com/in/sunieldalalThank you so much!