I need a solution that I can deploy php application to a webserver using ant and git. I need to copy the files to the webserver and run a php script which setup the database.
I was thinking about using sshexec to run commands which will update the files and run the php script
<target name="deploy">
<sshexec host="host"
port="22"
username="user"
password="****"
trust="true"
command="..."/>
</target>
Does anyone has the complete solution? or even a better solution?
If you need to periodically copy a changing set of files to the server and to execute a known script after each update, you could use git push
for copying and a post-receive
git hook (http://book.git-scm.com/5_git_hooks.html) to invoke the script.