[users at bb.net] Help on custom hook
Pierre Tardy
tardyp at gmail.com
Thu Nov 2 18:46:34 UTC 2017
Hi Shulhan,
The www hooks are now customizable via the buildbot plugin system
The default one are configured here.
https://github.com/buildbot/buildbot/blob/master/master/setup.py#L415
I would suggest you to create your own python package and distribute your
buildbot-mattermost plugin on pypi.
If your plugin is simple enough, you can also fit it in the master.cfg. See
doc at
http://docs.buildbot.net/latest/manual/cfg-wwwhooks.html#custom-hooks
Regards
Pierre
On Thu, Nov 2, 2017 at 7:52 AM Shulhan <m.shulhan at gmail.com> wrote:
> Hello all,
>
> Current enviroments,
>
> - buildbot version is 0.9.12.
> - CentOS 7
> - Python 2.7.5
> - Twisted 17.9.0
>
> I have a custom hook that triggered from Mattermost slash command,
>
> /change_hook/mattermost
>
> Previously, using buildbot v0.9.0 my custom hook worked [1] flawlessly.
> After upgrading to v0.9.12, I need to refactor my custom hook into this
> script [2].
>
> I copied the script to
> `/usr/lib/python2.7/site-packages/buildbot/www/hooks`
> and restart buildmaster process.
>
> When executing slash command from Mattermost, I got the following response,
>
> [2017/11/02 06:37:16 UTC] [EROR] /api/v4/commands/execute:command
> code=500 rid=dyxr58jez7ffpynkor74e4yi5e uid=7mz1mju7dbyu7n788w7pyswcmr
> ip=10.8.0.3 Command with a trigger of 'build' returned response 400 The
> dialect specified, 'mattermost', is not registered as a buildbot.webhook
> plugin [details: The dialect specified, 'mattermost', is not registered as
> a buildbot.webhook plugin]
>
> Log from buildmaster,
>
> 2017-11-02 06:37:16+0000 [_GenericHTTPChannelProtocol,0,172.32.1.208]
> The dialect specified, 'mattermost', is not registered as a
> buildbot.webhook plugin
>
> My master.cfg contains,
>
> c['www'] = {
> ...
> , "change_hook_dialects":{
> "github": {
> "secret": "{{ buildmaster_github_secret }}"
> , "strict": True
> }
> , "mattermost": {
> "token": "{{ mattermost_token }}"
> , "channel": "ci"
> , "repo_base_url": "{{ repo_base_url }}"
> }
> }
>
> What should I do?
>
> [1]
> https://github.com/shuLhan/mattermost-integration/blob/master/buildbot/mattermost.py
> [2] https://gist.github.com/shuLhan/0bdbe7e22c2df4bfc5b6d6c79ee282b6
> _______________________________________________
> users mailing list
> users at buildbot.net
> https://lists.buildbot.net/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20171102/4b6ea3c5/attachment.html>
More information about the users
mailing list