从 Jenkins 声明性脚本更新parameterizedCron 的值

问题描述 投票:0回答:0

我想使用声明性脚本中的脚本定期使用 Jenkins 作业中的参数更改“构建”中“计划”框中的值(参见图片),同时保持其他所有内容相同。 enter image description here

这就是我所做的:

properties([
        pipelineTriggers([parameterizedCron("H/15 * * * * % VERSION=1.2.3; ENV=prod")])
])

虽然它成功更改了我想要的值,但它也删除了构建触发器中的所有其他值(见图) enter image description here

如何使用参数定期更改“构建”的值,同时保留其他所有设置。

非常感谢。

jenkins jenkins-pipeline jenkins-groovy jenkins-declarative-pipeline build-triggers
© www.soinside.com 2019 - 2024. All rights reserved.