Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Build Forge fail results in 0?

Hello, everyone.  I'm trying to minimize my number of steps in my build forge projects and I've come across a problem.  If I have a statement that tries to perform an action, i.e copy B to A , but B doesn't exist I get an error and the step fails like expected.  However, if I have another command after that one and it performs correctly then the step passes.

What I would like to have happen is when there is an error or a failure that would normally produce a result of something other than 0 I want the whole step/project to fail out.

I've looked into setting/checking the %errorlevel% variable but I can't seem to make that work.  Truthfully I don't know if that's not working or the ability to tell build forge to quit if the error level neq 0.

Sample Code:

:DEV
If $TARGET_ENVIRONMENT == Development (
cd d:\bld\$BF_PROJECTNAME\$BF_TAG\$SVN_RELEASENUMBER\$TARGET_IISVIRTUALDIR
del Web.config
copy WebDev.config Web.config
)
:QA
If $TARGET_ENVIRONMENT == QA (
cd d:\bld\$BF_PROJECTNAME\$BF_TAG\$SVN_RELEASENUMBER\$TARGET_IISVIRTUALDIR
del Web.config
copy WebQA.config Web.config
)

So, if the TARGET_ENVIRONMENT = Development and it goes through that process, if webdev.config doesn't exist it produces an error, but then the QA value is checked and it resets the errorlevel back to 0, regardless of the equality.

0 votes



One answer

Permanent link
I figured out a way around this.  I'm using Log Filters in Build Forge to parse through the step and check for errors and set fail based on that instead of the exit code.  It's not the cleanest way and involves a lot more work on my part, but it works and actually makes the log a lot easier to read for the users.

1 vote

Comments

I'm glad you were able to get a solution that works for you, but in general, it a better practice to make the steps as atomic as possible.  This allows for more modularity and will also benefit you if you need to restart the build.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020

Question asked: Nov 20 '12, 1:41 p.m.

Question was seen: 5,747 times

Last updated: Nov 27 '12, 12:55 p.m.

Confirmation Cancel Confirm