Skip to content

jongyoul/gradle-slack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradle-slack-plugin

Slack plugin for Gradle

Usage

This plugin supports whole message structure of current slack. You can find full docs here: https://api.slack.com/docs/messages

The below is an example usage

slack {
  webhookUrl 'https://hooks.slack.com/services/TXXXXXXXX/BX/xxxxxxxx'
  message {
    text = "Project is built newly and deployed into *${deployMode.toUpperCase()}*"
    channel = '#channel-name'
    attachment {
      authorName = gitUsername
      color = 'good'
      title = "Branch: ${gitBranchName}(${gitCommitHash})"
      titleLink = "https://github.com/link/i/want/to/redirect"
      field {
        title = 'Built'
        value = 'Success'
        shortValue = true
      }
      field {
        title = 'Deployed'
        value = 'Success'
        shortValue = true
      }
      action {
        name: 'game'
        text: 'Chess'
        type: "button"
        value: "chess"
      }
      action {
        name: 'game'
        text: 'Thermonuclear War'
        style: 'danger'
        type: 'button'
        value: 'war'
        confirm {
           title: 'Are you sure?'
           text: 'Wouldn't you prefer a good game of chess?'
           okText: 'Yes'
           dismissText: 'No'
        }
      }    
    }
  }
}

About

Slack plugin for Gradle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages