Accessing The Current Build User In Jenkinsfile Pipeline 📎
To access the current user in the Jenkinsfile
install the
Build User Vars Plugin first.
After the installation the current user becomes available within the wrap
block:
wrap([$class: 'BuildUser']) {
echo "userId=${BUILD_USER_ID},fullName=${BUILD_USER},email=${BUILD_USER_EMAIL}"
}
See you at Java EE Workshops at MUC Airport, particularly at the Java EE Testing, Pipelines as Code, CI / CD, Testing and Quality workshop