views:

1022

answers:

3

I would like to do remote deployment from my build machine onto a server. The remoting can be done via ssh commands from a script, but I would rather use phing and a deploy.xml file that would do the automation.

What alternatives do I have to do ssh (and also scp) tasks from within a phing build file?

+3  A: 

I ran into the same problem about a year ago and back then i could not find a task. I ended up doing a exec task, this way it was all in the xml file.

<exec command="scp -i keys/id_rsa myfile user@$server:myfile" dir="." />
+2  A: 

If you really need phing, then afaik there's only exec. If you are open for other tools, have a look at capistrano and my answer in "Setting up a PHP web project, the infrastructure.".

Till
Thanks... I used capistrano in the past and I'm happy with it. However, it means that your team now needs to understand 2 languages (PHP and a bit of Ruby). I would rather go for one solution, but we all must be pragmatic...
Johan
That's a true concern. However, a good programmer will learn to handle a capistrano makefile in less than a day. Trust me. For example, I don't do any Ruby usually and I've coded tasks with namespaces in less than eight hours. The docs for capistrano are pretty awesome.
Till
+1  A: 

I came across a SCP and SSH tasks for Phing yesterday. You will also need to follow the instructions for installing SSH2 for PHP. I wasn't able to get the tasks to work straight out of the box, you might. I modified my copy, if you need I can provide.