Deploy to remote server using scp in NANT script

Posted by Mini on Stack Overflow See other posts from Stack Overflow or by Mini
Published on 2009-12-10T10:01:43Z Indexed on 2010/04/26 23:23 UTC
Read the original article Hit count: 609

Filed under:
|

I am trying to copy a file to a remote server using scp task in Nant.Contrib .

I have used the following code to do that:

<target name= "QADeploy"description="gthtyb" >
<loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />
<echo message="htyh"/>
<scp file="D:\SourceTest\redist.txt" server="\\10.4.30.19" user="xxx:uuuu">      
</scp>
</target>

But I am getting an error: scp failed to start. The system cannot find the file specified. The code is as follows: Then I have downloaded pscp.exe and modified the code as below:

<target name= "QADeploy"
    description="gthtyb" >
 <loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />

<echo message="htyh"/>

<scp file="D:\SourceTest\redist.txt" server="\\10.4.30.19" user="xxx:uuuu" program="C:\pscp\pscp.exe">      
</scp>

Now I am getting the following error:

[scp] ssh_init:host does not exist

External Program Failed:C:\pscp\pscp.exe

can u please help whats the best way to copy a file to a remote server using Nant. I am using this code to deploy files to a remote server.

Thanks

© Stack Overflow or respective owner

Related posts about scp

Related posts about nant