Git Product home page Git Product logo

gradle-slack-plugin's 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.

gradle-slack-plugin's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.