在特定阶段触发詹金斯管道

问题描述:

从现在开始,我一直在使用Jenkins,但是我想做些事情,但找不到方法...

I'm using Jenkins since a little moment now, but I wanted to do something and I can't find how to do it...

实际上,我想以两种不同的方式触发我的项目:每4小时和每次提交. 但是对于每种情况,我都不希望我的所有Jenkinsfile仅在某些特定阶段执行.

In deed, I want to trigger my projects with two differents way: every 4 hours and for every commit. But for each case, I don't want that all my Jenkinsfile is executed, only some specific stages.

是否可以使用声明性管道做到这一点?

Is it possible to do that with Declarative Pipelines ?

预先感谢

不幸的是,此功能尚未提供. Cloudbees有一个称为"checkpoints"的专有插件,可以做到这一点,

Unfortunately this is not available out of the box yet. Cloudbees has a proprietary plugin called "checkpoints" which can do that, see plugin docs here.

此插件可能会在不久的将来默认添加到Jenkins中,请参阅此问题.

This plugin may be added in Jenkins by default in near future, see this issue.

PS:这是 Jenkins构建管道-在阶段重新启动的副本(不能将其标记为重复)

PS: This is duplicate of Jenkins Build Pipeline - Restart At Stage (can't mark it as duplicated)