有没有办法使用Jenkinsfile脚本管道语法触发Jenkins作业每小时运行一次?
我见过使用声明性语法的示例,但没有使用管道语法 .
Declarative Syntax Example
pipeline { agent any triggers { cron '@daily' } ... }
您可以将此代码段用于 Scripted pipeline syntax :
Scripted pipeline syntax
properties( [ ... , // other properties that you have pipelineTriggers([cron('0 * * * *')]), ] )
更多信息here .涵盖声明性管道的文档是here .
正确的版本是在Jenkinsfile“声明性管道”中:
pipeline { agent any triggers { cron('H */4 * * 1-5') } ... }
2 回答
您可以将此代码段用于
Scripted pipeline syntax
:更多信息here .
涵盖声明性管道的文档是here .
正确的版本是在Jenkinsfile“声明性管道”中: