I'm writing a module that needs to integrate with Jenkins and I would like to use this API. I need the ability to make requests to more than one Jenkins host. Would it be possible to tweak the jenkins_request function code slightly to decouple it from the jenkins_base_url variable?
Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2407097_jenkins_allow_more_than_one_host_6.patch | 7.33 KB | littledynamo |
| #4 | 2407097_jenkins_allow_more_than_one_host_2.patch | 1.04 KB | littledynamo |
| #1 | 2407097_jenkins_allow_more_than_one_host_1.patch | 742 bytes | littledynamo |
Comments
Comment #1
littledynamo commentedComment #2
littledynamo commentedComment #3
littledynamo commentedComment #4
littledynamo commentedAdded comment for new parameter.
Comment #5
skwashd commented@littledynamo this is an interesting idea. I want to avoid implementing something like CTools exportables for managing Jenkins servers, so we need some way of handling this with {variable}s.
In order to maintain backwards compatibility
$urlwould need to be the last argument in the call tojenkins_request(). The base url would need to be an optional argument for all the functions that calljenkins_request(), as callingjenkins_request()directly is not encouraged and defeats the purpose of having all the other functions.Comment #6
littledynamo commented@skwashd - thanks for getting back to me. I have implemented the Entity API in my module, so each of the Jenkins hosts will be stored as an entity. This means I wouldn't need to store store URLs as variables in the Jenkins API module.
I'm mainly looking to add the Jenkins API as a dependency for my module and to call the functions directly. Have a gander at
runBuild()andgetJobs()to see what I mean http://cgit.drupalcode.org/update_trigger_build/tree/src/CIServerTypes/J...I've attached another patch, which includes the changes as per the feedback in #5.
Comment #7
littledynamo commented