views:

83

answers:

3

I want to start automating more of my web development process so I'm looking for a build system. I write mostly PHP apps on Mac OS X and deploy Linux servers over FTP. A lot of my clients have basic hosting providers so shell access to their servers is typically not available, however remote MySQL access is usually present. Here is what I want to do with a build system:

  • When Building:
    • Lint JavaScript Files
    • Validate CSS Files
    • Validate HTML Files
    • Minify and concatenate JS and CSS files
    • Verify PHP Syntax
    • Set Debug/Production flags
  • When Deploying
    • Checkout latest version from SVN
    • Run build process
    • Upload files to server via FTP
    • Run SQL scripts on remote DB

I realize this is a lot of work to automate but I think it would be worth it. So what is the best way to start down this path? Is there a system that can handle builds and deploys, or should I search for separate solutions? What systems would you recommend?

+4  A: 

All you ask for can be done with Phing

Phing is a deployment framework written in PHP and modeled after Apache Ant. It comes with a large set of ready-to-use deployment tasks, including database deployment, remote file transfers and VCS connectivity. If you are missing functionality, you can extend Phing with standard PHP.

Phing provides the following features:

  • Simple XML buildfiles
  • Rich set of provided tasks
  • Easily extendable via PHP classes
  • Platform-independent: works on UNIX, Windows, MacOSX
  • No required external dependencies
  • Built & optimized for ZendEngine2/PHP5
Gordon
+1  A: 

You might also want to have a look to Hudson, an extensible continuous integration server. The supported features are available here.

Among the other languages, it supported PHP. This article presents some nice plugins for PHP. The article is also suggesting Phing for the build. See Gordon's answer for details.

Roberto Aloi
A: 

You may also be interested in my recent bounty question: Setting up a deployment / build / CI cycle for PHP projects

Pekka