1.安装插件
jenkins>>manage jenkins>> manage plugins>>可选插件>>搜索并安装插件: user build vars

2.插件介绍
Build User Vars Plugin是jenkins用户相关变量插件,使得在构建过程中可以使用用户相关环境变量
Variable | Description | 说明 |
BUILD_USER | Full name (first name + last name) | 全名 |
BUILD_USER_FIRST_NAME | First name | 名字 |
BUILD_USER_LAST_NAME | Last name | 姓 |
BUILD_USER_ID | Jenkins user ID | jenkins 用户ID |
BUILD_USER_EMAIL | Email address | 用户邮箱 |
3.注意
配置项中必须勾选Set jenkins user build variables,否则变量无法引用

4.配置详情

5.构建测试输出结果

######