Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 11523 invoked from network); 28 Jul 2006 15:53:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jul 2006 15:53:01 -0000 Received: (qmail 6276 invoked by uid 500); 28 Jul 2006 15:52:58 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 6209 invoked by uid 500); 28 Jul 2006 15:52:58 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 6039 invoked by uid 99); 28 Jul 2006 15:52:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jul 2006 08:52:56 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of myspamb8@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jul 2006 08:52:54 -0700 Received: by nf-out-0910.google.com with SMTP id x29so133149nfb for ; Fri, 28 Jul 2006 08:52:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=MfAq57nfBiPTAd97T1tsVNn4eGdW1OokN7epQ1lEnVsX0Qdnxms/CVsCHA+qsMJCqu2ugimdmBclPsAx8oiCHhkXT8pqm2uAW7UKH0Xqzfx5rlPaVAP8ezohg2Ro48me5mKQ1OZJGg8VdK1QLNh0dMjdpIk9Twx+astOfgjHFs0= Received: by 10.48.235.13 with SMTP id i13mr930129nfh; Fri, 28 Jul 2006 08:52:33 -0700 (PDT) Received: by 10.49.32.2 with HTTP; Fri, 28 Jul 2006 08:52:33 -0700 (PDT) Message-ID: Date: Fri, 28 Jul 2006 11:52:33 -0400 From: "Jamie Jackson" To: "Ant Users List" Subject: Re: Trying to do things the "Ant way" In-Reply-To: <98c2b60d0607280831j6abf9607pfb1d73e60e40696f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14403_9331859.1154101953094" References: <98c2b60d0607280830sd84ff79u2c0d0af4c714922@mail.gmail.com> <98c2b60d0607280831j6abf9607pfb1d73e60e40696f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_14403_9331859.1154101953094 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks for the quick response. I have a couple of follow-ups. I've gotten the impression from reading other posts that is to be avoided, so I'm wondering about its use here. The other question I have is: How would I satisfy the deploy-all use case while reusing as much of the script as practical? Thanks again, Jamie On 7/28/06, Andrew Goktepe wrote: > > Oops. s/ > On 7/28/06, Andrew Goktepe wrote: > > > > We use a separate properties file for each environment, and have common > > property names. Instead of integ.transfertype, stage.transfertype, etc, > I > > would just have 'transfertype' and it would have different values in the > > different files. Then the Ant script has targets based on the possible > > values of the property, and one generic parent target that calls them. > > > > Example: > > > > > > > > > > ... > > ... > > > > envname determines which environment-specific properties file needs to > be > > read. > > > > This is a more scalable solution. Adding a new environment is as simple > as > > creating a new properties file. > > > > This assumes the build has already occurred and you can make run the > > deployment Ant script separately for each environment. > > > > -Andrew > > > > On 7/28/06, Jamie Jackson wrote: > > > > > > I'm having a problem trying to grok the "ant way" to do things (i.e., > > > without conditionals). I just got started with Ant a couple days ago, > so > > > > > > take that into consideration. > > > > > > I'm trying to produce a well-factored script to handle code deployment > > > to > > > remote servers. > > > > > > Tasks: > > > * deploy-integ > > > * deploy-stage > > > * deploy-prod > > > * deploy-all (all of the above) > > > > > > Here's the problem: Depending on the set of servers, some are > available > > > via > > > SSH, others are available via NFS, and I'd like the script to be > > > generalizable enough to specify the transfer type in the properties > > > file, > > > along with the (potentially) varying paths among servers. > > > > > > Here's a stab at the properties file: > > > ----------------------------------- > > > svn.url=http://myhost/myrepos/myproj > > > > > > integ.transfertype=nfs > > > stage.transfertype=ssh > > > prod.transfertype=ssh > > > > > > # a nfs basepath would look like //webdev/websites > > > # an ssh basepath would look like username@hostname:/path/to/docroot > > > integ.basepath=//devserver/docroot > > > stage.basepath=username@hostname :/path/to/docroot > > > prod.basepath=username@hostname:/path/to/docroot > > > > > > integ.proj.wwwroot=childwelfare > > > stage.proj.wwwroot=childwelfare > > > prod.proj.wwwroot=childwelfare > > > --------------------------------- > > > > > > Here are a couple of the salient tasks (see inline comments): > > > > > > > > > > > transfertype="integ.transfertype" /> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > What's the right approach? > > > > > > Thanks, > > > Jamie > > > > > > > > > > ------=_Part_14403_9331859.1154101953094--