The Journey Towards Continuous Integration
-
Upload
sebastian-marek -
Category
Technology
-
view
150 -
download
1
description
Transcript of The Journey Towards Continuous Integration
Sebastian Marek (@proofek)
The Journey Towards
Continuous Integration
One Morning Long Ago
At the Foot of Mount Doom
▪ Increased maintenance time
▪ growing problem numbers ▪ code harder to understand
and follow ▪ complex and time
consuming testing
Looking for help!
First frustrations
▪ ad hoc builds ▪ mixture of php3 and php4 and php5 ▪ learn as you go ▪ no standards
Forming up the fellowship
Calling the coucil
Who? ▪ managers ▪ developers !What? ▪ threats ▪ opportunities ▪ planning ▪ implementation
http://www.flickr.com/photos/pedromourapinheiro/3272323691/in/photostream/
It’s always about the money
▪ Design debt ▪ Late fees ▪ Interests
http://www.flickr.com/photos/your_teacher/1040476355/in/photostream/
Finding the best way
VS.
Support and roadmap
http://www.flickr.com/photos/jannem/3312115991/in/photostream/
Metrics and reports
http://www.flickr.com/photos/aussiegall/286709039/in/photostream/
Joining more powerful allies
Automation
http://www.flickr.com/photos/matthileo/3552898254/in/photostream/
East front
phpUnderControl
Automated builds
▪ Cruisecontrol addon ▪ PHPUnit integration ▪ phpDocumentor
integration ▪ code metrics generation ▪ code coverage reports ▪ checkstyle report
integration ▪ PHP Depend integration ▪ PHPMD support ▪ and many more
PHPUnit
Industry recognised xUnit testing framework for PHP, supporting:
▪ mock objects ▪ database testing ▪ code coverage analysis ▪ continuous integration platforms, like CruiseControl,
Jenkins, Bamboo
phpDocumentor
▪ automated documentation for PHP generated from code
▪ supports different formats and templates: HTML, PDF, XML
▪ easily configurable
PHP_Codesniffer
▪ Based on defined coding standards ▪ Detects coding standards violations ▪ Extendable and configurable ▪ Codebrowser
Code coverage report
▪ Be always on top of your tests ▪ Code coverage ratio ▪ Configurable thresholds ▪ XML and HTML format
Software metrics - PHP Depend
Code measures: ▪ Cyclomatic Complexity ▪ NPath Complexity ▪ CodeRank ▪ Lines Of Code
PHP Mess Detector
Intelligent code analyser: ▪ Possible bugs ▪ Suboptimal code ▪ Overcomplicated
expressions ▪ Unused parameters,
methods, properties
Buildbox maintenance
▪ New modules added ▪ Increased build time ▪ Often crashes ▪ Stability problems ▪ Hardware issues
Upgrades needed
Jenkins
Jenkins – next generation
▪ easy installation ▪ easy configuration ▪ plugin support ▪ distributed builds ▪ multi-language support ▪ dependency tracking
One ring to rule them all
http://www.flickr.com/photos/cosmic_bandita/2218419160/in/photostream/
Business wide visibilty
▪ Meaningful reports ▪ Responsibility and ownership ▪ KPI ▪ Goals
West front
SonarQube
▪ quality management platform
▪ continuous analysis ▪ easily extendable and
configurable
SonarQube
Radiator view
Reports
Reports
Reports
Reports
The army needs to follow the leader
▪ Lead by example ▪ firm, but friendly and helpful ▪ never forget about training ▪ clear and simple rules ▪ praise vs. punishment
You broke the build!
Where's the build?
Works on my machine?!
Implementing CI culture
http://www.infoq.com/articles/Continuous-Delivery-Maturity-Model
▪ Implementing a development model supporting CI ▪ Scaling the build ▪ One way to build ▪ Build artefacts ▪ Build updates in JIRA ▪ Code reviews
Implementing CI culture
Tim
e
release branches masterdevelop hotfixes
feature branches
Feature for
future
Tag
1.0
Major feature for
next release
From this point on, “next release” means the release
after 1.0
Severe bug fixed for
production: hotfix 0.2
Bugfixes from rel.
branch may be
continuously merged back
Tag
0.1
Tag
0.2
Incorporate bugfix in develop
Only bugfixes!
Start of release
branch for 1.0
Author: Vincent Driessen Original blog post: http://nvie.com/archives/323
Gitflow
Scaling the build
From polling to pushing
▪ git polling ineffective ▪ git hooks supporting build automation ▪ Jenkins Build Per Branch
▪ self maintainable ▪ create jobs for newly created branches
Maven
▪ build automation ▪ controlling dependencies
Build artefacts
Composer & Satis
Code reviews
Better communication and monitoring
▪ build updates in JIRA ▪ wall boards ▪ weekly quality metrics
Functional testing
▪ Automated web apps testing
▪ Regression testing ▪ Headless builds
It’s your time now
Quick guide
1. Investigate 2. Trial 3. Form a team 4. Small steps 5. Be visible 6. Automate
Resources
▪ PHPUnit - http://www.phpunit.de/ ▪ Jenkins - http://jenkins-ci.org/ ▪ SonarQube - http://www.sonarqube.org/ ▪ phpDocumentor - http://www.phpdoc.org/ ▪ PHP_CodeSniffer - http://pear.php.net/package/
PHP_CodeSniffer/ ▪ PHP Depend - http://pdepend.org/ ▪ PHP Mess Detector - http://phpmd.org/ ▪ Selenium - http://seleniumhq.org/ ▪ xDebug - http://www.xdebug.org/ ▪ http://www.infoq.com/articles/Continuous-Delivery-Maturity-
Model ▪ http://entagen.github.io/jenkins-build-per-branch/
CodeClub - https://www.codeclub.org.uk
Volunteer Code Club Projects Venue Children
+ + +
A nationwide network of volunteer-led after school
coding clubs for children aged 9-11
Sebastian Marek
http://joind.in/11823@proofek
Thank you