Jenkins Invalid Git Revisions

北战南征 提交于 2019-12-05 20:57:35

My guess is that the scm plugin parses the build log after the build run to extract the revision data. If you use the Multiple SCM plugin, a Jenkins Pipeline with multiple git or checkout commands or a Jenkins Shared Library it is very well possible to end up with multiple scm revisions from multiple repositories (we currently have 6 in our of jobs...).

I don't know if it is possible to ignore parts of the log for the SCM revision parsing, otherwise you'll have to do some filtering on your side of the request. If the different revisions happen in order in the log, then you can choose to always discard the first or second one.

One possible case is when:

  • Jenkins records a SHA1 for origin/master in its lastBuiltRevision
  • someone force push (git push --force) and overwrite the SHA1 with a new history
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!