jcgay / jenkins-pushbullet-plugin

Report Jenkins build status with Pushbullet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jenkins Pushbullet Plugin

A Jenkins plugin to report build status with Pushbullet.

Installation

Download pushbullet.hpi and install it manually in Jenkins (http://jenkins/pluginManager/advanced).

Usage

Set admin Pushbullet access token

To send notifications, Jenkins needs a Pushbullet access token accessible from here.
Set it in Pushbullet section in Jenkins administration (http://<jenkins.url>/configure)

Jenkins Configuration

If the token is not set, Jenkins will not try to send push notifications.

User account

To receive notification each user must define its Pushbullet account ID (email) in Jenkins user settings (http://<jenkins.url>/me/configure).

User Configuration

Notified users

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).

Activate Pushbullet notification for a job

Freestyle Job

Add Report build status with Pusbullet as a Post Build Action in your Jenkins job:

Job Configuration

Pipeline script

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
    }
}

Declarative pipeline

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

Build the plugin locally with Maven:

> mvn package

The plugin binary will be available in target/pushbullet.hpi.

Status

Build Status

Release

mvn -B release:prepare release:perform

About

Report Jenkins build status with Pushbullet

License:MIT License


Languages

Language:Java 99.1%Language:HTML 0.9%