Jenkins Slack integration

后端 未结 8 797
一整个雨季
一整个雨季 2021-02-07 01:30

I want to use the Slack plugin in Jenkins to ping notifications to a Slack channel.

Jenkins says success when I test the connection, but I don\'t receive any notificatio

8条回答
  •  佛祖请我去吃肉
    2021-02-07 02:18

    There are two steps to configure a Jenkins job to be posting on a slack channel.

    1. Go to jenkins job configurations and add a post-build action on each job that you wish to ping the slack channel.

    1. Next, again under the job configurations, you have to configure on each job on which cases you wish to send slack notifications: (true - false) f.e.

    In the case that you have to configure a great number of Jenkins jobs, you could configure only one of them manually and verify it is working fine. Then check the config.xml of this Jenkins job to find the auto-generated xml elements for the slack plugin preferences and apply those configs on all Jenkins jobs by using regex or xslt. In this case, you will have to reload the Jenkins configs for the job configurations updates to be applied. ("Manage Jenkins" / "Reload Configuration from Disk")

    Prerequisites:

    • Install slack plugin in Jenkins.
    • Obtain a Jenkins CI integration token in your slack domain.
    • Go in Jenkins "Manage Jenkins" / "Configure System". There you have to configure the "Global Slack Notifier Setting".

提交回复
热议问题