Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Mindera/gradle-slack-plugin
Gradle plugin to send messages to Slack after each build
https://github.com/Mindera/gradle-slack-plugin
Last synced: 2 months ago
JSON representation
Gradle plugin to send messages to Slack after each build
- Host: GitHub
- URL: https://github.com/Mindera/gradle-slack-plugin
- Owner: Mindera
- License: mit
- Created: 2015-05-06T16:05:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-05T22:06:25.000Z (about 5 years ago)
- Last Synced: 2024-08-04T03:03:54.691Z (6 months ago)
- Language: Java
- Size: 69.3 KB
- Stars: 153
- Watchers: 57
- Forks: 24
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-gradle - gradle-slack-plugin - Send messages to Slack after each build. (Plugins / Notification)
README
# 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](http://i.imgur.com/eIq9hp1.png)
![Build Failing](http://i.imgur.com/cgf5fHf.png)## Usage
The plugin is available in [JitPack](https://jitpack.io/). Just add the following to your buildscript dependencies:
```groovy
buildscript {repositories {
....
maven {
url "https://jitpack.io"
}
}
dependencies {
...
classpath 'com.github.Mindera:gradle-slack-plugin:1.0.7'
}
}
```Apply it:
```groovy
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 URLThen in your build.gradle file:
```groovy
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:
```groovy
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](https://github.com/gpedro/slack-webhook) by [gpedro](https://github.com/gpedro)
## License
gradle-slack-plugin is available under the MIT license. See the LICENSE file for more info.