Hi

I've added this and now the rake task fails as expected. Thank you for
the help.

As a side note, the file I modified was the stock rake.bat from the
ruby 1.9.1 distribution, so I think this problem applies to most rake
users.

Honestly I don't fully understand why this solution worked. I had the
idea of adding such line when I looked at the rake.bat file
previously, but I rejected it as it seemed silly to me. I guess this
has something to do with the "exit batch" vs "exit process" thing that
Per-Jonny Käck described earlier in the thread.

Again, thanks for help.

Regards,
Michal Dabrowski

On Mar 24, 12:41 pm, Ruben Willems <[email protected]> wrote:
> Hi
>
> it is best to place this in a bat file
> and at the end, you place exit %ERRORLEVEL%
>
> that should help
>
> with kind regards
> Ruben Willems
>
> On Tue, Mar 24, 2009 at 12:37 PM, Michal Dabrowski <
>
> [email protected]> wrote:
>
> > Hi
>
> > I've just noticed that while checking this bat file issue, I made
> > mistake and put the task into wrong project. Now after fixing this I
> > confirm that ccnet correctly stops (ie. reports failed build) when the
> > bat fails (no matter if the batch contains "exit 1" or "exit /b 1").
> > I'm sorry for the confusion.
>
> > Regardless of this however, rake task (and also exec task that invokes
> > the rake.bat) still reports success even if the rake aborts
> > prematurely because of compilation error.
>
> > Also, I have the following prebuild task:
>
> >        <prebuild>
> >                <exec>
> >                        <executable>c:\windows\system32\cmd.exe</executable>
> >                        <buildArgs>/C "rd /S /Q svn"</buildArgs>
> >                </exec>
> >        </prebuild>
>
> > that always "passes" (ie. even if the command fails, ccnet ignores
> > this fact and continues). I'm convinced that this worked like expected
> > (ie. failed command = failed build) before the upgrade to 1.4.3.
>
> > Regards,
> > Michal Dabrowski
>
> > On Mar 24, 11:04 am, Ruben Willems <[email protected]> wrote:
> > > Hi
>
> > > I'll check this, ...
>
> > > with kind regards
> > > Ruben Willems
>
> > > On Tue, Mar 24, 2009 at 10:35 AM, Michal Dabrowski <
>
> > > [email protected]> wrote:
>
> > > > Hi
>
> > > > Thanks for your answer. I've just performed very similar test, but
> > > > with bat file instead of an exe. The batch consists solely of the
> > > > following line:
>
> > > > exit /b 1
>
> > > > I've configured the cc.net to execute this script as the first
> > > > prebuild task with:
>
> > > >  <prebuild>
> > > >    <exec>
> > > >      <executable>d:\michald\scr.bat</executable>
> > > >    </exec>
> > > >    ...................
> > > >  </prebuild>
>
> > > > And the cc.net just ignores this error and proceeds with next tasks. I
> > > > can only add that before upgrade to 1.4.3 this worked as expected, ie.
> > > > the builds were reported as broken.
>
> > > > Does anyone experience similar problem?
>
> > > > Regards,
> > > > Michal Dabrowski
>
> > > > On Mar 19, 3:18 pm, Ruben Willems <[email protected]> wrote:
> > > > > Hi
>
> > > > > CCNet's exec task is ok, I just tested it again
> > > > > with the following test programs (2 console programs):
>
> > > > > consok
> > > > > code in the main
> > > > >    Environment.ExitCode == 0;
>
> > > > > consNotOk
> > > > > code in the main
> > > > >    Environment.ExitCode == 1;
>
> > > > > and when I placed these in CCNet, the build was OK for consok
> > > > > and the build failed for consNotOk
>
> > > > > So there must be a problem with your config, or the tasks really fail
>
> > > > > with kind regards
> > > > > Ruben Willems
>
> > > > > On Thu, Mar 19, 2009 at 2:32 PM, Michal Dabrowski <
>
> > > > > [email protected]> wrote:
>
> > > > > > Hi,
>
> > > > > > yesterday I've updated my CCNet to 1.4.3. Today I've noticed that
> > > > > > CCNet no longer recognizes failures of exec tasks. This actually
> > > > > > applies to <exec> and <rake> tasks. Every build is successful, even
> > if
> > > > > > the rake aborts or the exec tasks fail. Most of my CCNet
> > configuration
> > > > > > remained the same as before the upgrade (after upgrade I've only
> > > > > > replaced msbuild with rake, but these mentioned exec tasks weren't
> > > > > > touched at all). Did anyone else encounter such behavior?
>
> > > > > > Regards,
> > > > > > Michal Dabrowski

Reply via email to