I have a Python script that operates on Hudson builds and would love to be able to set the description of a build programmatically.
I can click "Add Description" on a build's page and fill in the form, how can I POST some data to the same URL that form does?
Figured it out, need to POST the following as form data (content type
application/x-www-form-urlencoded
) tohttp://myserver/hudson/job/thebuild/10/submitDescription
In code:
(would comment, but not enough rep)
Thanks to jtb for the bulk of the approach. If security is enabled on the server, I found that I could authenticate using this code (adapted from here)
The values for user and token can be found under API Token in:
http://<myserver>/me/configure
Using an 'Execute system Groovy script' Build task:
Here is the curl command that worked fine from shell. Replace the text in between and including {}.
curl -X POST -u {user:password} -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode description={descriptionstring} {hudsonurl}/job/{jobname}/{buildnumber}/submitDescription