Infrastructure at your Service

Nabil Saoual

JENKINS add and configure Slack notifications

By May 12, 2021 DevOps No Comments

Hi team,
If you wonder how to improve your team work efficiently during your Jenkins projects here is a good solution: configure slack notifications,what is slack notification?how can we configure for our Jenkins builds?
Below we will see how to work on Jenkins using slack notifications,so let’s go!

Create a Slack workspace

Slack allows you to create a workspace on which you will be able to communicate with you team on your projects and can be linked to Jenkins to send you notification regarding your builds and pipelines
First step is to go on https://slack.com/intl/en-fr/get-started#/landing

Create an account

Create your workspace


Fill the steps with your company name and name your project, you can also add your teammates




Once done , your workspace will be ready to use

Add Jenkins app to slack and define credentials

Go to the left panel and select Apps->select Jenkins and add it to slack

Select the channel on which you will receive your Jenkins notifications


When integrating Jenkins you will have steps to follow especially step 3

Step 3 contains the credential to be used on your Jenkins configuration

Define your Slack account in Jenkins

First of all you must install the slack notification plugin
To do so go on plugin management and look for slack notification plugin

You have some explanation on this plugin if you click on the info part

Plugin is now installed , some features will appear in the builds and on Jenkins system configuration

Define slack account in Jenkins system configuration and test connexion

Create credential provider to be used on builds and on Jenkins system configuration

Go on Jenkins system configuration part and add credentials

When the connexion test is OK you can check on Slack and see that you are linked to you Jenkins
you will have a notification popping up
Now we just have to create a build and check if notifications from Jenkins will come to Slack workspace.

Create a freestyle job

To use slack notification you must add it in post build part

Add your credential workspace name and test the connexion (you should receive a notification on Slack if it is successful on the bottom right hand corner)

Select in which case the notification will be sent ( failure success starting … )

Start you build

We see notifications popping up as build is started lets check on Slack if we received that

Go on your slack workspace and check if notifications from Jenkins are coming


Click on open to check the build’s output

And that’s it 🙂 !You are able now to share your Jenkins projects with your team and also analyse the outputs and fix it quicker with an efficient team work

Conclusion

You have now a simple solution to receive notifications from your Jenkins builds and share it with your team.
A great tool to manage your projects with live comments and high interactivity!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Nabil Saoual
Nabil Saoual

Consultant