slack作为目前团队交流的头号先锋,在我们的项目协调中发挥着很大的作用。其中一项就是实时推送gitlab中的各种动态,此时就需要搭建一个桥梁用来连接,使之实现通讯
Slack Service
On Slack
To enable Slack integration you must create an incoming webhook integration on Slack:
- Sign in to Slack
- Visit Incoming WebHooks
- Choose the channel name you want to send notifications to.
- Click Add Incoming WebHooks Integration
- Copy the Webhook URL, we’ll need this later for GitLab.
On GitLab
After you set up Slack, it’s time to set up GitLab.
Go to your project’s Settings > Services > Slack and you will see a 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 (#
).
At the end, fill in your Slack details:
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.