How can I get the SVN log entry in Jenkins when sending email

拟墨画扇 提交于 2019-12-22 17:47:38

问题


I'm trying to create an automated build at work using Jenkins. We're using SVN for version control. When a build is successful I would like to send an email to my team saying... Person X has committed the following changes.

How can I include the committers name and the last SVN log entry in the body of the email? I'm using the Jenking email-ext plugin.

Thanks!


回答1:


Subject line:

To display the committer(s) of the last build, you can put the following into the subject line anywhere you want. Do note that if multiple people have committed since the last build, multiple names will be shown, hence the (space) in "%a ".

${CHANGES, format="%a "}has/have committed the following changes

Or to display a list of culprits that broke the build

Build broken by ${CHANGES_SINCE_LAST_SUCCESS, reverse=true, format="%c", changesFormat="%a "}

Unfortunately, if a culprit's name appears several times in commit messages, it will appear several times in the subject too.

SVN log in the email

To get the SVN log into the email, I use the following:

${CHANGES_SINCE_LAST_SUCCESS, reverse=true, format="<b>Changes for Build #%n</b><br>%c<br>", changesFormat="<br>[<a href='${JENKINS_URL}/user/%a/builds'>%a</a>] - (%r) %p<br> %m<br>"}

This was all pulled together from the Content Token Reference on-page help with lots of trial and error. Scroll to the bottom of your email-ext configuration, and click the ? icon in-line with Content Token Reference text (it may take a while to load)

Produces output similar to:


Changes for Build #123

[commiter_name] - (1234567) /svn/path/to/changed.files
Commit message here




来源:https://stackoverflow.com/questions/16444800/how-can-i-get-the-svn-log-entry-in-jenkins-when-sending-email

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!