PHP deployment using Git. How can I make it more automated? PHP deployment using Git. How can I make it more automated? php php

PHP deployment using Git. How can I make it more automated?


One solution that comes to mind is to add some post-receive hook on the live server bare repo in order to detect any deployed-2011-xx-yy tag coming from the staging repo, and to trigger the ssh script from there.

The other solution is to have a scheduler (like Hudson mention in pderaaij's answer, in order to:

  • monitor the stating repo and, on the right tag, trigger the push on the live server
  • monitor the live bare repo, and trigger the ssh script.

The second solution has the advantage to keep a trace of all release instances in an Hudson job report, each time said job detect the right tags and execute the release process.


Take a look at Capistrano, which happily does the symlink dance you describe here.


If you use Hudson as a continious integration server, you can make use of the build pipeline plugin.

You have your normal build process, but add an extra job which contains the commands to deploy your application. The plugin gives you a nice button to execute that build.

The hudson job could execute all the needed commands or you can take a peek at Maven for PHP and use the available plugins to invoke the remote scripts

Perhaps it is a bit out of range considering the path you've chosen already, but it's worth the research.