simple-slack-api icon indicating copy to clipboard operation
simple-slack-api copied to clipboard

How to use in gradle tasks

Open moos3 opened this issue 8 years ago • 1 comments

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.

moos3 avatar May 09 '17 18:05 moos3

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.

dkowis avatar Jun 05 '17 02:06 dkowis