Jenkins Job Builder Slack Plugin

With the proliferation of Slack and the general ChatOps movement I figured it would be a good idea to add Slack notifications to my Jenkins jobs after a coworker of mine implemented Slack in our environment. In our CI environment we are using Jenkins Job Builder (http://docs.openstack.org/infra/jenkins-job-builder/) to automate the configuration of our Jenkins jobs. Unfortunately I was unable to find any native support for configuring Slack notifications but stumbled upon a plugin created by Åsmund Grammeltvedt. The following steps cover adding support for slack to Jenkins Job builder.

Install the Slack plugin using pip

pip install https://pypi.python.org/packages/source/j/jenkins-jobs-slack/jenkins-jobs-slack-0.3.2.tar.gz#md5=390d4602cca9e312390b49e74a5c5835

Example configuration settings for slack


- project:
  name: foo
  properties:
    - slack:
        notify-start: true
        notify-success: true
        notify-aborted: true
        notify-notbuilt: true
        notify-unstable: true
        notify-failure: true
        notify-backtonormal: true
        notify-repeatedfailure: true
        include-test-summary: true
        show-commit-list: true
        room: '#jenkins'
        token: secret
        team-domain: example.com
        include-custom-message: true
        custom-message: message

  publishers:
    - slack:
        team-domain: example.com
        auth-token: secret
        build-server-url: https://jenkins.example.com
        room: '#jenkins'

References:

https://github.com/asmundg/jenkins-jobs-slack