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

How to test multiple conditions on a conditional step?

I have a step that i want to run on a very specific scenario. For that, I'd need to test 3 environment variables. 
$var1=value1
$var2=value2
$var3=value3

I'm trying to avoid chaining 3 projects.

I've read this article:( http://www-01.ibm.com/support/docview.wss?uid=swg21410161 ) but it's not clear if i can run these commands on the inside the Condition or the Command Box.

So I figured I'd ask you guys whats the best practice for this kind of situation.
The Build Forge versionis 7.1.3.2
Thanks!

0 votes



2 answers

Permanent link
 use multiple conditional steps to do a multi-stage evaluation of your complex conditional.  In each conditional step, .bset a variable to a value you'll test later.  

0 votes


Permanent link
If you can run a step on  Unix, you could create a step like
.bset env "CONDITION=`if [ "$var1" = "value1" -a "$var2" = "value2" -a "$var3"="value3" ]; then echo true; else echo false;fi`"
and then make the step you only want to run in that situation conditional on $CONDITION containing true.

There's probably a simple way to do this with Windows as well, but I try to avoid scripting on Windows.

0 votes

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,023

Question asked: Jul 26 '12, 11:09 a.m.

Question was seen: 4,958 times

Last updated: Jul 30 '12, 1:21 p.m.

Confirmation Cancel Confirm