A Simple Jenkins Build Status Notifier for IFTTT Maker Channel Trigger
Posts the build status to IFTTT Maker Channel to trigger actions with all other Channels available on IFTTT. For example notify build status via a tweet or add trello card or Light-up a IoT connected device.
Create an installable artifact:
git clone https://github.com/jenkinsci/ifttt-build-notifier-plugin.git
cd ifttt-build-notifier
mvn clean install
- Install Plugin via Manage Jenkins > Plugins > Advanced > Upload
./target/ifttt-build-notifier.hpi
- Restart Jenkins ([$JENKINS_URL]/restart)
Let's setup a notification trigger with following steps. This will send a direct twitter message when a build job is completed:
Login to https://ifttt.com and perform the following steps:
- Create a new Recipe
- Click on
this
part - Enter or select
Maker Channel
inChoose Trigger Channel
- Select
Receive a Web Request
inChoose a Trigger
- Enter an Event name (for example
build_notification
) - Click on
Create Trigger
button - Next, click on
that
part - Enter or select
Twitter
inChoose Action Channel
- Select
Send a direct message to yourself
inChoose an Actin
- Enter following message in
Message field
inComplete Action Fields
Jenkins Build Status for Project: {{Value1}}, Build Number:{{Value2}}, Status: {{Value3}}
Note: IFTTT Maker Channel Receive a Web Request
trigger accepts three values and plugin sends Project Name as Value1, Build Number as Value2 and Status as Value3
- Finally click on
Create Action
button - Give a name to newly created recipe
- Click on
Create Recipe
button to create the recipe - Now, navigate to https://ifttt.com/maker
- Copy the Key from
Your key is:
section
You can also use template recipe from here https://ifttt.com/recipes/336376-send-a-direct-tweet-when-jenkins-build-is-completed (see more recipes below)
Back in Jenkins setup a project to send build notifications:
- Configure a Job or Project for which you want to enable IFTTT trigger
- Add
IFTTT Build Notifier
action fromAdd Post Build Action
list - Enter
Event Name
specified in Step#4 above (for examplebuild_notification
) - Enter
Key
copied from Step#14 above - Save the configuration
- That's it
Now whenever a build is triggered and completed, you will see a Twitter message with build status
More Recipe Templates:
- Sending build notification to your smartphone (requires IF app) - https://ifttt.com/recipes/336400-jenkins-build-notification-to-phone
- Sending build notification to your Android Smart Watch https://ifttt.com/recipes/336401-jenkins-build-notification-to-android-watch