ANT and SSH

Author: Kasper B. Graversen, 08/12/07
Keywords: ANT, Build script, SSH
Abstract: ANT is able to significantly reduce the time you spend on distributing your application. This is especially true if your application needs distributing on on multiple servers. This guide explains how to automate uploading files using SSH through ANT.
subscribe to my RSS feed


Bookmark and Share


ANT and SSH

Ant has been extended to be able to send files to servers over SSH. This may significantly reduce the time it takes you to distribute your applications, documents, etc. Before you can have ANT do your repetitive SSH upload work, you first need to install an additional jar file from foosite. Download the jar file and place it in your ant-install/lib/ dir.

The following script takes care of the distribution.
<property name="site1.release"
    value="${user}:${password}@www.foo.com:/usr/local/webserver/webapps/foo"/>
...

<target name="copy-online" depends="make_jar">
    <scp todir="${site1.release}/"  trust="yes" >
        <fileset dir="${dir.dst}" >
            <include name="**/*.jar"/>
        </fileset>
    </scp>
</target>



Comments

If you have any comments to this article, please drop me a mail at firstclassthoughts at gmail dot com please indicate if I can't publish whole or parts of your comment on the site.


If you like this site consider subscribing to my RSS feed or how about subscribing by Email.


Help spread the word

Share this post on your favorite social bookmarking sites:
If you enjoyed this article, found it thought provoking, educative or otherwise good, please link to this page from your page or social bookmarking page. If you have any texts you think are worth publishing on First Class Thoughts, don't hesitate to send me a mail! Quality always welcome.


Bookmark and Share


The most recent contributions
28/07/09 Magic in mathematics II Fun with the number cyclic numbers, and specifically with 142857 as it is the smallest of such numbers.
13/07/09 My top 8 time-saving Firefox shortcuts This article presents my favorite top 8 time-saving shortcuts in Firefox 3.0 and Firefox 3.5. Get to know these and you'll be saving a lot of time. They have been ordered by "the element of most surprise"
20/05/09 Board Game Jungle speed / Arriba Review of the cool game "Jungle Speed" aka. "Arriba".
16/05/09 Danish Twin words "Twin words" are words that not only have multiple meanings, they must be composed next to each other in meaningful sentences. This article explores the concept of twin words.
Nothing of interest? Try browsing the entire article archive...