... | ... | @@ -44,8 +44,20 @@ This page is heavily based on the GitLab Jenkins plugin [webpage](https://plugin |
|
|
* Integration Token: `xxxxxxxxxx` from the Slack admin page above-mentioned.
|
|
|
* Channel: `sandbox`
|
|
|
<img src="../images/jenkins-slack-config.png" alt="" border=3>
|
|
|
|
|
|
* You can test the connection.
|
|
|
|
|
|
This will be used as authentification. The channel can be changed within the jenkins job.
|
|
|
|
|
|
# 4. Messaging within a pipeline #
|
|
|
|
|
|
A Slack message can be sent at any stage of the Jenkins pipeline script:
|
|
|
|
|
|
```java
|
|
|
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
|
|
slackSend channel: 'ci-enb', color: 'good', message: message2
|
|
|
```
|
|
|
|
|
|
* The message can only be one line long.
|
|
|
* Channel shall exist
|
|
|
* Color shall be one of `good`, `warning`, `danger`.
|
|
|
* More details at https://api.slack.com/docs/message-formatting |
|
|
\ No newline at end of file |