在多个条件下安排 Jenkins 的夜间构建

Scheduling a nightly build in Jenkins with multiple conditions

我想在满足以下条件时触发 Jenkins 构建:

我只能使用 定期构建 触发器每晚 运行 它(无论是否有提交),或者只能在提交之后使用 Poll SCM 触发器或仅使用来自 Stash 的 webhook。

我试过同时使用 Poll SCMBuild periodically 但它结束了但从未 运行ning。

有没有人能解决这个问题?

我希望我的每晚 运行 只有在有发展 activity 的情况下。

参见Git Plugin, Environment Variables

The git plugin sets several environment variables you can use in your scripts:

  • GIT_COMMIT - SHA of the current

  • ...

  • GIT_PREVIOUS_COMMIT - SHA of the previous built commit from the same branch

如果这些相同,则没有变化。在 Conditional BuildStep Plugin 中使用它们来决定您的夜间是否应 运行。