You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Fetzer <el...@yahoo.com> on 2012/05/07 21:12:01 UTC
Build directly on machine vs. SSH to machine and start build
This is very strange to me. Here are the 2 scenarios.
Scenario 1:
1) Log on to buildMachine as user builduser
2) >bash
3) >cd /my/builddir
3) >/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8
4) Build succeeds without issue
Scenario 2:
1) From a different machine:
>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
2) There are 7 different apps that get built in the build.xml file. Each get called by the ant task. Only one of them fails with no indication as to why it failed.
I've tried loads of stuff. I echo just before it hits the ant call and the echo outputs. I've retyped the ant line several times without success. I've changed the order of this particular ant call and it doesn't matter, it fails when it gets to it. Here's the code that crashes:
<ant antfile="BuildReports.xml"/>
Not exactly a tough thing to do. Call the BuildReports.xml file in the current directory... Anyone have any idea what this could be or what I could do to debug this? There is no verbose=true on the ant task...
Thanks,
Eric
RE: Build directly on machine vs. SSH to machine and start build
Posted by "Echlin, Robert" <Ro...@windriver.com>.
Hi Eric,
Sorry, I have been away from this list for a few days.
Did you get that fixed/worked around yet?
A)
I see you are loading the "unset" task from Antelope.
What happens if you don't load it?
Is that task used in any of the xml files you are importing?
B)
the code below works for me on Windows - results first. I think this is the results you wanted?
- the "HOSTNAME" was not set before I started, so the "COMPUTERNAME" was used.
- after the HOSTNAME was set the output came from the other property file.
--- OUTPUT: ---------
C:\tools\personal\ant-test>ant
Buildfile: C:\tools\personal\ant-test\build.xml
main:
[echo] from files: stagefiles
BUILD SUCCESSFUL
Total time: 0 seconds
C:\tools\personal\ant-test>set HOSTNAME=me
C:\tools\personal\ant-test>ant
Buildfile: C:\tools\personal\ant-test\build.xml
main:
[echo] from files: stage
BUILD SUCCESSFUL
Total time: 0 seconds
------ END OUTPUT ---------
My code is below.
Your code did not work for me.
Maybe you have a file "antlib.xml" in the path named?
- I am using different code than you are to load the ant contrib.
- My path to the code is split into two pieces. Fix for your own location.
- The filename I am using for the jar file may also not work for you.
On a different note, I normally store properties in properties files, not XML code.
--- code to load properties from a file ---
<property file="${TOOLS_HOME}/build/common.properties"/>
--- content of a properties file (# marks a comment line) ---
# directories
directories.stuff = ${ TOOLS _HOME}/Tools/stuff
directories.stuff-frameworks = ${ TOOLS _HOME}/Tools/Oxygen/frameworks
--- end properties file ---
--- Start code from build.xml ---
<project name="ReportsBuild" default="main" basedir=".">
<!--Set Host Info-->
<property environment="env"/>
<property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>
<property name="TOOLS_HOME" value="/svn/TechPubs-trunk"/>
<!--Import antcontrib-->
<taskdef resource="net/sf/antcontrib/antlib.xml" >
<classpath>
<fileset dir="${TOOLS_HOME}/Tools/ant-contrib-1.0b3">
<include name="ant-contrib-1.0b3.jar"/>
</fileset>
</classpath>
</taskdef>
<if>
<equals arg1="${env.HOSTNAME}" arg2="YOW-RECHLIN-L1"/>
<then>
<import file="properties_stagefiles.xml" />
</then>
<else>
<import file="properties_stage.xml" />
</else>
</if>
<target name="main">
<echo message="from files: ${stage}"/>
</target>
</project>
--- end build.xml ---
--- start properties_stagefiles.xml ---
<project>
<property name="stage" value=" stagefiles "/>
</project>
--- end properties_ stagefiles.xml ---
--- start properties_stage.xml ---
<project>
<property name="stage" value="stage"/>
</project>
--- end properties_stage.xml ---
Rob
-----Original Message-----
From: Eric Fetzer [mailto:elstonkers@yahoo.com]
Sent: Tuesday, May 08, 2012 12:01 PM
To: Ant Users List
Subject: Re: Build directly on machine vs. SSH to machine and start build
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Build directly on machine vs. SSH to machine and start build
Posted by Eric Fetzer <el...@yahoo.com>.
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" <Ro...@windriver.com>
To: Ant Users List <us...@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 <el...@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" <Ro...@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
RE: Build directly on machine vs. SSH to machine and start build
Posted by "Echlin, Robert" <Ro...@windriver.com>.
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 <el...@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" <Ro...@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
Re: Build directly on machine vs. SSH to machine and start build
Posted by Eric Fetzer <el...@yahoo.com>.
Bash is this user's default shell.
On May 8, 2012, at 9:41 AM, Eric Fetzer <el...@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" <Ro...@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
Re: Build directly on machine vs. SSH to machine and start build
Posted by Eric Fetzer <el...@yahoo.com>.
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" <Ro...@windriver.com> wrote:
> Dfull.buildnumber=3.0.2.8
RE: Build directly on machine vs. SSH to machine and start build
Posted by "Echlin, Robert" <Ro...@windriver.com>.
Hi Eric,
In *nix shells, your shell will load one or more of several different startup files.
Which one is loaded by bash depends on what type of a process you are running the script as.
One file is run only when you are logging in (bash runs ".bash_profile", or, if it is not present, ".profile").
The login environment should also run "/etc/profile" for you when you login.
Your system doesn't seem to be running bash when you ssh in to run a script. That's why you have to run "bash" when you login.
It may be running sh, ksh, csh or something else, in which case the startup files used will have different names.
You also should look at ".bashrc", which is run by every command that is started up by the system. In fact, it may be run by the system for your script when you ssh in to run a command. ".bashrc" probably runs "/etc/rc" as well.
Example page from googling for "bash startup files":
- http://www.linuxfromscratch.org/blfs/view/6.3/postlfs/profile.html
Simon has a good idea - run the specific commands you need when you run a script over ssh.
Because of my experience with bash, I would write a bash script to set up the environment and then call ant from that script, but you can certainly do it in ant.
Rob
-----Original Message-----
From: Eric Fetzer [mailto:elstonkers@yahoo.com]
Sent: Monday, May 07, 2012 6:17 PM
To: Ant Users List
Cc: Ant Users List
Subject: Re: Build directly on machine vs. SSH to machine and start build
Thanks Simon! I can work with that...
On May 7, 2012, at 5:41 PM, Simon Murcott <si...@flaxx.net> wrote:
> I ended up writing a custom ant task to do this. Unfortunately in both *nix and windows you can't always rely on environment variables. On *nix you need to read the output of /bin/hostname or on windows read the output of WScript.Network.ComputerName
>
>
> Regards, Simon
>
> On 8/05/2012, at 8:28 AM, Eric Fetzer <el...@yahoo.com> wrote:
>
>> Thanks Nathan, very helpful. This is at the top of my build file:
>>
>> <property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>
>>
>> When running with -v, I get this:
>>
>> [property] Loading Environment env.
>> Property "env.COMPUTERNAME" has not been set
>>
>> And then the code below tries to import a property file that doesn't exist:
>>
>> <if>
>> <equals arg1="${env.HOSTNAME}" arg2="buildMachine"/>
>> <then>
>> <import file="properties1.xml" />
>> </then>
>> <else>
>> <import file="properties2.xml" />
>> </else>
>> </if>
>>
>> Anyone know of a way to make this work from an ssh call? Seems like it would be fine because even when I'm running this from a manual login, it's after sshing from my own machine to this build machine...
>>
>> Thanks,
>> Eric
>>
>>
>> ________________________________
>> From: "Perrier, Nathan" <np...@ptc.com>
>> To: Ant Users List <us...@ant.apache.org>; Eric Fetzer <el...@yahoo.com>
>> Sent: Monday, May 7, 2012 1:17 PM
>> Subject: RE: Build directly on machine vs. SSH to machine and start build
>>
>> Add -v in your call (or -debug):
>>
>> ant [-v|-d] -f build.xml
>>
>> -----Original Message-----
>> From: Eric Fetzer [mailto:elstonkers@yahoo.com]
>> Sent: Monday, May 07, 2012 2:12 PM
>> To: Ant Users
>> Subject: Build directly on machine vs. SSH to machine and start build
>>
>> This is very strange to me. Here are the 2 scenarios.
>>
>> Scenario 1:
>> 1) Log on to buildMachine as user builduser
>> 2) >bash
>> 3) >cd /my/builddir
>> 3) >/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8
>> 4) Build succeeds without issue
>>
>> Scenario 2:
>> 1) From a different machine:
>>> 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
>> 2) There are 7 different apps that get built in the build.xml file. Each get called by the ant task. Only one of them fails with no indication as to why it failed.
>>
>> I've tried loads of stuff. I echo just before it hits the ant call and the echo outputs. I've retyped the ant line several times without success. I've changed the order of this particular ant call and it doesn't matter, it fails when it gets to it. Here's the code that crashes:
>>
>> <ant antfile="BuildReports.xml"/>
>>
>> Not exactly a tough thing to do. Call the BuildReports.xml file in the current directory... Anyone have any idea what this could be or what I could do to debug this? There is no verbose=true on the ant task...
>>
>> Thanks,
>> Eric
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Build directly on machine vs. SSH to machine and start build
Posted by Eric Fetzer <el...@yahoo.com>.
Thanks Simon! I can work with that...
On May 7, 2012, at 5:41 PM, Simon Murcott <si...@flaxx.net> wrote:
> I ended up writing a custom ant task to do this. Unfortunately in both *nix and windows you can't always rely on environment variables. On *nix you need to read the output of /bin/hostname or on windows read the output of WScript.Network.ComputerName
>
>
> Regards, Simon
>
> On 8/05/2012, at 8:28 AM, Eric Fetzer <el...@yahoo.com> wrote:
>
>> Thanks Nathan, very helpful. This is at the top of my build file:
>>
>> <property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>
>>
>> When running with -v, I get this:
>>
>> [property] Loading Environment env.
>> Property "env.COMPUTERNAME" has not been set
>>
>> And then the code below tries to import a property file that doesn't exist:
>>
>> <if>
>> <equals arg1="${env.HOSTNAME}" arg2="buildMachine"/>
>> <then>
>> <import file="properties1.xml" />
>> </then>
>> <else>
>> <import file="properties2.xml" />
>> </else>
>> </if>
>>
>> Anyone know of a way to make this work from an ssh call? Seems like it would be fine because even when I'm running this from a manual login, it's after sshing from my own machine to this build machine...
>>
>> Thanks,
>> Eric
>>
>>
>> ________________________________
>> From: "Perrier, Nathan" <np...@ptc.com>
>> To: Ant Users List <us...@ant.apache.org>; Eric Fetzer <el...@yahoo.com>
>> Sent: Monday, May 7, 2012 1:17 PM
>> Subject: RE: Build directly on machine vs. SSH to machine and start build
>>
>> Add -v in your call (or -debug):
>>
>> ant [-v|-d] -f build.xml
>>
>> -----Original Message-----
>> From: Eric Fetzer [mailto:elstonkers@yahoo.com]
>> Sent: Monday, May 07, 2012 2:12 PM
>> To: Ant Users
>> Subject: Build directly on machine vs. SSH to machine and start build
>>
>> This is very strange to me. Here are the 2 scenarios.
>>
>> Scenario 1:
>> 1) Log on to buildMachine as user builduser
>> 2) >bash
>> 3) >cd /my/builddir
>> 3) >/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8
>> 4) Build succeeds without issue
>>
>> Scenario 2:
>> 1) From a different machine:
>>> 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
>> 2) There are 7 different apps that get built in the build.xml file. Each get called by the ant task. Only one of them fails with no indication as to why it failed.
>>
>> I've tried loads of stuff. I echo just before it hits the ant call and the echo outputs. I've retyped the ant line several times without success. I've changed the order of this particular ant call and it doesn't matter, it fails when it gets to it. Here's the code that crashes:
>>
>> <ant antfile="BuildReports.xml"/>
>>
>> Not exactly a tough thing to do. Call the BuildReports.xml file in the current directory... Anyone have any idea what this could be or what I could do to debug this? There is no verbose=true on the ant task...
>>
>> Thanks,
>> Eric
>
> ---------------------------------------------------------------------
> 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
Re: Build directly on machine vs. SSH to machine and start build
Posted by Simon Murcott <si...@flaxx.net>.
I ended up writing a custom ant task to do this. Unfortunately in both *nix and windows you can't always rely on environment variables. On *nix you need to read the output of /bin/hostname or on windows read the output of WScript.Network.ComputerName
Regards, Simon
On 8/05/2012, at 8:28 AM, Eric Fetzer <el...@yahoo.com> wrote:
> Thanks Nathan, very helpful. This is at the top of my build file:
>
> <property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>
>
> When running with -v, I get this:
>
> [property] Loading Environment env.
> Property "env.COMPUTERNAME" has not been set
>
> And then the code below tries to import a property file that doesn't exist:
>
> <if>
> <equals arg1="${env.HOSTNAME}" arg2="buildMachine"/>
> <then>
> <import file="properties1.xml" />
> </then>
> <else>
> <import file="properties2.xml" />
> </else>
> </if>
>
> Anyone know of a way to make this work from an ssh call? Seems like it would be fine because even when I'm running this from a manual login, it's after sshing from my own machine to this build machine...
>
> Thanks,
> Eric
>
>
> ________________________________
> From: "Perrier, Nathan" <np...@ptc.com>
> To: Ant Users List <us...@ant.apache.org>; Eric Fetzer <el...@yahoo.com>
> Sent: Monday, May 7, 2012 1:17 PM
> Subject: RE: Build directly on machine vs. SSH to machine and start build
>
> Add -v in your call (or -debug):
>
> ant [-v|-d] -f build.xml
>
> -----Original Message-----
> From: Eric Fetzer [mailto:elstonkers@yahoo.com]
> Sent: Monday, May 07, 2012 2:12 PM
> To: Ant Users
> Subject: Build directly on machine vs. SSH to machine and start build
>
> This is very strange to me. Here are the 2 scenarios.
>
> Scenario 1:
> 1) Log on to buildMachine as user builduser
> 2) >bash
> 3) >cd /my/builddir
> 3) >/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8
> 4) Build succeeds without issue
>
> Scenario 2:
> 1) From a different machine:
> >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
> 2) There are 7 different apps that get built in the build.xml file. Each get called by the ant task. Only one of them fails with no indication as to why it failed.
>
> I've tried loads of stuff. I echo just before it hits the ant call and the echo outputs. I've retyped the ant line several times without success. I've changed the order of this particular ant call and it doesn't matter, it fails when it gets to it. Here's the code that crashes:
>
> <ant antfile="BuildReports.xml"/>
>
> Not exactly a tough thing to do. Call the BuildReports.xml file in the current directory... Anyone have any idea what this could be or what I could do to debug this? There is no verbose=true on the ant task...
>
> Thanks,
> Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Build directly on machine vs. SSH to machine and start build
Posted by Eric Fetzer <el...@yahoo.com>.
Thanks Nathan, very helpful. This is at the top of my build file:
<property name="env.HOSTNAME" value="${env.COMPUTERNAME}"/>
When running with -v, I get this:
[property] Loading Environment env.
Property "env.COMPUTERNAME" has not been set
And then the code below tries to import a property file that doesn't exist:
<if>
<equals arg1="${env.HOSTNAME}" arg2="buildMachine"/>
<then>
<import file="properties1.xml" />
</then>
<else>
<import file="properties2.xml" />
</else>
</if>
Anyone know of a way to make this work from an ssh call? Seems like it would be fine because even when I'm running this from a manual login, it's after sshing from my own machine to this build machine...
Thanks,
Eric
________________________________
From: "Perrier, Nathan" <np...@ptc.com>
To: Ant Users List <us...@ant.apache.org>; Eric Fetzer <el...@yahoo.com>
Sent: Monday, May 7, 2012 1:17 PM
Subject: RE: Build directly on machine vs. SSH to machine and start build
Add -v in your call (or -debug):
ant [-v|-d] -f build.xml
-----Original Message-----
From: Eric Fetzer [mailto:elstonkers@yahoo.com]
Sent: Monday, May 07, 2012 2:12 PM
To: Ant Users
Subject: Build directly on machine vs. SSH to machine and start build
This is very strange to me. Here are the 2 scenarios.
Scenario 1:
1) Log on to buildMachine as user builduser
2) >bash
3) >cd /my/builddir
3) >/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8
4) Build succeeds without issue
Scenario 2:
1) From a different machine:
>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
2) There are 7 different apps that get built in the build.xml file. Each get called by the ant task. Only one of them fails with no indication as to why it failed.
I've tried loads of stuff. I echo just before it hits the ant call and the echo outputs. I've retyped the ant line several times without success. I've changed the order of this particular ant call and it doesn't matter, it fails when it gets to it. Here's the code that crashes:
<ant antfile="BuildReports.xml"/>
Not exactly a tough thing to do. Call the BuildReports.xml file in the current directory... Anyone have any idea what this could be or what I could do to debug this? There is no verbose=true on the ant task...
Thanks,
Eric
RE: Build directly on machine vs. SSH to machine and start build
Posted by "Perrier, Nathan" <np...@ptc.com>.
Add -v in your call (or -debug):
ant [-v|-d] -f build.xml
-----Original Message-----
From: Eric Fetzer [mailto:elstonkers@yahoo.com]
Sent: Monday, May 07, 2012 2:12 PM
To: Ant Users
Subject: Build directly on machine vs. SSH to machine and start build
This is very strange to me. Here are the 2 scenarios.
Scenario 1:
1) Log on to buildMachine as user builduser
2) >bash
3) >cd /my/builddir
3) >/opt/apache-ant-1.7.1/bin/ant -f build.xml -Dfull.buildnumber=3.0.2.8
4) Build succeeds without issue
Scenario 2:
1) From a different machine:
>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
2) There are 7 different apps that get built in the build.xml file. Each get called by the ant task. Only one of them fails with no indication as to why it failed.
I've tried loads of stuff. I echo just before it hits the ant call and the echo outputs. I've retyped the ant line several times without success. I've changed the order of this particular ant call and it doesn't matter, it fails when it gets to it. Here's the code that crashes:
<ant antfile="BuildReports.xml"/>
Not exactly a tough thing to do. Call the BuildReports.xml file in the current directory... Anyone have any idea what this could be or what I could do to debug this? There is no verbose=true on the ant task...
Thanks,
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org