[Anthill-pro] Accessing properties inside shell builder

Eric Minick etm at urbancode.com
Wed Feb 3 17:24:37 CST 2010


So you can inline those things and end up with a shell builder step that
looks like:

cd someDir
mycommand -webserver=${bsh:PropertyLookup.get("key")} -a -b -c
....


On Wed, Feb 3, 2010 at 2:43 PM, Anderson, Eric <
eric.anderson at wellsfargoadvisors.com> wrote:

> Well, there's a few different ways:
>
> ${bsh:PropertyLookup.get("key")}
>
> ${property:key}
>
> Or (in 3.7 or above)
>
> ${bsh:PropertyLookup.getValueOrEmpty("key")}  (useful for optional
> arguments)
>
> -----Original Message-----
> From: anthill-pro-bounces at lists.urbancode.com [mailto:
> anthill-pro-bounces at lists.urbancode.com] On Behalf Of Prashant Prabhudesai
> (pprabhud)
> Sent: Wednesday, February 03, 2010 2:36 PM
> To: AnthillPro user and support list.; rws at urbancode.com
> Subject: RE: [Anthill-pro] Accessing properties inside shell builder
>
> > So the shell builder step itself need only reference the build request
> property
>
> How do I access the build request property inside the shell builder.
>
> Thanks,
> Prashant.
>
>
> > -----Original Message-----
> > From: anthill-pro-bounces at lists.urbancode.com
> [mailto:anthill-pro-bounces at lists.urbancode.com] On
> > Behalf Of Anderson, Eric
> > Sent: Wednesday, February 03, 2010 2:08 PM
> > To: 'rws at urbancode.com'; anthill-pro at lists.urbancode.com
> > Subject: RE: [Anthill-pro] Accessing properties inside shell builder
> >
> > Another way that we have done this while using one shell builder step
> is to have an evaluate script
> > step that will set a build request property, the value of which is
> based upon the agent's operating
> > system.
> >
> > We obtain the agent's operating system with:
> >
> > AgentVarHelper.getCurrentAgentVar("sys/os.name");
> >
> > The build request property is set with:
> >
> > PropertyLookup.set(String key, String value)
> >
> > Where the value is determined based on the os.name value retrieved
> above.
> >
> > So the shell builder step itself need only reference the build request
> property, which is already set
> > to the correct value for the agent's operating system.
> >
> > Eric
> >
> > -----Original Message-----
> > From: anthill-pro-bounces at lists.urbancode.com
> [mailto:anthill-pro-bounces at lists.urbancode.com] On
> > Behalf Of Ryan Smith
> > Sent: Wednesday, February 03, 2010 1:49 PM
> > To: anthill-pro at lists.urbancode.com
> > Subject: Re: [Anthill-pro] Accessing properties inside shell builder
> >
> > One way to do this would be to write two separate shell steps and use
> > step pre-condition that run or do not run the step based on the
> property.
> >
> > Ryan
> >
> > On 2/3/10 2:40 PM, Prashant Prabhudesai (pprabhud) wrote:
> > > Hi,
> > >
> > >
> > >
> > > Is there a way I can do different things based on a property inside
> a
> > > shell builder. I want to execute a different command based on a
> > > property's value.
> > >
> > >
> > >
> > > For example, I have 2 build objects that I am compressing using a
> shell
> > > builder. One is for a Windows platform and the other is for a Linux
> > > platform. I want to use WinZip to compress the Windows one and gzip
> to
> > > compress the Linux one. I am running this as an iteration and have a
> > > property set for each of the iterations to identify the build object
> in
> > > question. How can I switch using this property between WinZip and
> gzip
> > > inside the shell builder.
> > >
> > >
> > >
> > > Thanks.
> > >
> > >
> > >
> > > _______________________________________________
> > > Anthill-pro mailing list
> > > Anthill-pro at lists.urbancode.com
> > > http://lists.urbancode.com/mailman/listinfo/anthill-pro
> > >
> > >
> > _______________________________________________
> > Anthill-pro mailing list
> > Anthill-pro at lists.urbancode.com
> > http://lists.urbancode.com/mailman/listinfo/anthill-pro
> > _______________________________________________
> > Anthill-pro mailing list
> > Anthill-pro at lists.urbancode.com
> > http://lists.urbancode.com/mailman/listinfo/anthill-pro
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>


More information about the Anthill-pro mailing list