SlideShare una empresa de Scribd logo
1 de 19
Build Process
The beginnings of
Continuous Integration
Who Am I?

CTO/Founder of Pamiris, Inc.

Extensive NPO board service

Overseen payroll conversions
& HRIS implementations with
over 600 employees

BBA, MIS from EWU 2004
(manga cum laude, BGS)
Build Process: wait... why?
But PHP doesn't have to compile!
definition - Build /bild/: The
process of preparing
software for deployment
and/or distribution.
PHP Deployment Prep
● Lint (syntax/compile error checking)
● SLOC (source lines of code) metrics
● Unit testing
● Code coverage analysis
● Functional Testing
● Code style checking
● Cyclomatic and N-path complexity
● Code duplication (DRY)
PHP Deployment Prep:
Again... why should we?
● Ability to track code quality trends
● More people/other teams can contribute
safely(er. Saflier. Saferly?)
● Accountability for all
● Nervous sleep deprivation, anyone?
● Sooner found = cheaper fixed
Quick Feedback
● Total coverage statistics
● Complexity measures
● CRAP index: Change Risk Anti- Patterns
● Pass/No Pass for tests
PHP Deployment Prep:
Why doesn't it happen?
● “Never enough time”
● “It worked fine on my machine”
● “It didn't seem like a big deal”
If it isn't easy and repeatable,
it won't happen.
Build Automation:
Make it easy, make it happen
Developers and QA folks alike should be able to
check a commit with absolute ease. The easier it
is, the more it happens. The more it happens,
the better the code is.
Build Automation Tools
● GNU Make
http://www.gnu.org/software/make/
● Phing (PHing Is Not Gnu make)
http://www.phing.info/
● Apache Ant
http://ant.apache.org/
Start Simple
● Get PHPUnit, behat, PHPspec or other unit
test running
● Get PHPLOC to run (composer makes it easy)
● Install a build automation tool
● MAGIC... ??? … profit.
Basic build.xml
My current build.xml
● ~175 Lines
● Tasks:
– Build (prepare, lint, phpunit-ci, phploc, pdepend,
phpmd)
– Build-parallel
– Phpcs (coding standard analysis)
– Selenium-install
– Selenium-start -stop
Ant usage: running the build
● Just 'ant' will autorun the whole build command
● 'ant <target-name>' will run any part of it
● Different targets for different uses
– Developers WIP: fast unit tests w/o coverage or
functional
– Developers pre-commit: all tests plus coverage
– Metric tracking: all static analysis tools
– Pre-deploy: all of the above
Next Steps
● Flesh out other valuable build steps
● Store build results
● Automate build on check-in with
Jenkins/TravisCI
● Add charting (trend display)
● Continuous deployment
Resources
● http://jenkins-php.org/index.html
● Integrating PHP Projects with Jenkins by
Sebastian Bergman (on Kindle, etc)
● http://marcelog.github.io/articles/ci_jenkins_hudson
● https://www.phptesting.org/

Más contenido relacionado

La actualidad más candente

Robot Framework with actual robot
Robot Framework with actual robot Robot Framework with actual robot
Robot Framework with actual robot Eficode
 
froglogic Squish GUI Tester Presentation
froglogic Squish GUI Tester Presentationfroglogic Squish GUI Tester Presentation
froglogic Squish GUI Tester PresentationReginald Stadlbauer
 
Automation using RobotFramework for embedded device
Automation using RobotFramework for embedded deviceAutomation using RobotFramework for embedded device
Automation using RobotFramework for embedded deviceSrix Sriramkumar
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplateStanislav Petrov
 
froglogic Squish (Qt edition)
froglogic Squish (Qt edition)froglogic Squish (Qt edition)
froglogic Squish (Qt edition)Amanda Burma
 
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...Xebia Nederland BV
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CIMartin de Keijzer
 
Constinuous Integration
Constinuous IntegrationConstinuous Integration
Constinuous IntegrationGabriel Araujo
 
Effectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP ProjectsEffectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP ProjectsAndrew Yatsenko
 
GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)
GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)
GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)Matheus Marabesi
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Koombea
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Molliewillemstuursma
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...Lucas Arruda
 
Testing for people who hate testing
Testing for people who hate testingTesting for people who hate testing
Testing for people who hate testingSam Bolgert
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...OdessaJS Conf
 

La actualidad más candente (20)

Robot Framework with actual robot
Robot Framework with actual robot Robot Framework with actual robot
Robot Framework with actual robot
 
froglogic Squish GUI Tester Presentation
froglogic Squish GUI Tester Presentationfroglogic Squish GUI Tester Presentation
froglogic Squish GUI Tester Presentation
 
Automation using RobotFramework for embedded device
Automation using RobotFramework for embedded deviceAutomation using RobotFramework for embedded device
Automation using RobotFramework for embedded device
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
froglogic Squish (Qt edition)
froglogic Squish (Qt edition)froglogic Squish (Qt edition)
froglogic Squish (Qt edition)
 
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
 
Squish slidedeck
Squish slidedeckSquish slidedeck
Squish slidedeck
 
UPC Plone Testing Talk
UPC Plone Testing TalkUPC Plone Testing Talk
UPC Plone Testing Talk
 
Improving code quality using CI
Improving code quality using CIImproving code quality using CI
Improving code quality using CI
 
Constinuous Integration
Constinuous IntegrationConstinuous Integration
Constinuous Integration
 
User story workflow (eng)
User story workflow (eng)User story workflow (eng)
User story workflow (eng)
 
Effectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP ProjectsEffectively Reuse the Code Between PHP Projects
Effectively Reuse the Code Between PHP Projects
 
GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)
GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)
GDG Passo fundo - Apps with unit tests (Karma + jasmine + angular)
 
Python for blackbox testers
Python for blackbox testersPython for blackbox testers
Python for blackbox testers
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...
 
Testing for people who hate testing
Testing for people who hate testingTesting for people who hate testing
Testing for people who hate testing
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
 

Similar a Lighning Talk: PHP build process

Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingShyam Sunder Verma
 
An introduction to Phing the PHP build system (PHPDay, May 2012)
An introduction to Phing the PHP build system (PHPDay, May 2012)An introduction to Phing the PHP build system (PHPDay, May 2012)
An introduction to Phing the PHP build system (PHPDay, May 2012)Jeremy Coates
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testingEngineor
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Anton Babenko
 
Php Development Stack
Php Development StackPhp Development Stack
Php Development Stackshah_neeraj
 
An introduction to Phing the PHP build system
An introduction to Phing the PHP build systemAn introduction to Phing the PHP build system
An introduction to Phing the PHP build systemJeremy Coates
 
Frameworkless CLI app in PHP
Frameworkless CLI app in PHPFrameworkless CLI app in PHP
Frameworkless CLI app in PHPMax Bodnar
 
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Engineor
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsNetsparker
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...Bruno Tanoue
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Ivo Jansch
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil FrameworkVeilFramework
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
Serverless Functions and Machine Learning: Putting the AI in APIs
Serverless Functions and Machine Learning: Putting the AI in APIsServerless Functions and Machine Learning: Putting the AI in APIs
Serverless Functions and Machine Learning: Putting the AI in APIsNordic APIs
 

Similar a Lighning Talk: PHP build process (20)

Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
An introduction to Phing the PHP build system (PHPDay, May 2012)
An introduction to Phing the PHP build system (PHPDay, May 2012)An introduction to Phing the PHP build system (PHPDay, May 2012)
An introduction to Phing the PHP build system (PHPDay, May 2012)
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)
 
Php Development Stack
Php Development StackPhp Development Stack
Php Development Stack
 
Php Development Stack
Php Development StackPhp Development Stack
Php Development Stack
 
An introduction to Phing the PHP build system
An introduction to Phing the PHP build systemAn introduction to Phing the PHP build system
An introduction to Phing the PHP build system
 
Phing
PhingPhing
Phing
 
Frameworkless CLI app in PHP
Frameworkless CLI app in PHPFrameworkless CLI app in PHP
Frameworkless CLI app in PHP
 
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass Firewalls
 
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...[ENGLISH] TDC 2015 - PHP  Trail - Tests and PHP Continuous Integration Enviro...
[ENGLISH] TDC 2015 - PHP Trail - Tests and PHP Continuous Integration Enviro...
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Always be testing
Always be testingAlways be testing
Always be testing
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
Serverless Functions and Machine Learning: Putting the AI in APIs
Serverless Functions and Machine Learning: Putting the AI in APIsServerless Functions and Machine Learning: Putting the AI in APIs
Serverless Functions and Machine Learning: Putting the AI in APIs
 

Lighning Talk: PHP build process

  • 1. Build Process The beginnings of Continuous Integration
  • 2. Who Am I?  CTO/Founder of Pamiris, Inc.  Extensive NPO board service  Overseen payroll conversions & HRIS implementations with over 600 employees  BBA, MIS from EWU 2004 (manga cum laude, BGS)
  • 3. Build Process: wait... why? But PHP doesn't have to compile! definition - Build /bild/: The process of preparing software for deployment and/or distribution.
  • 4. PHP Deployment Prep ● Lint (syntax/compile error checking) ● SLOC (source lines of code) metrics ● Unit testing ● Code coverage analysis ● Functional Testing ● Code style checking ● Cyclomatic and N-path complexity ● Code duplication (DRY)
  • 5. PHP Deployment Prep: Again... why should we? ● Ability to track code quality trends ● More people/other teams can contribute safely(er. Saflier. Saferly?) ● Accountability for all ● Nervous sleep deprivation, anyone? ● Sooner found = cheaper fixed
  • 6. Quick Feedback ● Total coverage statistics ● Complexity measures ● CRAP index: Change Risk Anti- Patterns ● Pass/No Pass for tests
  • 7.
  • 8. PHP Deployment Prep: Why doesn't it happen? ● “Never enough time” ● “It worked fine on my machine” ● “It didn't seem like a big deal” If it isn't easy and repeatable, it won't happen.
  • 9. Build Automation: Make it easy, make it happen Developers and QA folks alike should be able to check a commit with absolute ease. The easier it is, the more it happens. The more it happens, the better the code is.
  • 10. Build Automation Tools ● GNU Make http://www.gnu.org/software/make/ ● Phing (PHing Is Not Gnu make) http://www.phing.info/ ● Apache Ant http://ant.apache.org/
  • 11. Start Simple ● Get PHPUnit, behat, PHPspec or other unit test running ● Get PHPLOC to run (composer makes it easy) ● Install a build automation tool ● MAGIC... ??? … profit.
  • 13. My current build.xml ● ~175 Lines ● Tasks: – Build (prepare, lint, phpunit-ci, phploc, pdepend, phpmd) – Build-parallel – Phpcs (coding standard analysis) – Selenium-install – Selenium-start -stop
  • 14. Ant usage: running the build ● Just 'ant' will autorun the whole build command ● 'ant <target-name>' will run any part of it ● Different targets for different uses – Developers WIP: fast unit tests w/o coverage or functional – Developers pre-commit: all tests plus coverage – Metric tracking: all static analysis tools – Pre-deploy: all of the above
  • 15.
  • 16.
  • 17.
  • 18. Next Steps ● Flesh out other valuable build steps ● Store build results ● Automate build on check-in with Jenkins/TravisCI ● Add charting (trend display) ● Continuous deployment
  • 19. Resources ● http://jenkins-php.org/index.html ● Integrating PHP Projects with Jenkins by Sebastian Bergman (on Kindle, etc) ● http://marcelog.github.io/articles/ci_jenkins_hudson ● https://www.phptesting.org/