Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1060 from LiskHQ/1059-jenkins-slack
Browse files Browse the repository at this point in the history
Update Jenkinsfile for slack integration
  • Loading branch information
Nazgolze authored May 7, 2018
2 parents 51fee93 + 726fecd commit 55e32c5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ def get_build_info() {
def slack_send(color, message) {
/* Slack channel names are limited to 21 characters */
CHANNEL_MAX_LEN = 21
CHANNEL_SUFFIX = '-jenkins'

channel = "${env.JOB_NAME}".tokenize('/')[0]
channel_len = CHANNEL_MAX_LEN - CHANNEL_SUFFIX.size()
if ( channel.size() > channel_len ) {
channel = channel.substring(0, channel_len)
channel = channel.replace('lisk-', 'lisk-ci-')
if ( channel.size() > CHANNEL_MAX_LEN ) {
channel = channel.substring(0, CHANNEL_MAX_LEN)
}
channel += CHANNEL_SUFFIX
echo "[slack_send] channel: ${channel} "

echo "[slack_send] channel: ${channel} "
slackSend color: "${color}", message: "${message}", channel: "${channel}"
}

Expand Down

0 comments on commit 55e32c5

Please sign in to comment.