开发者

Adding customized functions to Buildbot

I have written a function in python and I would like to have Buildbo开发者_C百科t to execute this function when it receives a "build" command. I have used the "factory.addStep()" before to add new commands through command line, but I'm not sure how I can add a python function to Buildbot. Thanks and please let me know if I'm being unclear on anything.


Do you want the code to run on the master or the slave?

If you want to run code on the master, then all you need to do is subclass BuildStep, and put your code in .start (see the link in vernomcrp's answer).

If you want to run the code on the slave, things become trickier. The simplest solution is if you can write a python script (rather than function), and execute that script. You can include the script in your repository, or download it to the slave with FileDownload or StringDownload.

If you require the code to run in the slave process it self, you need patch the slave, to add a new command, and create a corresponding BuildStep on the master, that calls your new command. This requires modifying the buildslave code on all slaves that you want to run the code on. This isn't documented anywhere, so you will need to have a look at the code to figure out how to do this.


I think we can customize buildstep to execute python function. Have a look at this link http://buildbot.net/buildbot/docs/latest/manual/customization.html. I think it has something what you want. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜