Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The Journey Towards 
Continuous Integration 
Sebastian Marek (@proofek)
One Morning Long Ago
At the Foot of Mount Doom 
▪ Increased maintenance 
time 
▪ growing problem numbers 
▪ code harder to understand 
and foll...
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 
ht...
It’s always about the money 
▪ Design debt 
▪ Late fees 
▪ Interests 
http://www.flickr.com/photos/your_teacher/1040476355...
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 
▪...
PHPUnit 
Industry recognised xUnit testing framework for PHP, 
supporting: 
▪ mock objects 
▪ database testing 
▪ code cov...
phpDocumentor 
▪ automated documentation 
for PHP generated from 
code 
▪ supports different formats 
and templates: HTML,...
PHP_Codesniffer 
▪ Based on defined coding standards 
▪ Detects coding standards violations 
▪ Extendable and configurable...
Code coverage report 
▪ Be always on top of your tests 
▪ Code coverage ratio 
▪ Configurable thresholds 
▪ XML and HTML f...
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 
▪ Unuse...
Buildbox maintenance 
▪ New modules added 
▪ Increased build time 
▪ Often crashes 
▪ Stability problems 
▪ Hardware issue...
Upgrades needed
Jenkins
Jenkins – next generation 
▪ easy installation 
▪ easy configuration 
▪ plugin support 
▪ distributed builds 
▪ multi-lang...
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 
▪...
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 CI culture 
▪ Implementing a development model supporting CI 
▪ Scaling the build 
▪ One way to build 
▪ Buil...
Time 
Gitflow 
release 
develop branches hotfixes master 
feature 
branches 
Feature 
for 
future 
Tag 
1.0 
Major 
featur...
Scaling the build
From polling to pushing 
▪ git polling ineffective 
▪ git hooks supporting build automation 
▪ Jenkins Build Per Branch 
▪...
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/...
CodeClub - https://www.codeclub.org.uk 
+ + + 
Volunteer Code Club Projects Venue Children 
A nationwide network of volunt...
Sebastian Marek 
@proofek 
Thank you 
http://joind.in/11823
Upcoming SlideShare
Loading in …5
×

The Journey Towards Continuous Integration

1,665 views

Published on

The Journey Towards Continuous Integration at PHP Brno 2014

Published in: Technology
  • Be the first to comment

The Journey Towards Continuous Integration

  1. 1. The Journey Towards Continuous Integration Sebastian Marek (@proofek)
  2. 2. One Morning Long Ago
  3. 3. At the Foot of Mount Doom ▪ Increased maintenance time ▪ growing problem numbers ▪ code harder to understand and follow ▪ complex and time consuming testing
  4. 4. Looking for help!
  5. 5. First frustrations ▪ ad hoc builds ▪ mixture of php3 and php4 and php5 ▪ learn as you go ▪ no standards
  6. 6. Forming up the fellowship
  7. 7. Calling the coucil Who? ▪ managers ▪ developers ! What? ▪ threats ▪ opportunities ▪ planning ▪ implementation http://www.flickr.com/photos/pedromourapinheiro/3272323691/in/photostream/
  8. 8. It’s always about the money ▪ Design debt ▪ Late fees ▪ Interests http://www.flickr.com/photos/your_teacher/1040476355/in/photostream/
  9. 9. Finding the best way VS.
  10. 10. Support and roadmap http://www.flickr.com/photos/jannem/3312115991/in/photostream/
  11. 11. Metrics and reports http://www.flickr.com/photos/aussiegall/286709039/in/photostream/
  12. 12. Joining more powerful allies
  13. 13. Automation http://www.flickr.com/photos/matthileo/3552898254/in/photostream/
  14. 14. East front
  15. 15. phpUnderControl
  16. 16. 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
  17. 17. PHPUnit Industry recognised xUnit testing framework for PHP, supporting: ▪ mock objects ▪ database testing ▪ code coverage analysis ▪ continuous integration platforms, like CruiseControl, Jenkins, Bamboo
  18. 18. phpDocumentor ▪ automated documentation for PHP generated from code ▪ supports different formats and templates: HTML, PDF, XML ▪ easily configurable
  19. 19. PHP_Codesniffer ▪ Based on defined coding standards ▪ Detects coding standards violations ▪ Extendable and configurable ▪ Codebrowser
  20. 20. Code coverage report ▪ Be always on top of your tests ▪ Code coverage ratio ▪ Configurable thresholds ▪ XML and HTML format
  21. 21. Software metrics - PHP Depend Code measures: ▪ Cyclomatic Complexity ▪ NPath Complexity ▪ CodeRank ▪ Lines Of Code
  22. 22. PHP Mess Detector Intelligent code analyser: ▪ Possible bugs ▪ Suboptimal code ▪ Overcomplicated expressions ▪ Unused parameters, methods, properties
  23. 23. Buildbox maintenance ▪ New modules added ▪ Increased build time ▪ Often crashes ▪ Stability problems ▪ Hardware issues
  24. 24. Upgrades needed
  25. 25. Jenkins
  26. 26. Jenkins – next generation ▪ easy installation ▪ easy configuration ▪ plugin support ▪ distributed builds ▪ multi-language support ▪ dependency tracking
  27. 27. One ring to rule them all http://www.flickr.com/photos/cosmic_bandita/2218419160/in/photostream/
  28. 28. Business wide visibilty ▪ Meaningful reports ▪ Responsibility and ownership ▪ KPI ▪ Goals
  29. 29. West front
  30. 30. SonarQube ▪ quality management platform ▪ continuous analysis ▪ easily extendable and configurable
  31. 31. SonarQube
  32. 32. Radiator view
  33. 33. Reports
  34. 34. Reports
  35. 35. Reports
  36. 36. Reports
  37. 37. 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
  38. 38. You broke the build!
  39. 39. Where's the build?
  40. 40. Works on my machine?!
  41. 41. Implementing CI culture http://www.infoq.com/articles/Continuous-Delivery-Maturity-Model
  42. 42. Implementing CI culture ▪ Implementing a development model supporting CI ▪ Scaling the build ▪ One way to build ▪ Build artefacts ▪ Build updates in JIRA ▪ Code reviews
  43. 43. Time Gitflow release develop branches hotfixes master 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 Start of release branch for 1.0 Only bugfixes! Author: Vincent Driessen Original blog post: http://nvie.com/ archives/323
  44. 44. Scaling the build
  45. 45. From polling to pushing ▪ git polling ineffective ▪ git hooks supporting build automation ▪ Jenkins Build Per Branch ▪ self maintainable ▪ create jobs for newly created branches
  46. 46. Maven ▪ build automation ▪ controlling dependencies
  47. 47. Build artefacts Composer & Satis
  48. 48. Code reviews
  49. 49. Better communication and monitoring ▪ build updates in JIRA ▪ wall boards ▪ weekly quality metrics
  50. 50. Functional testing ▪ Automated web apps testing ▪ Regression testing ▪ Headless builds
  51. 51. It’s your time now
  52. 52. Quick guide 1. Investigate 2. Trial 3. Form a team 4. Small steps 5. Be visible 6. Automate
  53. 53. 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/
  54. 54. 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
  55. 55. Sebastian Marek @proofek Thank you http://joind.in/11823

×