Verified Commit 7c6fbf3c authored by Renato Alves's avatar Renato Alves 🌱
Browse files

Add EMBL GitLab - Slack integration post

parent a8bf8ffa
date: 2020-09-10
tags: ["Renato Alves", "Christian Arnold", "Bio-IT", "Community", "Slack", "GitLab", "Integration", "Chat"]
title: "Connecting EMBL GitLab and Slack"
omit_header_text: true
This quick tutorial shows you how to connect [EMBL GitLab][embl-gitlab] with a Slack workspace. This can be very useful when you want to stay informed about activities in your repository without having to check your emails all the time - in fact, you may decide to disable email notifications for the repository because Slack notifications are quicker to see, manage and act upon!
This tutorial also shows you the power of so-called [webhooks][gitlab-webhook]! Webhooks are a very powerful technique to connect different services with one another via automated notifications. If you haven't heard about this concept, you can find nice introductions with illustrations [here]( or [here](
So let's start to connect EMBL Gitlab and Slack!
## Setting up Slack
We start with Slack!
First, decide in which channel the automated notifications should appear in. Either use an existing channel (public or private) or, as in my case, create a new repository-specific channel that exists only for the purpose of receiving automated notifications. For the following example, we call the channel `notifications_project1`.
You then need to install a Slack App called [**Incoming WebHooks**][incoming-webhooks] in your workspace. Click **Add to Slack**
and specify the Slack channel that shall be used for the integration (`notifications_project1`).
Finally, hit the **Add Incoming WebHooks Integration** button and you are set. If all goes well, you should now see a **Webhook URL** field. Make sure to copy this address, which you will need in the next step.
## Setting up Gitlab
Now let's configure Gitlab!
Go to the landing page of the Gitlab repository you want to add the integration to, navigate to **Settings > Integrations > Slack notifications**.
Now, select all triggers you want to receive automated notifications for and enter the exact name of the Slack channel this should be sent to (here: `notifications_project1`). Lastly, paste the webhook URL from Slack in the **Webhook** field and select for an arbitrary name that should be displayed in Slack for incoming messages. I choose **automated_notifications** to make it clear this was a message that was automatically generated.
Hit the **Test settings and save changes** button and you should be good to go!
## Test whether it works
After hitting the **Test settings and save changes** button, you should already have a new notification in your corresponding Slack channel. If not, revise all settings. Now, if you create a new issue, for example, you should receive a new notification instantly.
## Disabling the integration
If this integration didn't work the way you expected or you'd like to have it disabled, you need to undo the previous two steps.
### Slack
Re-visit the Slack App page [**Incoming WebHooks**][incoming-webhooks] where you will find an active configuration.
Click the little pencil icon and in the top-right corner of the following page hit **Disable** or **Remove**.
### GitLab
On Gitlab visit **Settings > Integrations > Slack notifications** once again and you will find a blue **Enable integration** button. Disable that and you are all set.
## Be productive
Hopefully, this helps you to stay (even more) productive. Webhooks can be used in many other cases that support it. You may want to disable email notifications now for the repository.
Let us know if something is unclear!
Christian Arnold & Renato Alves
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment