{jenkins-plugin-info:pluginId=ircbot}

This plugin enables Jenkins to send build notífications via IRC and lets you interact with Jenkins via an IRC bot. Note that you also need to install the instant-messaging plugin .

This plugin needs the instant-messaging plugin. Please ensure that the latest version of this plug-in is also installed.

Features

See the  instant-messaging plugin for a description of protocol-independent features.

IRC-specific features

Pipeline syntax features

Starting with release 2.31 this plugin can be called as a pipeline step. The same toggles as configurable in a legacy job post-build task can be specified as named arguments to the pipeline step, with a difference that they are executed at once.

Example pipeline steps

Example ircNotify pipeline step syntax variants (not exhaustive): 

pipeline {
    agent any
    options {
        disableConcurrentBuilds()
        skipDefaultCheckout()
    }
    stages {
        stage ('Notify') {
            steps {
// Notify a start of build; appends the extra message at the end (note: prefix with separators if needed)
                ircNotify notifyOnStart:true, extraMessage: "Running IRCBot test..."
            }
        }

        stage ('PM') {
            steps {
// Post a verbatim custom message; can specify non-default targets (defaults are in global config)
                ircNotify targets: "jim #myroom", customMessage: "Hello from IRCBot"
            }
        }
    }
    post {
        always {
// Notify the verdict only known at end of build; send to default targets by default notification strategy
            ircNotify()
        }
    }
}

with an output in the IRC room like the following:

(06:37:03) jenkins2: (notice) Starting build #214 for job GitOrg » reponame » branchname Running IRCBot test... (previous build: SUCCESS)
(06:37:04) jenkins2: (notice) Hello from IRCBot
(06:37:05) jenkins2: (notice) Project GitOrg » reponame » branchname build #214: SUCCESS in 7.2 sec: https://jenkins.localdomain/job/GitOrg/job/reponame/job/branchname/214/

Pipeline step arguments

The ircNotify  step optionally accepts any of the following parameters, and effectively passes them to the instant-messaging plugin for practical application.

argument namesyntaxdescription
targetsspace-separated stringSend the notification (or a "customMessage") to specified user name(s) and channel name(s), the latter start with a hash sign.
notifyOnStartboolean Set to true explicitly in an ircNotify step reporting a start of build, instead of a build completion
notifySuspectsbooleanSelect if the (build completion) notification should alarm the committers to (newly) failed builds
notifyCulpritsbooleanSpecifies if culprits - i.e. committers to previous already failing builds - should be informed about subsequent build failures.
notifyFixersbooleanSpecifies if 'fixers' should be informed about fixed builds.
notifyUpstreamCommittersbooleanSpecifies if upstream committers should be informed about build failures.
extraMessagestringAppend an additional message to usual notifications about build start/completion (note: you may want to start it with a separator like a semicolon)
customMessagestringInstead of build status messages, send an arbitrary message to specified or default (global config) targets with the pipeline step (and ignoring the strategy and filtering rules options above)

The following options can be specified, but not sure to what effect and how (TODO: try in practice and document here):

argument namesyntaxdescription
buildToChatNotifierclass name?

https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/IMPublisher.java#L88

notificationStrategystring or java/groovy token?

https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/NotificationStrategy.java

  • ALL - No matter what, notifications should always be sent.
  • ANY_FAILURE - Whenever there is a failure, a notification should be sent.
  • FAILURE_AND_FIXED - Whenever there is a failure or a failure was fixed, a notification should be sent.
  • NEW_FAILURE_AND_FIXED - Whenever there is a new failure or a failure was fixed, a notification should be sent. Similar to #FAILURE_AND_FIXED, but repeated failures do not trigger a notification.
  • STATECHANGE_ONLY - Notifications should be send only if there was a change in the build state, or this was the first build.
matrixMultiplierstring or java/groovy token?

https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/IMPublisher.java#L89

https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/MatrixJobMultiplier.java

e.g. MatrixJobMultiplier.ONLY_CONFIGURATIONS ONLY_PARENT ALL

Known Issues

Please look into the issue tracker for any open issues for this plugin.

Debugging Problems

If you experience any problems using the plugin please increase the log level of the logger hudson.plugins.ircbot to FINEST (see Logging), try to reproduce the problem and attach the collected logs to the JIRA issue.

Changelog

Version 2.31 (2019-08-09)

https://github.com/jenkinsci/ircbot-plugin/compare/ircbot-2.30...jenkinsci:ircbot-2.31

Version 2.30 (2017-08-25)

Version 2.27 (2016-03-03)

Version 2.26 (2015-02-19)

Version 2.25 (Apr 2, 2014)

Version 2.24 (Mar 29, 2014)

Version 2.23 (May 22, 2013)

Version 2.22 (Mar. 1, 2013)

Version 2.21 (Dec. 15, 2012)

Version 2.20 (Oct. 13, 2012)

Version 2.19

Version 2.18

Version 2.17

skipped

Version 2.16:

Version 2.15

Version 2.14

Version 2.13

Version 2.12

Version 2.11

Version 2.9

Version 2.8

Version 2.7

Version 2.6

Version 2.5

Version 2.4

Version 2.3

Version 2.2

Version 2.1

Version 2.0

Usage

When you install this plugin, your Hudson configuration page gets additional "IRC Notification" option as illustrated below:

 
In addition, each project should add a "Post-build Actions"> "IRC Notification" configuration as illustrated below:
 

 
For the project configuration, leave the Channels blank to default to the channels defined in the master IRC configration.