It's all about the answers!

Ask a question

Checking the build result from command line


Andrew Wang (2154) | asked Jul 09 '10, 1:57 p.m.
In 2.0.0.2, is there a way to check the status of a build from the command line?

One answer



permanent link
Nick Edgar (6.5k711) | answered Jul 09 '10, 3:02 p.m.
JAZZ DEVELOPER
The closest thing we have to a command line tool for Build is the Ant tasks.
They work in pretty low level terms, though, since they're intended for use by automated build scripts, rather than humans.
For example, builds are identified by their item id (a UUID). You can obtain this from the last segment of the result of Copy URL on a build result in the IDE.

I defined the following Ant script, called buildstatus.xml.

<project name="buildStatus" default="buildStatus">

<taskdef name="waitForTeamBuild" classname="com.ibm.team.build.ant.task.WaitForTeamBuildTask"/>

<property name="repositoryAddress" value="https://jbslnxvh04.ottawa.ibm.com:9443/jazz"/>
<property name="userId" value="nedgar"/>
<property name="passwordFile" value="/Users/nedgar/Work/pass"/>

<target name="buildStatus">
<waitForTeamBuild
repositoryAddress="${repositoryAddress}" buildResultUUID="${buildResultUUID}" userId="${userId}" passwordFile="${passwordFile}"
statesToWaitFor="NOT_STARTED,CANCELED,IN_PROGRESS,INCOMPLETE,COMPLETED" timeOut="2" interval="1"
buildStateProperty="buildState" buildStatusProperty="buildStatus"/>
<echo message="build state: ${buildState}, status: ${buildStatus}"/>
</target>

</project>


I can then do:

ant -f buildstatus.xml -lib {path to buildtoolkit directory} -q -DbuildResultUUID=_Hkm1wYStEd--Je62z2AkVQ

which outputs, e.g.
build state: COMPLETED, status: OK

Here, the build result UUID is _Hkm1wYStEd--Je62z2AkVQ, obtained manually from the build result's URL.

I had previously set up the password file using:
jbe -createPasswordFile ~/Work/pass

Does this help for your scenario? If not, can you provide more details about what you're trying to do?

Your answer


Register or 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.