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

Chaining up Builds

How can I chain up actions in order to get successive builds, like we can have with TeamCity or Hudson ?

Here's the process i'd like to execute
1-Continuous build (i already have this build working)
2-on build success, copy sources on a remote filesystem
3-on copy success, call a remote batch by url invocation

Any help would be appreciated !

0 votes



17 answers

Permanent link
Hi Guillaume, as mentioned in your other post, you can use the <requestTeamBuild> Ant task to kick off another build from the first build's script. There's not currently any support for configuring this in the UI.

The Ant task reference topic in the Help provides details on how to use this task.

a+,
Nick

0 votes


Permanent link
If you describe how you have this set up in Hudson or Team City, I might be able to provide a more concrete recommendation. Thanks.

0 votes


Permanent link
Hi Guillaume, as mentioned in your other post, you can use the <requestTeamBuild> Ant task to kick off another build from the first build's script. There's not currently any support for configuring this in the UI.

The Ant task reference topic in the Help provides details on how to use this task.

a+,
Nick


Hi nedgar, it almost works !
It would be perfect if y could synchronise the different tasks. With <requestTeamBuild> all tasks are launched without waiting each other to complete.

I'll prototype something with <waitForTeamBuild>, is this the right way ?

Regards,

Guillaume

0 votes


Permanent link
Hi Guillaume, as mentioned in your other post, you can use the <requestTeamBuild> Ant task to kick off another build from the first build's script. There's not currently any support for configuring this in the UI.

The Ant task reference topic in the Help provides details on how to use this task.

a+,
Nick


Hi nedgar, it almost works !
It would be perfect if y could synchronise the different tasks. With <requestTeamBuild> all tasks are launched without waiting each other to complete.

I'll prototype something with <waitForTeamBuild>, is this the right way ?

Regards,

Guillaume

Hi again !

Here's an abstract of an ant task chaining up different builds.


requestTeamBuild repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
requestUUIDProperty="requestUUID"
buildDefinitionId="Synchroniser_j2ee_Integration_2"/>

echo message="Attente de la fin de la tache ID=${requestUUID}"/>

waitForTeamBuild repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
requestUUID="${requestUUID}"
statesToWaitFor="COMPLETED"
verbose="true"
timeout="240"
interval="1"/>


(sorry, i removed '<' chars cause they break the code in the post...)

unfortunately , i always get a timeout on the waitForTeamlBuild, even if the previous build is cancelled or complete.

In the logs, i get :

[echo] Attente de la fin de la tache ID=_Mjt3IWGaEd-0PatKv_pDNA
[waitForTeamBuild] Aucun proxy n'est utilis pour accder https://xxx.xxx.xxx.xxx:xxxx/jazz/
[waitForTeamBuild] Dbut de l'attente du passage de la gnration "_Mjt3IWGaEd-0PatKv_pDNA" l'tat COMPLETED.
[waitForTeamBuild] Dpassement du dlai d'attente maximal de 240 seconde(s) pour la gnration "_Mjt3IWGaEd-0PatKv_pDNA".
[waitForTeamBuild] La gnration "_Mjt3IWGaEd-0PatKv_pDNA" est passe l'tat IN_PROGRESS. Le dlai d'attente a t de 240 seconde(s).


So task is never detected as COMPLETE or CANCELED, and remains IN_PROGRESS...

Where's the problem ?

Regards,

Guillaume

0 votes


Permanent link
Hi Guillaume,

The overall approach looks good to me.

How long does the 'Synchroniser_j2ee_Integration_2' build take to run? Could it be that the 240 seconds limit is just too short? That is, is the 'IN_PROGRESS' state it's reporting after 240 seconds accurate?

If you want it to stop waiting if the build is canceled or abandoned, you'll need to add those states, e.g. statesToWaitFor="COMPLETED, CANCELED, INCOMPLETE".
You can check which state it ended up in using buildStateProperty="buildState" to set the buildState property to the resulting state. Likewise for build status, you can use buildStatusProperty="buildStatus".

> (sorry, i removed '<' chars cause they break the code in the post...)
Try checking 'Disable HTML in this post' when posting. Also note that the forum software has a bug whereby this setting gets lost when you use Preview.

a+,
Nick

0 votes


Permanent link
>How long does the 'Synchroniser_j2ee_Integration_2' build take to run? Could it be that the 240 seconds limit is just too short? That is, is the 'IN_PROGRESS' state it's reporting after 240 seconds accurate?

Even without the timeout option, waiting build never exits !

>If you want it to stop waiting if the build is canceled or abandoned, you'll need to add those states, e.g. statesToWaitFor="COMPLETED, CANCELED, INCOMPLETE".

It doesn't change anything.

I forgot to tell you that the builds run on separate engines.

0 votes


Permanent link
>
Even without the timeout option, waiting build never exits !

That is expected. If you don't give a timeout, it waits forever (for the given state(s)).


>If you want it to stop waiting if the build is canceled or abandoned, you'll need to add those states, e.g. statesToWaitFor="COMPLETED, CANCELED, INCOMPLETE".

It doesn't change anything.

That was just a suggestion for getting it to stop waiting on the other end states, I didn't think it would solve the problem.


I forgot to tell you that the builds run on separate engines.

That's good, since if the main build is waiting, the other build needs to get picked up by some other engine.

Can you clarify, though: does the actual synchronizer build actually finish? That is, is the problem that the nested build actually hangs, or that waitForTeamBuild is not seeing it finish properly?

0 votes


Permanent link
Thanks for your answers !

>Can you clarify, though: does the actual synchronizer build actually finish? That is, is the problem that the nested build actually hangs, or that waitForTeamBuild is not seeing it finish properly?

yes, waitForTeamBuild is not seeing it finish properly.

0 votes


Permanent link
The logic in the waitForTeamBuild task is really simple. It basically just does:
- fetch the build result (with refresh flag, to ignore any cached item)
- check if it's in one of the desired states
- if not, sleep for a bit and repeat, unless timed out

What is the network topology between the server and the build machines running JBE? Is there any difference if you run JBE on the same machine as the server? Is it possible there's some kind of caching proxy between the two (even if there were, it shouldn't be caching these kinds of requests, but you never know).

Which JDK are you using to run JBE (try java -version from the JBE directory)? If not already, can you try with the one included in the RTC client? For more context, see https://jazz.net/wiki/bin/view/Main/BuildFAQ#WhichJDK .

You could also try looking at the internal representations for the request and result (from the build machine).

- take the request UUID printed out by your <echo> statement
- in a browser, fetch the following, using the request UUID:
https://{your repository including /jazz suffix}/resource/itemOid/com.ibm.team.build.BuildRequest/_Mjt3IWGaEd-0PatKv_pDNA?_mediaType=text/json&_prettyPrint=true
- look through it for the result handle, e.g.:
"buildResult": {
"com.ibm.team.repository.typeName": "com.ibm.team.build.BuildResult",
"itemId": "_lSlEsF_FEd-WX8dOKD-Ydg",
"uri": "itemOid\/com.ibm.team.build.BuildResult\/_lSlEsF_FEd-WX8dOKD-Ydg"
},
- fetch the result, replacing the result item id (not the request item id) in:
https://{your repo}/resource/itemOid/com.ibm.team.build.BuildResult/_lSlEsF_FEd-WX8dOKD-Ydg?_mediaType=text/json&_prettyPrint=true
- look for the buildState, e.g.:
"buildState": "COMPLETED",

If you want to track the state of the child build as it proceeds, you only need to refresh the result url.

0 votes


Permanent link
It might be easier to specify _mediaType=text/xml instead of text/json, to get the result in-browser instead of in a text editor.

0 votes

1–15 items
page 1of 1 pagesof 2 pages

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
× 10,937

Question asked: May 10 '10, 9:30 a.m.

Question was seen: 15,075 times

Last updated: May 10 '10, 9:30 a.m.

Confirmation Cancel Confirm