|
I have a java app I'm trying to setup in hudson and I hit a slight roadblock with the execute shell command.
My app is an ear that runs on jboss, and the junit tests need to run against the deployed app. So I've setup hudson on tomcat and am trying to use the execute shell command to shutdown jboss, followed by an ant task that deploys the app, then a shell command to startup jboss and finally an ant task to run the tests. I can't hotdeploy because we'll eventually run out of permgen space in jboss. Anyhow the shutdown command fails the build if jboss is already down... is there some way to either make it ignore that failure, or force the shutdown script to return a successful exit code? (I'm not well versed in bash scripting). Thanks, Ray --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
|
Usually you can ignote command exit code by
<command> || : Or swap ":" with anything that does nothing but always returns true. About starting and stopping JBoss AS, I have bash scripts for starting/stopping as well ant tasks, as well you can easily use jboss server manager from groovy. Let me know if you are interested in some of the approaches. Ray V wrote, On 12/23/-28158 09:59 PM (EEST): > I have a java app I'm trying to setup in hudson and I hit a slight roadblock with the execute shell command. > > My app is an ear that runs on jboss, and the junit tests need to run against the deployed app. So I've setup hudson on tomcat and am trying to use the execute shell command to shutdown jboss, followed by an ant task that deploys the app, then a shell command to startup jboss and finally an ant task to run the tests. I can't hotdeploy because we'll eventually run out of permgen space in jboss. > > Anyhow the shutdown command fails the build if jboss is already down... is there some way to either make it ignore that failure, or force the shutdown script to return a successful exit code? (I'm not well versed in bash scripting). Thanks, > > Ray > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
|
Thanks for the help, the pipe-to-colon solution works great and the app is building in hudson now. I'm definitely interested in other approaches. Right now I put a sleep in after starting up jboss to avoid the unit tests running before jboss is done with startup, which works but feels brittle.
I also noticed the Deploy plugin after I started down the execute shell path, I might give it a try at some point. --- On Sun, 9/21/08, Aleksandar Kostadinov <[hidden email]> wrote: > From: Aleksandar Kostadinov <[hidden email]> > Subject: Re: using execute shell > To: "Ray V" <[hidden email]> > Cc: [hidden email] > Date: Sunday, September 21, 2008, 10:40 PM > Usually you can ignote command exit code by > > <command> || : > > Or swap ":" with anything that does nothing but > always returns true. > > About starting and stopping JBoss AS, I have bash scripts > for > starting/stopping as well ant tasks, as well you can easily > use jboss > server manager from groovy. Let me know if you are > interested in some of > the approaches. > > Ray V wrote, On 12/23/-28158 09:59 PM (EEST): > > I have a java app I'm trying to setup in hudson > and I hit a slight roadblock with the execute shell command. > > > > My app is an ear that runs on jboss, and the junit > tests need to run against the deployed app. So I've > setup hudson on tomcat and am trying to use the execute > shell command to shutdown jboss, followed by an ant task > that deploys the app, then a shell command to startup jboss > and finally an ant task to run the tests. I can't > hotdeploy because we'll eventually run out of permgen > space in jboss. > > > > Anyhow the shutdown command fails the build if jboss > is already down... is there some way to either make it > ignore that failure, or force the shutdown script to return > a successful exit code? (I'm not well versed in bash > scripting). Thanks, > > > > Ray > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > For additional commands, e-mail: > [hidden email] --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
|
Ray V wrote, On 12/23/-28158 09:59 PM (EEST):
> Thanks for the help, the pipe-to-colon solution "or" colon :) command1 || command2 - command 2 is executed if command 1 fails the exit status is either 0 or what command 2 returns. ":" is "just expand" internal bash command and always returns true. You can use "true" as well given it is almost always present. <...> > I'm definitely interested in other approaches. Attaching the bash scripts. Note that these are intended to run in a Hudson environment expecting some variables. As well check if kill script wont hurt your environment. You should have telnet executable installed on the machine. You can have something like that in your job: kill-jboss start-jboss -b $MYTESTIP_1 -p "$WORKSPACE/jboss-as/server/$SERVER_NAME" -t 260 <deploy and do some testing> stop-jboss -m "S -u admin -p admin" -b $MYTESTIP_1 -p $WORKSPACE/jbosssoa/jboss-as -t 120 > I also noticed the Deploy plugin after I started down the execute shell path, I might give it a try at some point. never used but might help Regards. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
| Powered by Nabble | Edit this page |
