requestTeamBuild + waitforTeam Build error
Hi,
I'm attempting to start a Jazz build from another Jazz build, but I don't want the parent to complete until the child is complete. I'm starting the child like this:
<target name="request_build">
<requestTeamBuild repositoryAddress="https://192.168.115.102:9443/jazz/"
userId="<my_user_id>"
password="<my_pass>"
requestUUIDProperty="childBuildRequestUUID"
verbose="true"
buildDefinitionId="Test Release Build Child"/>
</target>
and I'm waiting on it with this:
<target name="wait_for_build">
<waitForTeamBuild repositoryAddress="https://192.168.115.102:9443/jazz/"
userId="<my_user_id>"
password="<my_pass>"
verbose="true"
requestUUID="dummy"/>
</target>
I'm expecting the property "childBuildRequestUUID" to be set to the UUID of the build request in the parent, but it's not. I have created the property and set it to dummy in the parent's build definition but as we can see, it's not being set by the request call. The child build is started successfully and its requestUUID set appropriately within its context.
From the log:
[waitForTeamBuild] Ant task attribute "requestUUID" contains illegal value "dummy".
What am I doing wrong?
Thanks,
Dave
I'm attempting to start a Jazz build from another Jazz build, but I don't want the parent to complete until the child is complete. I'm starting the child like this:
<target name="request_build">
<requestTeamBuild repositoryAddress="https://192.168.115.102:9443/jazz/"
userId="<my_user_id>"
password="<my_pass>"
requestUUIDProperty="childBuildRequestUUID"
verbose="true"
buildDefinitionId="Test Release Build Child"/>
</target>
and I'm waiting on it with this:
<target name="wait_for_build">
<waitForTeamBuild repositoryAddress="https://192.168.115.102:9443/jazz/"
userId="<my_user_id>"
password="<my_pass>"
verbose="true"
requestUUID="dummy"/>
</target>
I'm expecting the property "childBuildRequestUUID" to be set to the UUID of the build request in the parent, but it's not. I have created the property and set it to dummy in the parent's build definition but as we can see, it's not being set by the request call. The child build is started successfully and its requestUUID set appropriately within its context.
From the log:
[waitForTeamBuild] Ant task attribute "requestUUID" contains illegal value "dummy".
What am I doing wrong?
Thanks,
Dave
2 answers
Hi Dave, in the waitForTeamBuild invocation, you need to pass along the UUID for the build you're waiting for.
Try: requestUUID="${childBuildRequestUUID}"
I also recommend using:
statesToWaitFor="CANCELED,INCOMPLETE,COMPLETE"
buildStateProperty="childBuildState"
buildStatusProperty="childBuildStatus"
statesToWaitFor defaults to INCOMPLETE (i.e. abandoned) and COMPLETE. By adding CANCELED, that allows it to unblock if the build has been canceled.
Giving the names of properties to hold the build state/status allows you to check what state the build ended up in, and what its status (OK/INFO/WARNING/ERROR) is.
You may also want to set timeout to something (in seconds). The default is to wait indefinitely.
Comments
Hi Nick,
just to be clear, and to ensure I'm doing the right thing, here's the ant script:
<project name="ALPS" default="request_build">
<property file="/var/cache/build/20131126-0805/build.properties"/>
<target name="request_build">
<requestTeamBuild repositoryAddress="https://192.168.115.102:9443/jazz/"
userId="<my_user_id>"
password="<my_pass>"
requestUUIDProperty="childBuildRequestUUID"
verbose="true"
personalBuild="true"
buildDefinitionId="Test Release Build Child"/>
<echo>Ant childBuildRequestUUID: ${childBuildRequestUUID}</echo>
<echo>Ant repositoryAddress: ${repositoryAddress}</echo>
</target>
<taskdef name="requestTeamBuild"
classname="com.ibm.team.build.ant.task.RequestBuildTask" />
</project>
The output is:
Successfully requested build for build definition "Test Release Build Child".
[echo] Ant childBuildRequestUUID:
[echo] Ant repositoryAddress: https://192.168.115.102:9443/jazz/
BUILD SUCCESSFUL
Total time: 12 seconds
I also tried echoing the value of childBuildRequestUUID before the call to requestTeamBuild, and it printed the same as the echo after the call. The variable is not declared/initialised anywhere before that.
Am I correct in understanding that the script should result in the shell environment variable childBuildRequestUUID being created and the UUID of the build request being set to it?
Thanks,
Dave
just to be clear, and to ensure I'm doing the right thing, here's the ant script:
<project name="ALPS" default="request_build">
<property file="/var/cache/build/20131126-0805/build.properties"/>
<target name="request_build">
<requestTeamBuild repositoryAddress="https://192.168.115.102:9443/jazz/"
userId="<my_user_id>"
password="<my_pass>"
requestUUIDProperty="childBuildRequestUUID"
verbose="true"
personalBuild="true"
buildDefinitionId="Test Release Build Child"/>
<echo>Ant childBuildRequestUUID: ${childBuildRequestUUID}</echo>
<echo>Ant repositoryAddress: ${repositoryAddress}</echo>
</target>
<taskdef name="requestTeamBuild"
classname="com.ibm.team.build.ant.task.RequestBuildTask" />
</project>
The output is:
Successfully requested build for build definition "Test Release Build Child".
[echo] Ant childBuildRequestUUID:
[echo] Ant repositoryAddress: https://192.168.115.102:9443/jazz/
BUILD SUCCESSFUL
Total time: 12 seconds
I also tried echoing the value of childBuildRequestUUID before the call to requestTeamBuild, and it printed the same as the echo after the call. The variable is not declared/initialised anywhere before that.
Am I correct in understanding that the script should result in the shell environment variable childBuildRequestUUID being created and the UUID of the build request being set to it?
Thanks,
Dave