Please let me suggest a patch as attached for jenkins_build_get to get jenkins build object. Also I put a function url($foo) before each jenkins_request is called because Jenkins uses a job name with spaces as a part of URI.
| Comment | File | Size | Author |
|---|---|---|---|
| jenkins-20131127a.patch | 1.75 KB | yas |
Comments
Comment #1
yasComment #2
skwashd commentedThanks for the patch.
I've applied a modified version of it. jenkins_build_get returns boolean like all the other functions, if you want to access the json, you need to grab it from the $response which you pass in by reference.
I didn't apply the url() calls. Relative paths are treated as internal drupal paths by url(), this can lead to unexpected behaviour - for example someone has a job content type and they're using path aliases. I did call rawurlencode() on the $path argument based into jenkins_request(), which should deal with the problem.
Please only include one feature per issue/patch. It makes it easier to track changes.