advertisement

Continuous integration using Jenkins and Sonar

60 %
40 %
advertisement
Information about Continuous integration using Jenkins and Sonar
Technology

Published on March 7, 2014

Author: pazscall

Source: slideshare.net

Description

Continuous Integration can help your to team release features faster. It reduces the risk of deployment issue and will speed up your development cycle. In this presentation we take a look at how Jenkins and Sonar can help you Test, Analyze, Deploy and gather performance metrics that will help your team increase their development quality and reduce deployment time
advertisement

CONTINUOUS INTEGRATION TEST AND DEPLOYMENT AUTOMATION

FOCUS • WHY CONTINUOUS INTEGRATION • HOW TO INTEGRATE CONTINUOUS INTEGRATION IN YOUR WORKFLOW • GET TO KNOW JENKINS AND SONAR • DEPLOYMENT PIPELINE - DEMO

WHY CONTINUOUS INTEGRATION

THE PROBLEM OF DELIVERING SOFTWARE IF SOMEBODY THINKS OF A GOOD IDEA, HOW DO WE DELIVER IT TO USERS AS QUICKLY AS POSSIBLE WITHOUT BREAKING EVERYTHING?

BEHAVIOUR OF SOFTWARE PROJECT • FOR LONG PERIODS OF TIME DURING DEVELOPMENT, THE APPLICATION IS NOT IN A WORKING STATE • NOBODY IS INTERESTED IN RUNNING THE WHOLE APPLICATION UNTIL IT’S FINISHED • NOBODY TRIES TO RUN THE APPLICATION IN A PRODUCTION-LIKE ENVIRONMENT • DOUBLY TRUE OF LONG LIVED BRANCHES OR UAT TESTING THAT’S DEFERRED TO THE END

RELEASE ANTI-PATTERNS - MANUAL DEPLOY SIGNS: EFFECTS: • DETAILED DEPLOYMENT PROCEDURE • ERRORS WILL OCCUR EVERY TIME THEY ARE PERFORMED. THE ONLY QUESTION IS WHETHER OR NOT THE ERRORS ARE SIGNIFICANT • MANUAL REGRESSION TESTING • RELEASE THAT TAKE MORE THAN A FEW MINUTES • UNPREDICTABLE RELEASE - HAS TO BE ROLLED BACK • DEPLOYMENT WINDOWS ! ! ! • NOT REPEATABLE OR RELIABLE • MANUAL DEPLOYMENTS DEPENDS ON DEPLOYMENT EXPERTS • BORING AND REPETITIVE • EXPENSIVE MANUAL TESTING • NOT AUDITABLE

CAN WE DO BETTER? SOFTWARE RELEASES CAN AND SHOULD BE: • LOW-RISK • FREQUENT • CHEAP • RAPID • PREDICTABLE

HOW? • AUTOMATED - IF THE BUILD, DEPLOY, TEST AND RELEASE IS NOT AUTOMATED, IT IS NOT REPEATABLE. IT WILL BE DIFFERENT EVERY TIME. RELEASING SHOULD BE AN ENGINEERING DISCIPLINE • FREQUENT - IF THE RELEASE IS FREQUENT, THE DELTA BETWEEN RELEASE WILL BE SMALL. • EASIER TO ROLL BACK • FASTER FEEDBACK

BENEFITS • REPEATABLE, RELIABLE, PREDICTABLE RELEASE PROCESS • ERROR REDUCTION - NO HUMAN BEING OR TEAM OF HUMAN BEING CAN SPOT A BREAKING CHANGE IN MILLIONS OF LINES OF CODE - LET THE COMPUTER DO THAT • LOWERING STRESS - PEACE OF MIND THAT THE FEATURES WORK • FLEXIBLE DEPLOYMENT SCHEDULES - DEPLOY AT THE PUSH OF A BUTTON —YES EVEN ON FRIDAY @ 1:30PM

“ THE FIRST TIME YOU DO AUTOMATION, IT WILL BE PAINFUL — BUT IT WILL BECOME EASIER AND THE BENEFITS WILL BE INCALCULABLE ”

HOW TO INTEGRATE CI INTO YOUR WORKFLOW

“ IN SOFTWARE, WHEN SOMETHING IS PAINFUL, THE WAY TO REDUCE THE PAIN IS TO DO IT MORE FREQUENTLY, NOT LESS ”

PRINCIPLES OF SOFTWARE DELIVERY SOFTWARE CAN BE BROKEN DOWN INTO 4 COMPONENTS: • HOST ENVIRONMENT • CONFIGURATION • CODE • DATA KEEP EVERYTHING IN VERSION CONTROL!!!

HOST ENVIRONMENT • CAN I REPRODUCE ANY OF MY ENVIRONMENTS (OS, SOFTWARE INSTALLED, CONFIGURATION) • CAN I MAKE AN INCREMENTAL CHANGE TO THESE ENVIRONMENTS • CAN I TRACE BACK THIS CHANGE, WHO MADE IT AND WHEN THEY MADE IT • IS IT EASY FOR EVERY MEMBER TO APPLY THESE CHANGES

CONFIGURATION TREAT YOUR CONFIGURATION LIKE CODE • BASED ON APPLICATION AND ENVIRONMENT, IT SHOULD BE EASY TO SEE WHAT THE OPTIONS ARE • USE CLEAR NAMING CONVENTIONS • MODULAR AND ENCAPSULATED • DRY / KISS • TESTED

“ IT SHOULD ALWAYS BE CHEAPER TO CREATE A NEW ENVIRONMENT THAN TO REPAIR AN OLD ONE ”

CODE • MUST BE IN VERSION CONTROL • MUST HAVE A TESTING STRATEGY ( > 70% COVERAGE) • USE MEANINGFUL COMMIT MESSAGES • BRANCH BY ABSTRACTION • USE DEPENDENCY INJECTION • TDD

“ TEST DRIVEN DEVELOPMENT IS ESSENTIAL TO ENABLE THE PRACTICE OF CONTINUOUS DELIVERY ”

DATA • VERSION YOUR DATABASE CREATION AND MIGRATIONS (DBDEPLOY, PHINX) • STRIVE TO RETAIN FORWARD AND BACKWARD COMPATIBILITY • TEST DATA IS CREATED AND MAINTAINED IN A DIFFERENT PARTITION

ESSENTIAL PRACTICES • DON’T CHECK-IN BROKEN CODE • RUN TEST LOCALLY BEFORE COMMITTING • WAIT FOR TEST TO PASS BEFORE MOVING ON • FIX BROKEN BUILDS IMMEDIATELY • ALWAYS BE PREPARED TO REVERT TO PREVIOUS VERSION • DON’T COMMENT OUT FAILING TESTS

PRACTICES TO CONSIDER • FAILING A BUILD FOR ARCHITECTURAL BREACH • FAILING A BUILD FOR SLOW TESTS • FAILING A BUILD FOR WARNING OR CODE STYLE BREACH • FAILING A BUILD FOR PERFORMANCE

GET TO KNOW JENKINS AND SONAR

JENKINS • JENKINS IS AN OPEN SOURCE CONTINUOUS INTEGRATION SERVER WRITTEN IN JAVA • JENKINS WAS ORIGINALLY DEVELOPED AS THE HUDSON PROJECT • JENKINS IS A FORK OF HUDSON WHEN ORACLE TRADEMARKED THE PROJECT

JENKINS - INSTALLATION wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -! sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/ sources.list.d/jenkins.list'! sudo apt-get update! sudo apt-get install jenkins

JENKINS - CONFIGURE JENKINS-PHP.ORG

JENKINS - JOBS

JENKINS - JOBS

JENKINS - BUILD & POST-BUILD

JENKINS - NODES

JENKINS - DASHBOARD

JENKINS - POST-BUILD

JENKINS - RESULTS

JENKINS - TEST COVERAGE

JENKINS - ACCEPTANCE TEST - BEHAT & PHANTOMJS

JENKINS - PERFORMANCE TEST

JENKINS - CHUCK NORRIS

SONAR - INSTALLATION sudo sh -c 'echo deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/ > / etc/apt/sources.list'! sudo apt-get update! sudo apt-get install sonar

SONAR - CONFIGURE

SONAR - QUALITY PROFILE

SONAR - QUALITY PROFILE

SONAR - DASHBOARD

DEPLOYMENT PIPELINE DEMO

REFERENCES JENKINS-PHP.ORG

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

continuous integration - Sonar Vs Jenkins - Stack Overflow

Can we compare Jenkins and Sonar ? ... is a tool to implement Continuous Integration. ... analysing Maven 3 and multi language project using JENKINS.
Read more

Continuous Integration Platform Using ... - codecentric Blog

... the concepts and advantages of Continuous Integration ... Every artifact that is built using Jenkins gets versioned and ... gitlab and sonar ...
Read more

SonarQube plugin - Jenkins - Jenkins Wiki

Jenkins … Home; Plugins; SonarQube plugin; Edit; Add. ... This plugin allow easy integration of SonarQube™, ... I am using Sonar Hudon Plugin , ...
Read more

Gerrit, jenkins and sonar - video tutorial - YouTube

... scenario for a java project using git, gerrit, and jenkins. ... Gerrit, jenkins and sonar ... Use Jenkins to set up Continuous Delivery ...
Read more

Continuous integration of JavaScript apps using Jenkins

A possible setup is the use of Jenkins, SonarQube and Bower for continuous integration. Continuous integration ... using apt, by following http://sonar ...
Read more

Use Jenkins to set up Continuous Delivery Pipeline - YouTube

Setting up Continuous Delivery Pipeline using Jenkins with Integration to Artifactory and Sonar. Video demonstrates how you can use Jenkins for ...
Read more

Jenkins

Jenkins is an open source ... Continuous Integration and Continuous ... I’ll show you how to speed up your pipeline by using the Parallel Test ...
Read more

How do I correctly integrate Maven, Jenkins, Sonar and ...

How do I correctly integrate Maven, Jenkins, Sonar ... we integrated Sonar into Jenkins by using the Jenkins ... maven continuous-integration jenkins ...
Read more

Improving code quality with Sonar and Jenkins « labs@bsb.com

Improving code quality with Sonar and Jenkins. ... I’m also using sonar ... on how to integrate sonar into Jenkins to achieve Continuous integration and ...
Read more