Ohhh, nice!
Thanks for the example Michael.

On Friday, June 30, 2017 at 5:41:38 PM UTC+3, mpapo - Michael Pailloncy 
wrote:
>
> Alternatively, you can create your own Pipeline method, a bit like this 
> one : 
> https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/slacknotify/slackNotify.groovy
>   
> Since it's a simple curl, you can then directly use all the existing 
> options/parameters offered by the Slack REST API.
>
> Note that it's better to centralized this method inside a Global Shared 
> Library (just in case you are not already using it :))
>
>
> 2017-06-30 16:11 GMT+02:00 Idan Adar <[email protected] <javascript:>>:
>
>> Anyone? :)
>>
>> On Tuesday, June 27, 2017 at 8:13:35 PM UTC+3, Idan Adar wrote:
>>>
>>> In a Node.js app, one can use the slack-notify package to send something 
>>> like this:
>>>
>>>
>>> slack.send({
>>>       "username": "myBotName",
>>>       "icon_emoji": ":robot_face:",
>>>       "mrkdwn": true,
>>>       "attachments": [
>>>          {
>>>             "mrkdwn_in": ['text','pretext'],
>>>             "color": "#199515",
>>>             "text": message,
>>>             "fallback": "*my*: _markdown_ message."
>>>          }
>>>       ]   
>>>    });
>>>
>>> In a Jenkinsfile, one can do this:
>>> slackSend (
>>>        color: '#F01717',
>>>        message: "$JOB_NAME: <$BUILD_URL|Build #$BUILD_NUMBER>, my 
>>> message."
>>> )
>>>
>>> I'm looking for a way to accomplish the Node implementation, but using 
>>> slackSend so that the message dispatched from the Jenkinsfile will be 
>>> on-par with the Node.js-sent message.
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/deaa0550-128a-4513-8972-0cf991d49bbd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/deaa0550-128a-4513-8972-0cf991d49bbd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/85f506e6-27ed-46c5-8c1f-5f9a0ac445df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to