Sends build notifications to Android devices using the Google Cloud Messaging (GCM) service.
Once fully set up, Jenkins will be able to send notifications to the Google Cloud Messaging (GCM) service — formerly known as Cloud to Device Messaging (C2DM) — which will forward those notifications to the relevant devices which have been paired with your Jenkins server.
Once you have the plugin installed, you must use your Google Account to create a new API Project, which gives you access to use the GCM service.
This process is demonstrated in this video: https://www.youtube.com/watch?v=3QFVUg0nfRM
Each user who wishes to be able to receive notifications must pair their device with the particular Jenkins instance.
The simplest way to set up an Android device and receive notifications is to use the BuildWatch app.
Now your device is ready to receive notifications.
This process is demonstrated in this video: https://www.youtube.com/watch?v=mt0ctjBTiZw
Once you have one or more users with devices paired to your Jenkins server, you can enable build notifications.
In any job, enable the "Notify Android devices" post-build action.
Here you can enter the Jenkins user IDs you wish to be notified, separated by spaces.
The advanced options available are specified by the Instant Messaging Plugin.
Make sure you're logged into Jenkins, and that you're looking at the correct user configuration page.
If you scanned the QR code and directly afterwards pressed "Enter token manually", you won't see the token — you must reload the page first.
Alternatively, your Android device failed to upload the GCM token to Jenkins.
Check that you have the correct connectivity and try again. You can also confirm from your Android browser that you can reach the Jenkins URL listed under Manage Jenkins → Configure System → Jenkins URL.
If you want to integrate Jenkins GCM notifications into your own app, you can use the following info.
The QR code shown by this plugin simply contains a JSON object with the following key/value string pairs:
The senderId is used to request a GCM device token via the Android APIs.
Once you have a GCM device token, it should be sent as an HTTP POST request to JENKINS_URL/gcm/register with the parameter token containing the GCM device token.
The HTTP request should be made as the Jenkins user in question — i.e. you should use the user ID and API token from the QR code to do HTTP Basic authentication.
Jenkins will reply with HTTP 200 OK if the token was registered, and with the relevant error code otherwise, depending on whether the token was missing or the user was not authenticated.
Once you've uploaded the user's GCM device token, you can safely throw away the info gained from the QR code. If you do want to hold onto the user ID and their API token, you should give the user a method of deleting these from your app, as these values are sensitive — i.e. they can be used to perform any action as that Jenkins user.
When this plugin sends a notification to a device, it currently simply sends a single string value "m", containing the plain text of the notification, as you would normally see from the Instant Messaging plugin.
e.g. "Project foobar build #123: SUCCESS in 2 min: http://ci.example.com/job/foobar/123/"
Your app will receive this directly as an Android Intent, with the String value of "m" in the intent extras.
Currently the Instant Messaging plugin doesn't deliver more structured data to its users, but this is something we'd like to improve on in future...
You can find various demonstrations, setup instructions and further info at buildwatch.org.
If you have any questions, get in touch via the links here or on the BuildWatch site.
Skip to end of metadata Go to start of metadata