simple-slack-api
simple-slack-api copied to clipboard
How to use in gradle tasks
I'm working on automation of android build pipeline and we currently have this
task notifyHipChatOfNewAlpha(type: com.glasstowerstudios.gruel.tasks.hipchat.HipChatNotificationTask,
dependsOn: preUploadAlpha) {
ext.destDir = new File(buildDir, 'generated')
outputs.dir destDir
outputs.upToDateWhen {
gitSha('latest-alpha') == gitSha('HEAD')
}
def alphaCommit = gitSha('HEAD')
color = 'purple'
message = "New alpha build available: <a href=\"https://fabric.io/thisclicks/android/apps/*************/beta/releases/latest\">${project.name}-${project.APP_VERSION_NAME}-${alphaCommit}</a>"
channelName = "Android Development"
}
That I need to replace with slack notifications. I was wondering how I might do this using this library.
For a single notification, I would not use this entire bot library. The time taken to connect, send the message, and disconnect is not worth it. Instead, you should use an HTTP call to send a message to your channel.
This library is better suited to handling a long lived bot connection.