Yamkins
Jenkins plugin that posts notifications to Yammer groups written in Java. It is currently not registered as an official Jenkins plugin, but I'll try to do that when I have some free time.
The plugin draws ideas and code from the similar jenkins-hipchat-plugin. Thanks!
Beware: The rate limit for messages is 10 requests in 30 seconds. Rate limits are not respected by this plugin. However, for small and medium sized Jenkins installations this should never become a problem.
Requirements
- Yammer user account
- Yammer group
- Jenkins installation (1.509+)
- Java (1.6+) / Maven (3.0.4+) build environment
Installation
- Do a 'mvn install'
- Install the target/yamkins.hpi in your Jenkins instance
- Acquire a long-lived API token as described below.
- Enter the API token in the global Jenkins configuration
- Set-up a post-build notification in an appropriate job
License
The plugin is licensed using the MIT License. See the LICENSE file in the root directory.
Yammer
Get API token (manual OAuth procedure)
- Go to Yammer Client Applications to register your app
- Click on "Click here to register a new app"
- Enter details, along these lines:
- Application name: Build Server Notifications
- Organization: Engineering
- Support e-mail: your e-mail adress or an engineering mailing list
- Website: anything, maybe an internal wiki site
- Take note of the client ID and secret on the following application details page.
- Get the client token according to the steps on https://developer.yammer.com/authentication/ or listed here:
- Log into Yammer with a user account that you like your Jenkins build notifications get posted with
- Fill in client_id and any webpage here: https://www.yammer.com/dialog/oauth?client_id=[:client_id]&redirect_uri=[:redirect_uri]
- Click "Allow"
- You will be forwarded to an URL copy the code from it: https://www.yammer.com//?code=njNBNwmiJlYZheu917Dtw
- Use this code in this URL, the client ID and secret you already have from step 4. https://www.yammer.com/oauth2/access_token.json?client_id=[:client_id]&client_secret=[:client_secret]&code=[:code]
- In the returned JSON, find access_token.token property. This will be your single, long-lived API token to set-up in the Yamkins configuration.
Create Yammer network for testing
- Go to https://www.yammer.com/signup
- Enter an e-mail address of an existing network you may join or a new one (depends on the hostname)
- Verify e-mal address
- Complete registration process
Development
Maven
- It may be necessary to set up your settings.xml file according to the instructions on the Jenkins website.
- If you are using a local Maven repository that mirrors the Jenkins repo, please ensure the new URL is configured: http://repo.jenkins-ci.org/public/
Debugging the plugin with Intellij IDEA
As described at the Jenkins website, create a new maven run configuration with the hpi:run goal and the following parameters in the Runner-VM Options:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
Jenkins will then be available at http://localhost:8080/
Known Issues
- A NoSuchFileException is thrown under windows due to the known issue [JENKINS-17681](bug: https://issues.jenkins-ci.org/browse/JENKINS-17681).
- Adding a post-build notification seems to only works with recent versions of Jenkins. It was successfully tested with 1.509 and 1.515.