continuum-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Och, Andrew Daniel (TSG-GDCC-SH)" <andrew....@hp.com>
Subject RE: Triggering a build via xmlrpc and getting the result for that build
Date Tue, 13 May 2008 11:19:43 GMT
Dear Jon

Thanks for the help and suggestion.

Unfortunately getting the getLatestBuildResult(projectSummaryID) doesn't really work as can
be seen by the code snippet and the resulting error (only when I start with an empty build
history):

client.buildProject(projectSummaryID, buildDefinition.getId());
BuildResult buildResult = client.getLatestBuildResult(projectSummaryID);

[INFO][2008-05-13 19:02:05][com.chn.hp.test.client.ContClient]- BUILD Project ID: 2 buildDefId:
18
org.apache.xmlrpc.XmlRpcException: Failed to invoke method getLatestBuildResult in class org.apache.maven.continuum.xmlrpc.server.ContinuumServiceImpl:
null
        at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:184)
        at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)
        at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
        at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:39)
        at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)
        at org.apache.xmlrpc.client.util.ClientFactory$1.invoke(ClientFactory.java:104)
        at $Proxy0.getLatestBuildResult(Unknown Source)
        at org.apache.maven.continuum.xmlrpc.client.ContinuumXmlRpcClient.getLatestBuildResult(ContinuumXmlRpcClient.java:333)
        at com.chn.hp.test.client.ContClient.<init>(ContClient.java:150)
        at com.chn.hp.test.client.ContClient.main(ContClient.java:171)

If there are builds in the history, getting the latest build actually retrieves the previous
build result! I believe that this is because buildProject() puts the build into a queue. When
my next line of code executes retrieving the latest build result (the one I just triggered
has not had time to be created).

Hence I am trying to link the specific buildProject(...) trigger to a specific BuildResult.
ie something like below would be nice:

int buildID = client.buildProject(projectSummaryID, buildDefinitionID);
BuildResult buildResult = client.getBuildResult(projectSummaryID, buildID);

BUT the xmlrpc api does not offer the above, or does it, or does it offer a different way?

Best regards
Andrew Och

-----Original Message-----
From: SlinnHawkins, Jon (ELS-CAM) [mailto:J.SlinnHawkins@elsevier.com]
Sent: Tuesday, May 13, 2008 6:26 PM
To: users@continuum.apache.org
Subject: RE: Triggering a build via xmlrpc and getting the result for that build

Hi Andrew,

Use

client.getLatestBuildResult(projectSummaryId);

http://continuum.apache.org/ref/latest/apidocs/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.html

Cheers

Jon



-----Original Message-----
From: Och, Andrew Daniel (TSG-GDCC-SH) [mailto:andrew.och@hp.com]
Sent: 13 May 2008 11:06
To: users@continuum.apache.org
Subject: Triggering a build via xmlrpc and getting the result for that build


I would like to trigger a build via xmlrpc and get the result for that build.

I use the buildProject(...) method to start a forced build. However how do I get the associated
buildID from this trigger? Without a buildId I can not get a BuildResult for the build I triggered.

client.buildProject(projectSummaryID, buildDefinitionID); BuildResult buildResult = client.getBuildResult(projectSummaryID,
buildID);

Am I being stupid? Have I missed something?

Best Regards
Andrew Och

Mime
View raw message