ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Setting up Maverick sshtools for Ant
Date Fri, 01 Feb 2008 13:45:02 GMT
serdsch wrote:
> Hi everyone,
> 
> I try to set up Maverick j2ssh for Ant to remotely import DBs from a server
> (sshexec allows only one command per session and therefore is useless for
> me). 


the trick is to separate the commands with a semicolon:
     <rootssh
       failonerror="true"
       command="rpm -qf ${rpm.install.dir} ;
rpm -qf ${rpm.install.dir}/bin ;
rpm -qf ${rpm.install.dir}/lib ;
rpm -qf ${rpm.install.dir}/links ;
rpm -qf ${rpm.install.dir}/links/smartfrog.jar;
rpm -qf ${rpm.install.dir}/links/sfServices.jar;
rpm -qf ${rpm.install.dir}/bin/security ;
rpm -qf ${rpm.install.dir}/bin/metadata ;
rpm -qf ${rpm.log.dir} ;
rpm -qf ${rpm.etc.dir} ;
rpm -qf ${rpm.install.dir}/testCA ;
rpm -qf ${rpm.install.dir}/private ;
rpm -qf ${rpm.install.dir}/signedLib ;
rpm -qf /etc/profile.d/smartfrog.sh ;
rpm -qf /etc/profile.d/smartfrog.csh ;
rpm -qf ${rpm.install.dir}/docs ;
rpm -qf ${rpm.install.dir}/src ;
rpm -qf ${rpm.install.dir}/src.zip ;
rpm -qf ${rpm.install.dir}/lib/ant-${apache.ant.version}.jar;
rpm -qf ${rpm.install.dir}/links/ant.jar;
rpm -qf ${rpm.install.dir}/signedLib/smartfrog-${smartfrog.version}.jar;
rpm -qf ${rpm.install.dir}/signedLib/sfServices-${smartfrog.version}.jar;
rpm -qf ${rpm.install.dir}/signedLib/sfExamples-${smartfrog.version}.jar;
rpm -qf ${rpm.install.dir}/signedLib/sf-anubis-${smartfrog.version}.jar;
rpm -qf 
${rpm.install.dir}/signedLib/sf-loggingservices-${smartfrog.version}.jar;
rpm -qf 
${rpm.install.dir}/signedLib/commons-logging-${commons-logging.version}.jar;
rpm -qf ${rpm.install.dir}/signedLib/log4j-${log4j.version}.jar
"
         outputProperty="rpm.queries.results"/>

where <rootssh> is a presetdef defined operation
     <presetdef name="rootssh">
       <rpmssh
           username="root"
           host="${rpm.ssh.server}"
           passphrase="${rpm.ssh.passphrase}"
           trust="${rpm.ssh.trust}"
           keyfile="${rpm.ssh.keyfile}"
           timeout="${ssh.command.timeout}"
           />
     </presetdef>

..here being used to verify that after uploading and installing various 
RPMs to the virtual linux machine, the code and directories are all 
correctly managed

     <fail>
       <condition>
         <or>
           <contains string="${rpm.queries.results}"
           substring="is not owned by any package"/>
           <contains string="${rpm.queries.results}"
           substring="No such file or directory"/>
         </or>
       </condition>
       One of the directories/files in the RPM is not declared as being 
owned by any RPM.
       This file/directory will not be managed correctly, or have the 
correct permissions
       on a hardened linux.
       ${rpm.queries.results}
     </fail>

Worksforme, as they say :)

-steve



-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message