wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Remote deployment to a unix server using FTP task in ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Remote deployment to a unix server using FTP task in ANT" Watch "Remote deployment to a unix server using FTP task in ANT" New topic
Author

Remote deployment to a unix server using FTP task in ANT

Sumit Ranjan
Greenhorn

Joined: Dec 20, 2005
Posts: 24
Hi,

I want to deploy my tar file on a remote unix server using the FTP task provided by ANT.For doing this I need to connect to a particular unix host and then acquire the superuser status by doing su - username and password as only the superuser has the access to copy any files to the runtime environment.

Presently I am able establish a connection to the remote host with my userid and password but I dont know then how to switch to superuser id and password before trying to deploy my file by copying it to the correct location on the server..???

My target for this deployment looks like this -

<target name="deploy"
depends="create_dam"
description="Deploy the tar file on to the deployment environment">
<ftp
action = "put"
server = "${Server.Address}"
remotedir = "${remote.dir}"
userid = "${user.id}"
password = "${password}">
<!-- here I need some code to become superuser -->

<fileset dir ="${dist.dir}">
<patternset refid="tar.patternset"/>
</fileset>
</ftp>
</target>

Can anyone guide me on the same??
Thanks in advance...
Sumit
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

You could upload the files to your unix home directory using the ftp task,

and then deploy it from the unix server via the telnet task.
With the telnet task you can execute the su command, and then move the files from your home dir to the deployment dir.

Regards, Jan

(Maybe your ftp server supports the "quote site [command] [parameters]" command?)


OCUP UML fundamental and ITIL foundation
youtube channel
Sumit Ranjan
Greenhorn

Joined: Dec 20, 2005
Posts: 24
You could upload the files to your unix home directory using the ftp task,

and then deploy it from the unix server via the telnet task.
With the telnet task you can execute the su command, and then move the files from your home dir to the deployment dir.

Regards, Jan

(Maybe your ftp server supports the "quote site [command] [parameters]" command?)
----------------------------------------------------------------------------

Hi Jan,

First of all thanks a lot for your valuable suggestions.. Using your suggestion I was able to ftp the tar file to my home directory but I still have this doubt as to how to login to a unix host as a superuser using telnet task and then copy the tar file from home directory to the required Server's runtime environment. Can you please give some sort of example for the same if it is possible for you... This is the first time I am dealing with remote deployment of tar files.. so I dont know much..!!!

Thanks a lot in advance,
Sumit
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

In the telnet task, you can execute any unix command.
Example:

Ask your unix administrator for the command to become a superuser.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote deployment to a unix server using FTP task in ANT
 
Similar Threads
ANT FTP task: Software caused connection abort: connect
error during FTP transfer: org apache commons net MalformedServerReplyException
Fully Automate Build & Deployment Using Ant
problem in deplying the file on server
FTP Task giving "Connection timed out: connect" Error