在 jenkins 构建计划中添加构建参数 [英] add build parameter in jenkins build schedule

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

问题描述

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

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

我想通过使用定期构建选项来做到这一点.

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

我有这样的输入:

*/1 * * * * Parameter1

如果我这样做,jenkins 会显示错误.

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 插件或在(管理 Jenkins -> 管理插件 -> 参数化调度程序).

However, to schedule a job at different times that needs to use different environments, you have to use the parameterized-scheduler plugin or search for it in (Manage Jenkins -> Manage Plugins -> Parameterized Scheduler).

示例:

 # 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.

这篇关于在 jenkins 构建计划中添加构建参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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