A Jenkins plugin to report build status with Pushbullet.
Download pushbullet.hpi and install it manually in Jenkins (http://jenkins/pluginManager/advanced
).
To send notifications, Jenkins needs a Pushbullet access token accessible from here.
Set it in Pushbullet
section in Jenkins administration (http://<jenkins.url>/configure
)
If the token is not set, Jenkins will not try to send push notifications.
To receive notification each user must define its Pushbullet account ID (email) in Jenkins user settings (http://<jenkins.url>/me/configure
).
By default a push notification will be send to each user present in the build culprits list (as documented here).
Also if a user has launched a build manually, he will receive a notification.
Eventually users can be added in the job configuration Report build status with Pushbullet
, these ones will be notified for every build. Users
is a string of comma separated Jenkins user IDs (toto,tata,titi
for example).
Add Report build status with Pusbullet
as a Post Build Action
in your Jenkins job:
To report a build state in a pipeline script, you'll need to handle errors.
Basically you'll need to wrap your build sript in a try/catch
(see Documentation)
node {
try {
sh 'might fail'
pushbullet users:''
} catch (e) {
pushbullet users:''
throw e
}
}
With declarative pipeline there is a post action that will be called before exiting the build.
pipeline {
agent any
stages {
stage("Build") {
steps {
sh 'might fail'
}
}
}
post {
always {
pushbullet users: ''
}
}
}
Build the plugin locally with Maven:
> mvn package
The plugin binary will be available in target/pushbullet.hpi
.
mvn -B release:prepare release:perform