Jenkins is a continuous integration switchboard centralizing the communication with many different protocols, such as SSH, Git and SVN. This blog entry will focus on the IRC protocol and how one can turn Jenkins into IRC bot with the IRC plugin.
When the IRC plugin is installed and configured, Jenkins can send notification messages to a chat room (or channel), such as build information, and users can send messages to Jenkins to obtain information and perform actions, such as builds.
Stable Release Versions
The latest release of the IRC plugin is 2.18 and was released in November 2011. It has known issues.
Requirements for Plugin-Use
Jenkins 1.392 or newer and the utility plugin “instant-messaging” (called “Instant Messaging plugin”).
To demonstrate the use of the IRC bot plugin I first set up a test channel at FreeNode called ##jenkins-irc-bot-test. Then I configured Jenkins, from the main configuration page, to connect to FreeNode and that channel:
Using the Mac OS Colloquy chat client, I can connect to the same channel and also connect to Jenkins itself for the configured nickname, jenkins-irc-bot-nick, and send commands, such as !jenkins help that lists all the commands:
The command prefix !jenkins identifies a chat message as a command and is configurable from the IRC configuration section of the main Jenkins configuration page.
I set up a job called test and then “chatted” a few commands:
The transcript shows that I first listed all the jobs and also obtained the status of the job test. Then I built job test, checking the queue, and finally checking the status again. The chat room (or channel) ##jenkins-irc-bot-test shows that there are two new messages:
Jenkins is sending messages that the test job was started and completed. I configured the job test to send such messages:
—Paul Sandoz, Developer