+ All Categories
Home > Technology > The Journey Towards Continuous Integration

The Journey Towards Continuous Integration

Date post: 13-Dec-2014
Category:
Upload: sebastian-marek
View: 150 times
Download: 1 times
Share this document with a friend
Description:
The Journey Towards Continuous Integration at PHP Brno 2014
Popular Tags:
55
Sebastian Marek (@proofek) The Journey Towards Continuous Integration
Transcript
Page 1: The Journey Towards Continuous Integration

Sebastian Marek (@proofek)

The Journey Towards

Continuous Integration

Page 2: The Journey Towards Continuous Integration

One Morning Long Ago

Page 3: The Journey Towards Continuous Integration

At the Foot of Mount Doom

▪ Increased maintenance time

▪ growing problem numbers ▪ code harder to understand

and follow ▪ complex and time

consuming testing

Page 4: The Journey Towards Continuous Integration

Looking for help!

Page 5: The Journey Towards Continuous Integration

First frustrations

▪ ad hoc builds ▪ mixture of php3 and php4 and php5 ▪ learn as you go ▪ no standards

Page 6: The Journey Towards Continuous Integration

Forming up the fellowship

Page 7: The Journey Towards Continuous Integration

Calling the coucil

Who? ▪ managers ▪ developers !What? ▪ threats ▪ opportunities ▪ planning ▪ implementation

http://www.flickr.com/photos/pedromourapinheiro/3272323691/in/photostream/

Page 8: The Journey Towards Continuous Integration

It’s always about the money

▪ Design debt ▪ Late fees ▪ Interests

http://www.flickr.com/photos/your_teacher/1040476355/in/photostream/

Page 9: The Journey Towards Continuous Integration

Finding the best way

VS.

Page 10: The Journey Towards Continuous Integration

Support and roadmap

http://www.flickr.com/photos/jannem/3312115991/in/photostream/

Page 11: The Journey Towards Continuous Integration

Metrics and reports

http://www.flickr.com/photos/aussiegall/286709039/in/photostream/

Page 12: The Journey Towards Continuous Integration

Joining more powerful allies

Page 13: The Journey Towards Continuous Integration

Automation

http://www.flickr.com/photos/matthileo/3552898254/in/photostream/

Page 14: The Journey Towards Continuous Integration

East front

Page 15: The Journey Towards Continuous Integration

phpUnderControl

Page 16: The Journey Towards Continuous Integration

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

Page 17: The Journey Towards Continuous Integration

PHPUnit

Industry recognised xUnit testing framework for PHP, supporting:

▪ mock objects ▪ database testing ▪ code coverage analysis ▪ continuous integration platforms, like CruiseControl,

Jenkins, Bamboo

Page 18: The Journey Towards Continuous Integration

phpDocumentor

▪ automated documentation for PHP generated from code

▪ supports different formats and templates: HTML, PDF, XML

▪ easily configurable

Page 19: The Journey Towards Continuous Integration

PHP_Codesniffer

▪ Based on defined coding standards ▪ Detects coding standards violations ▪ Extendable and configurable ▪ Codebrowser

Page 20: The Journey Towards Continuous Integration

Code coverage report

▪ Be always on top of your tests ▪ Code coverage ratio ▪ Configurable thresholds ▪ XML and HTML format

Page 21: The Journey Towards Continuous Integration

Software metrics - PHP Depend

Code measures: ▪ Cyclomatic Complexity ▪ NPath Complexity ▪ CodeRank ▪ Lines Of Code

Page 22: The Journey Towards Continuous Integration

PHP Mess Detector

Intelligent code analyser: ▪ Possible bugs ▪ Suboptimal code ▪ Overcomplicated

expressions ▪ Unused parameters,

methods, properties

Page 23: The Journey Towards Continuous Integration

Buildbox maintenance

▪ New modules added ▪ Increased build time ▪ Often crashes ▪ Stability problems ▪ Hardware issues

Page 24: The Journey Towards Continuous Integration

Upgrades needed

Page 25: The Journey Towards Continuous Integration

Jenkins

Page 26: The Journey Towards Continuous Integration

Jenkins – next generation

▪ easy installation ▪ easy configuration ▪ plugin support ▪ distributed builds ▪ multi-language support ▪ dependency tracking

Page 27: The Journey Towards Continuous Integration

One ring to rule them all

http://www.flickr.com/photos/cosmic_bandita/2218419160/in/photostream/

Page 28: The Journey Towards Continuous Integration

Business wide visibilty

▪ Meaningful reports ▪ Responsibility and ownership ▪ KPI ▪ Goals

Page 29: The Journey Towards Continuous Integration

West front

Page 30: The Journey Towards Continuous Integration

SonarQube

▪ quality management platform

▪ continuous analysis ▪ easily extendable and

configurable

Page 31: The Journey Towards Continuous Integration

SonarQube

Page 32: The Journey Towards Continuous Integration

Radiator view

Page 33: The Journey Towards Continuous Integration

Reports

Page 34: The Journey Towards Continuous Integration

Reports

Page 35: The Journey Towards Continuous Integration

Reports

Page 36: The Journey Towards Continuous Integration

Reports

Page 37: The Journey Towards Continuous Integration

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

Page 38: The Journey Towards Continuous Integration

You broke the build!

Page 39: The Journey Towards Continuous Integration

Where's the build?

Page 40: The Journey Towards Continuous Integration

Works on my machine?!

Page 41: The Journey Towards Continuous Integration

Implementing CI culture

http://www.infoq.com/articles/Continuous-Delivery-Maturity-Model

Page 42: The Journey Towards Continuous Integration

▪ Implementing a development model supporting CI ▪ Scaling the build ▪ One way to build ▪ Build artefacts ▪ Build updates in JIRA ▪ Code reviews

Implementing CI culture

Page 43: The Journey Towards Continuous Integration

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

Page 44: The Journey Towards Continuous Integration

Scaling the build

Page 45: The Journey Towards Continuous Integration

From polling to pushing

▪ git polling ineffective ▪ git hooks supporting build automation ▪ Jenkins Build Per Branch

▪ self maintainable ▪ create jobs for newly created branches

Page 46: The Journey Towards Continuous Integration

Maven

▪ build automation ▪ controlling dependencies

Page 47: The Journey Towards Continuous Integration

Build artefacts

Composer & Satis

Page 48: The Journey Towards Continuous Integration

Code reviews

Page 49: The Journey Towards Continuous Integration

Better communication and monitoring

▪ build updates in JIRA ▪ wall boards ▪ weekly quality metrics

Page 50: The Journey Towards Continuous Integration

Functional testing

▪ Automated web apps testing

▪ Regression testing ▪ Headless builds

Page 51: The Journey Towards Continuous Integration

It’s your time now

Page 52: The Journey Towards Continuous Integration

Quick guide

1. Investigate 2. Trial 3. Form a team 4. Small steps 5. Be visible 6. Automate

Page 53: The Journey Towards Continuous Integration

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/

Page 54: The Journey Towards Continuous Integration

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

Page 55: The Journey Towards Continuous Integration

Sebastian Marek

http://joind.in/11823@proofek

Thank you


Recommended