Jenkins构建结束需要通知客户下载项目WAR包,太麻烦且构建时间久的话可能忘记通知客户,想要构建结束自动邮件通知客户。
- # 安装mailx
- command -v mailx &> /dev/null || sudo yum -y install mailx
-
- # 发送邮件
- recipient="chang_wenqing@qq.com chang_wenqing@foxmail.com"
- subject="JENKINS构建通知"
- project_name="项目名称:XXXXXXXXXXXXXXXX"
- download_link="下载地址:http://YYYYYYYYYYYY"
- message="$project_name\n$download_link"
- echo -e "$message" | mail -s "$subject" "$recipient"