3
有沒有辦法檢索Jenkins Pipeline中打破構建的個人列表,就像郵件插件顯然確實發送郵件給那些參與?如何獲取在Jenkins管道中打破構建的個人列表
有沒有辦法檢索Jenkins Pipeline中打破構建的個人列表,就像郵件插件顯然確實發送郵件給那些參與?如何獲取在Jenkins管道中打破構建的個人列表
我發現了一種可能的方式,儘管它受限於構建的數量。通過循環previousBuild
層次和其更改日誌,這可能是一個解決方案:
def getAuthors(def build) {
def userIds = []
build.changeSets.each { hudson.scm.SubversionChangeLogSet changeLogSet ->
userIds += changeLogSet.collect { it.author.id }
}
userIds.unique()
}
def getIndividualsWhoBrokeTheBuild() {
def userIds = []
for(def build = currentBuild; build.result != 'SUCCESS'; build = build.previousBuild) {
userIds += getAuthors(build)
}
userIds.unique()
}
假設一個工作讓只有五個版本,這將不會返回原來的罪犯,如果它被打破五年多前建立。
當然,如果你刪除數據,你不能再訪問它;-) – StephenKing
是的,但郵件插件以某種方式跟蹤原始提交沒有這種限制,是嗎? – Jazzschmidt