0

I have a very simple inhouse web app from which certain Hudson builds (on another server) can be triggered remotely. I have no problem triggering the builds, but I don't know how to capture the associated build number for later reference.

I'm using the buildWithParameters trigger, and the actual result of that call is just a mess of HTML - I don't believe it gives me back the build number.

I started down the path of pulling the whole build list for the job (via the api), and then attempting to reconcile that list against my records - but that's much more complicated than I'd like it to be. I also considered sleeping for a few seconds after launching the job, and then grabbing the latestBuild from the Hudson api - but I'm sure that's going to go wrong at some point (someone will fire off two jobs quickly, and I'll get the association wrong).

1 Answer 1

0

I solved this with a callback URI on the server that triggers the job. The first thing the Hudson job does is curl http://example.com/callback/$BUILD_NUMBER (actually there's another identifier so that the trigger side can match the job up correctly, but you get the point).

This leaves the trigger side in the dark until the job actually begins, but it works ok.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .