在詹金斯建造时间表中添加建造参数 [英] add build parameter in jenkins build schedule

查看:198
本文介绍了在詹金斯建造时间表中添加建造参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份詹金斯的工作.我想使用build参数在特定时间内构建我的工作.

I have a jenkins job. i want to build my job in a specific time with a build parameter.

我想通过使用Build periodically选项来做到这一点.

I want to do this by using the Build periodically option.

我有这样的输入:

*/1 * * * * Parameter1

如果我这样做,詹金斯会显示一个错误.

If I do this, jenkins show an error.

是否可以不使用任何插件.

如果不是,那么哪个插件会更好

if not, than which plugin will be better

或者有一种方法可以在计划表中提供参数的位置吗?

Alternatively is there a way to give parameter's here in the schedule?

我的实际需求是这样的:

My actual requirement is like this:

 build in morning using one parameter
 build in evening using another parameter.    

推荐答案

基本上,使用定期构建"选项无法安排带有参数的Jenkins作业.

Basically, with the Build periodically option you can't schedule a Jenkins job with parameters.

但是,要在需要使用不同环境的不同时间安排作业,您必须使用如上所述的parameterized-scheduler插件

However, to schedule a job at different times that needs to use different environments, you've to use the parameterized-scheduler plugin as mentioned above https://github.com/jwmach1/parameterized-scheduler or search it in (Manage Jenkins -> Manage Plugins -> Parameterized Scheduler). so it'll be like #Parameter1 H/15 * * * * %Parameter1 #Parameter2 H/30 * * * * %Parameter2 Remember you have to have your parameters already setup because the plugin is visible only for jobs with parameters.

节点和标签"参数插件可以提供帮助,因为它允许您假设已经配置了不同的服务器qa1和qa2来选择单个节点.希望能为您澄清一切.

The Node and Label parameter plugin can help since it allows you to select individual nodes assuming your different servers qa1 and qa2 are already configured. Hope that clarifies things for you.

这篇关于在詹金斯建造时间表中添加建造参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆