Skip to content

Instantly share code, notes, and snippets.

@marcosborges
Last active January 21, 2019 15:45
Show Gist options
  • Save marcosborges/4399b540965b1d7911ebf6ece8e5fcb3 to your computer and use it in GitHub Desktop.
Save marcosborges/4399b540965b1d7911ebf6ece8e5fcb3 to your computer and use it in GitHub Desktop.
def slackfy(msg){
def hookURL = "https://hooks.slack.com/services/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"
def payload ="""{"text":"${msg}","username":"Jenkins","icon_emoji":":jenkins:"}"""
sh "curl -s -X POST --data-urlencode \'payload=${payload}\' ${hookURL}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment