2016-11-25 14:36:37 -05:00
|
|
|
# Slack Notifications Service
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
## On Slack
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
To enable Slack integration you must create an incoming webhook integration on
|
|
|
|
Slack:
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
1. [Sign in to Slack](https://slack.com/signin)
|
|
|
|
1. Visit [Incoming WebHooks](https://my.slack.com/services/new/incoming-webhook/)
|
|
|
|
1. Choose the channel name you want to send notifications to.
|
|
|
|
1. Click **Add Incoming WebHooks Integration**
|
|
|
|
1. Copy the **Webhook URL**, we'll need this later for GitLab.
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
## On GitLab
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
After you set up Slack, it's time to set up GitLab.
|
|
|
|
|
2016-11-25 14:36:37 -05:00
|
|
|
Go to your project's **Settings > Services > Slack Notifications** and you will see a
|
2016-07-19 12:33:02 -04:00
|
|
|
checkbox with the following events that can be triggered:
|
|
|
|
|
|
|
|
- Push
|
|
|
|
- Issue
|
|
|
|
- Merge request
|
|
|
|
- Note
|
|
|
|
- Tag push
|
|
|
|
- Build
|
|
|
|
- Wiki page
|
|
|
|
|
|
|
|
Bellow each of these event checkboxes, you will have an input field to insert
|
|
|
|
which Slack channel you want to send that event message, with `#general`
|
|
|
|
being the default. Enter your preferred channel **without** the hash sign (`#`).
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
At the end, fill in your Slack details:
|
2016-07-12 16:00:49 -04:00
|
|
|
|
|
|
|
| Field | Description |
|
|
|
|
| ----- | ----------- |
|
2016-07-19 12:33:02 -04:00
|
|
|
| **Webhook** | The [incoming webhook URL][slackhook] which you have to setup on Slack. |
|
|
|
|
| **Username** | Optional username which can be on messages sent to slack. Fill this in if you want to change the username of the bot. |
|
|
|
|
| **Notify only broken builds** | If you choose to enable the **Build** event and you want to be only notified about failed builds. |
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
After you are all done, click **Save changes** for the changes to take effect.
|
|
|
|
|
|
|
|
>**Note:**
|
|
|
|
You can set "branch,pushed,Compare changes" as highlight words on your Slack
|
|
|
|
profile settings, so that you can be aware of new commits when somebody pushes
|
|
|
|
them.
|
|
|
|
|
|
|
|
![Slack configuration](img/slack_configuration.png)
|
2016-07-12 16:00:49 -04:00
|
|
|
|
2016-07-19 12:33:02 -04:00
|
|
|
[slackhook]: https://my.slack.com/services/new/incoming-webhook
|