Skip to content

Instantly share code, notes, and snippets.

@schnittchen
Created July 22, 2014 22:02
Show Gist options
  • Save schnittchen/05406adf2208f9f188d2 to your computer and use it in GitHub Desktop.
Save schnittchen/05406adf2208f9f188d2 to your computer and use it in GitHub Desktop.
Hacked jenkins integration for slack
// Install the "Groovy Postbuild" plugin and use this as postbuild script:
def message = "${manager.build.result}" + ': ' + manager.build.getDisplayName() + ' ' + manager.build.getAbsoluteUrl()
def command = ['sh', '-c', 'echo "' + message + '" | curl --data-binary @- "https://YOURSLACKDOMAIN/services/hooks/slackbot?token=YOUR_SLACKBOT_INTEFGRATION_TOKEN&channel=URL_ENCODED_CHANNEL_NAME"' ]
command.execute()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment