我正在使用git changeLogSets插件(https://wiki.jenkins.io/display/JENKINS/Git+Changelog+Plugin)
我正在尝试使用插件发送邮件。
我想从代码中发送一个变量。
样本;当我打印变量echo $ {exp}时,我希望它打印所有更改。如何使用数组或其他替代方法?
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
echo "${entry.commitId} by ${entry.author} on ${new Date(entry.timestamp)}: ${entry.msg}"
def files = new ArrayList(entry.affectedFiles)
for (int k = 0; k < files.size(); k++) {
def file = files[k]
echo " ${file.editType.name} ${file.path}"
}
}
}