ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fetzer <elstonk...@yahoo.com>
Subject Re: Build directly on machine vs. SSH to machine and start build
Date Tue, 08 May 2012 16:01:12 GMT
Thanks Rob!  So here's what I'm seeing which doesn't make sense to me:
 
bash-3.2$ ssh buildUser@buildMachine
[buildUser@buildMachine] /home/buildUser-> echo $HOSTNAME
buildMachine
[buildUser@buildMachine] /home/buildUser->
 
 
So $HOSTNAME IS already set.  Maybe that's not the issue.  Could it be that I'm outside
of a task when I do this check?
 
<project name="ReportsBuild" default="main" basedir=".">
  <!--Set Host Info-->
  <property environment="env"/>
  <property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>
  <!--Import antcontrib-->
  <taskdef resource="net/sf/antcontrib/antlib.xml"/>
  <taskdef name="unset" classname="ise.antelope.tasks.Unset"/>
  <!--Import properties-->
  <import file="properties.xml" />
  <!--Import this prop file based on what build machine you're on-->
  <if>
    <equals arg1="${env.HOSTNAME}" arg2="buildMachine"/>
    <then>
      <import file="properties_stagefiles.xml" />
    </then>
    <else>
      <import file="properties_stage.xml" />
    </else>
  </if>
 
I guess this strategy, <property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>,
is used to make the script portable.  I really don't care about that aspect of it, this will
be run on unix only.  Could this be clearing the value?  Doesn't seem like it to me unless
the variable was unset first but I don't understand why it's not working.
 
 
Thanks,
Eric


________________________________
From: "Echlin, Robert" <Robert.Echlin@windriver.com>
To: Ant Users List <user@ant.apache.org> 
Sent: Tuesday, May 8, 2012 8:59 AM
Subject: RE: Build directly on machine vs. SSH to machine and start build

Hi Eric,
Since builduser has bash as the default shell, you will be in the bash shell.

You can do some testing. Remember that you can probably run ssh from the host.
  ssh -f builduser@buildMachine "echo Computername is set to: $COMPUTERNAME"

I think the script is assuming that HOSTNAME is already set on Linux boxes.
Put the following 5 lines in a script file on your host - I took most of it from your command
line.

#!/bin/bash
. ~/.bash_profile
export HOSTNAME=`hostname`
cd /app/rosstr/build
/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8


I have made a couple of assumptions here. Make sure that you get the machine name from:
  ssh -f builduser@buildMachine hostname

Line 3 sets the HOSTNAME variable, which should work. If not, try setting COMPUTERNAME.
You need to make the script executable - just in case you don't know, if the script is called
"ant.start", the command would be:
  chmod a+x ant.start

And you would run it with:
  ssh -f builduser@buildMachine ant.start

Hope this helps,
Rob


-----Original Message-----
From: Eric Fetzer [mailto:elstonkers@yahoo.com] 
Sent: Tuesday, May 08, 2012 10:10 AM
To: Ant Users List
Cc: Ant Users List
Subject: Re: Build directly on machine vs. SSH to machine and start build

Bash is this user's default shell.



On May 8, 2012, at 9:41 AM, Eric Fetzer <elstonkers@yahoo.com> wrote:

> Robert,
> 
> Notice in my command:
> 
>>>> ssh -f builduser@buildMachine ". ~/.bash_profile;cd /app/rosstr/build;/opt/apache-ant-1.7.1/bin/ant
-f build.xml -Dfull.buildnumber=3.0.2.8
> 
> that I'm sourcing my bash profile, which also runs .bashrc.  Will this not switch me
to the bash shell.  I typed in here that I bash, but that's just a habit because many of
the users I log onto systems with don't have bash as the default shell.  I'll check this
one.  If not, do you think changing his default would fix this?
> 
> Thanks,
> Eric
> 
> 
> 
> On May 8, 2012, at 9:13 AM, "Echlin, Robert" <Robert.Echlin@windriver.com> wrote:
> 
>> Dfull.buildnumber=3.0.2.8

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


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message