小编Den*_*izU的帖子

如何使用一个或多个SCM在Jenkins工作流中获取罪魁祸首或提交者

从一个或多个SCM(通过checkout()或其他SCM步骤如git/svn)检出时,是否可以访问有关Jenkins工作流作业的提交者和/或罪犯的信息?

目的是使用该信息来通知提交者和/或罪犯有关工作状态的信息,例如在一个mail步骤中.

工作流定义的一个小示例:

node {
  // checkout from one or more SCMs, e.g.
  git url: '<URL>' 
  checkout([$class:...])
  ...

  // how can we know about committers or culprits at this point?
  $committers = ??

  // send a mail to committers or culprits
  mail to: '$committers', subject: 'JENKINS', body: '<information about the job status>'
}
Run Code Online (Sandbox Code Playgroud)

在运行SCM步骤之后,如何调整它以获取提交者的集合?

编辑:我目前正在使用Jenkins版本1.596.2和Workflow:Aggregator版本1.6,这似乎是JENKINS-24141中的一个未解决的问题

version-control jenkins jenkins-workflow jenkins-pipeline

6
推荐指数
4
解决办法
8108
查看次数