
Continuous Integration with PHP
I found very difficult to set an enviroment to practice continuous integration with PHP, especially Jenkins has not a great documentation and the plugins are difficult to set. Using Jenkins to begin with continous integration on your softwares and web applications is a good choice. It seems Xinc or Sismo are good alternatives:
- A Template for Jenkins, Sebastian Bergmann tools
- Jenkins PHP by Sebastian Bergmann
- PHP Project Wizard (PPW) on GitHub
- Xinc
- Sismo
- Teamcity (Jet Brans)
Tools
- Unit tests: PHPUnit, Simple test or Enhance PHP
- Phing
- Xdebug
- PHP Mess detector
- PHP Under control
- PHP Code Sniffer (PEAR library)
- PHP Depend
- PHP Copy \ Paste Detector
IDE
- Eclipse for PHP developers (freeware)
- Zend Studio (shareware), the most complete IDE to build professional PHP scripts, websites and applications
- Komodo-edit (freeware). The IDE is shareware and it's available on the same website.
- PHP Storm (shareware) by Jet Brans
Work Process
Ok, now I've the tools but how does this process work? This a common question and I repeat the documentation about PHP for these practices is not so good and clear, even and above all for Jenkins. So get start with Test Driven Development first. Write tests first and let your tests run. Make the cycle red (error)\green(test passed)\blue (refactoring). It's ok for a single test but how about multiple tests? If I have a test suite with dozens of files I want to run all tests and see if my production code is always tested and if new updates and new features will broke some test. Now the thing are more complex... We have to setup a server software to do this job. Jenkins is built for Java and Clover PHP must be able to make a build with Ant, set the XML files with all info. This is not simple and I suggest to try to setup the whole enviroment on your computer if you have to setup on production. Just to understand the process and getting start to real continuous integration. Continuous delivery I've not heard so much words about continuous delivery in PHP. So the point is to apply these concepts with PHP tools using continuous integration, test driven development and so on. Check out the Martin Fowler's book continuous delivery. I hope to write about this topic on this post.