Skip to content

A simple Groovy script which enables Flowdock notifications to be sent from a Jenkins Pipeline.

License

Notifications You must be signed in to change notification settings

H2wk/jenkins-flowdock-notifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

jenkins-flowdock-notifier

A simple Groovy script which enables Flowdock notifications to be sent from a Jenkins Pipeline. The current Flowdock notification plugin does not have any Pipeline integration--here is a stopgap.

Inspired by and lifted from this thread and this comment specifically.

Prerequisites

The following must be available in your Jenkins installation to use this library:

Installation

A Jenkins administrator must install the library as follows:

  1. In Manage Jenkins => Configure System, find the Global Pipeline Libraries section.
  2. Click on Add.
  3. Specify:
  • Name: flowdock-notifier
  • Default version: master
  1. For retrieval method, assuming GitHub, select Modern SCM and then GitHub:
  • Owner: c3tp
  • Repository: jenkins-flowdock-notifier
  1. Click Save at the bottom.

Use

You must declare use of the library somewhere before use:

library 'flowdock-notifier'

Then, call flowdockNotify in an appropriate place in your pipeline. It needs to be a step-class block, including and probably most appropriately a post block. There are three arguments:

  1. this - passes the script object to the notifier function to provide necessary context
  2. API token for Flowdock. This can be retrieved from your Flowdock profile page
  3. A string containing list of tags (optional).

For example:

library 'flowdock-notifier'

pipeline {
    agent any
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
                sh '/bin/false'
            }
        }
    }
    post { 
        changed { 
            flowdockNotify this,'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', '#test'
        }
    }
}

About

A simple Groovy script which enables Flowdock notifications to be sent from a Jenkins Pipeline.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Groovy 100.0%