Image for post: Continuous Integration with PHP

Continuous Integration with PHP

I found it very difficult to set an environment to practice continuous integration with PHP, especially Jenkins has not great documentation and the plugins are difficult to set. Using Jenkins, to begin with continuous integration on your software and web applications is a good choice. It seems Xinc or Sismo are good alternatives:



Work Process

Ok, now I have 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 started 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 break some tests. Now the thing is more complex... We have to set up 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 trying to set up the whole environment on your computer if you have to set up on production. Just to understand the process and getting started to real continuous integration. Continuous delivery I've not heard so many 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 Martin Fowler's book continuous delivery. I hope to write about this topic in this post.