ci: add username and email to build notifications

Makes it easier to identify who to talk to about a deployment.

This depends on the following plugin being installed:
https://plugins.jenkins.io/build-user-vars-plugin/

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-10-12 11:17:47 +02:00
parent 3a7f2608b3
commit 8f783aac25
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
1 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,9 @@ pipeline {
commit: GIT_COMMIT.take(8),
prev: (env.GIT_PREVIOUS_SUCCESSFUL_COMMIT ?: env.GIT_PREVIOUS_COMMIT ?: 'master').take(8),
]
wrap([$class: 'BuildUser']) {
BUILD_USER_ID = env.BUILD_USER_ID
}
discordSend(
title: "${env.JOB_NAME}#${env.BUILD_NUMBER}",
description: """
@ -81,6 +84,7 @@ pipeline {
Branch: [`${repo.branch}`](${repo.url}/commits/${repo.branch})
Commit: [`${repo.commit}`](${repo.url}/commit/${repo.commit})
Diff: [`${repo.prev}...${repo.commit}`](${repo.url}/compare/${repo.prev}...${repo.commit})
By: [`${BUILD_USER_ID}`](${repo.url}/commits?author=${BUILD_USER_ID})
""",
link: env.BUILD_URL,
result: currentBuild.currentResult,