• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Mindera/gradle-slack-plugin: Gradle plugin to send messages to Slack after each ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Mindera/gradle-slack-plugin

开源软件地址(OpenSource Url):

https://github.com/Mindera/gradle-slack-plugin

开源编程语言(OpenSource Language):

Java 64.4%

开源软件介绍(OpenSource Introduction):

gradle-slack-plugin

Gradle plugin to send Slack messages according to your build lifecycle. Useful to integrate with a CI server, to notify everyone that some gradle task has failed.

Build Passing Build Failing

Usage

The plugin is available in JitPack. Just add the following to your buildscript dependencies:

buildscript {

    repositories {
    	....
        maven {
            url "https://jitpack.io"
        }
    }
    
    dependencies {
    	...
        classpath 'com.github.Mindera:gradle-slack-plugin:1.0.7'
    }
}

Apply it:

apply plugin: 'com.mindera.gradle.slack'

Configuration

First you need to setup slack to receive incoming messages:

  1. Go to your_team.slack.com/services/new/incoming-webhook
  2. Press Add Incoming WebHooks Integration
  3. Grab your WebHook URL

Then in your build.gradle file:

slack {
    url 'your WebHook URL'
}

By default, everytime a build fails a slack message will be sent to the channel you configured. If a build succeeds nothing happens.

There are more optional fields that enable you to configure the slack integration:

slack {
    url 'your WebHook URL'
    dependsOnTasks 'testDebug', 'publishApkRelease'
    title 'my app name'
    enabled = isCDMachine()
}
  • dependsOnTasks: let you specify a list of tasks that will trigger a message to slack, in case of error and success;
  • title: the title of the slack message, can be the name of your app for instance;
  • enabled: a boolean to define if the slack integration is active or not, useful to avoid sending messages on your local builds.

Credits

Slack WebHook Java API by gpedro

License

gradle-slack-plugin is available under the MIT license. See the LICENSE file for more info.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap