We’ve added webhook support for deploy notifications. Now you can get pings via a simple webhook whenever a deploy for your theme or plugin code is pushed live.
You can specify your webhook endpoints in file called wpcom-meta.php
in the root of your theme:
<?php
/**
* Deploy Webhook: http://example.com/path/to/endpoint.php
*/
The value of the endpoints in the “Deploy Webhook” line of the comment can be a comma-separated list of URLs.
Deploy Webhook: http://example.com/path/to/endpoint.php,http://example.com/path/to/alternate.php
The endpoints should not involve redirects as those may not be followed during the notification process.
Endpoints will receive something like the following as POST
data:
array (
'repo' => 'vip',
'theme' => 'test-theme',
'previous_revision' => '1234',
'deployed_revision' => '5678',
'deployer' => 'batmoo',
'revision_log' => 'r5678 Added new stuff that does things',
)
Thank you to the VIPs and partners who suggested this feature and helped us test things out. We’ve already seen or heard about implementations utilizing this like sending notifications to a group HipChat channel. We’d love to hear what you end up doing with this too; let us know!
Way cool! What was the design decision for doing this as a
wpcom-meta.php
file, instead of a via a filter or a function?Didn’t want to load the site/theme to get the data. Easier to just scrape a file using the `get_file_data`.
Very cool – If this could be extended to notify when things are committed as well, that would be really handy for me š
Thanks again for getting this up! Super useful for us.
Great idea! Thanks for setting it up.
Very cool, in the Hipchat example, what sat between the webhook and Hipchat? I assume something in the middle took the webhook payload, formatted it for Hipchat and then sent it on?
Yep, custom script that works the magic.
Any plans to also open source that?
We’re the ones that wrote the ‘mediation’ script between the webhook and HipChat. It’s pretty simple and not particularly elegant or really all that secure (then again, you probably shouldn’t pass out the URL anyway), but it gets the job done. I just put it up on our GitHub account, so feel free to grab it (and make updates if you feel like it).
https://github.com/VentureBeatTech/wpvip-hipchat
Awesome, thanks Ryan!
Awesome! My team and I have GitHub and Asana notifications already feeding into HipChat and have talked about how awesome a feature like this would be š Love it! We’ll be setting this up soon!