Search code examples
phpdeploymentcontinuous-integrationpear

Using PEAR, Phing for a ROBUST deployment solution?


I'm starting a new project and want a one-step build process for my development, continuous integration, and production servers.

I'll want the process to be included in my source control (git/github), and to run robustly on any of my three servers, which are pretty similar, but do have different paths for the project root.

I had planned to use Phing, PHPDocumentor, PHP_CodeSniffer, PHPUnit, etc. installed via Pyrus into a localized PEAR/PEAR2 install that could be deployed along with the project, so I could be confident in my dependencies at build time.

However, I've had nothing but problems with getting this set up.

This is the first time I've tried to set up such a build system, and *nix installs aren't my strong point (though I always do end up with a reliable system eventually), so the weak link here may be me. However, a lot of the problems I'm having seem to come from PEAR.

For example, no matter how carefully I install via pyrus, everything ends up having path issues. Looking into some of the PEAR packages, all paths are hard coded (probably set at runtime) with the relative paths I used during install (./pear, etc.). This means I can only successfully run the packages from the folder where pyrus was during install, even though the run scrips were put in ./pear/bin and I did set the bin folder during install. Sometimes the paths conflict internally to a single package, so it wants to run from here, but it wants to manage the config from over there...

PHPDocumentor doesn't handle PHP5.3 (and won't run for me at all, maybe because it has issues, maybe because I've mis-installed it?), so I've replaced it with PHPDoctor which initially seems pretty good.

Another example, after setup, Phing will run, but just dies silently. After digging in and tracing it, I find that an obscure function on line 70 of /io/PhingFile is getting null for a required arg, which throws a ConfigurationException which causes it to die silently.

I'm confident that I can get all this working ok, but I'm NOT confident that it will ever be a deployable robust system, and I really don't want to have to debug, tweak, and then maintain a big pile of self-modified PEAR packages that have to be retweaked at every upgrade.

So, finally the question =o)

Does anyone have a really good robust build system using these apps? Was there some trick to it?

Or does everyone have a nice robust build system and it's just my naivete with *nix installs and system config that makes this all seem like a double-sized helping of clusterphuckery?

Does anyone have any pointers on getting such a system set up to work across multiple servers, or am I just kidding myself? Maybe I should just do separate installs on the systems outside the project root and get on with my development?


Solution

  • @work, we use many PEAR packages in our software, install them via Pyrus into local directories and extensively use Phing as build tool to run tests and deploy the software - on different Linux systems, and some developers even run them on their Windows boxes.

    It's working reliably, and we're not experiencing the issues you described.