Jenkins自动重新加载配置可能吗? [英] Jenkins Auto Reload Configuration Possible?

查看:89
本文介绍了Jenkins自动重新加载配置可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两台Jenkins服务器,它们共享一个作业目录,以实现高可用性. 但是,如果一台服务器构建了任何工作区,则另一台服务器将无法构建它,因为它们将下一个可用的内部编号存储在内存中.

I have two Jenkins servers with sharing one jobs directory to make high availability. However if one server built any of the workspace, another server will fail to built it, because they store next available built number in the memory.

所以我需要一个可以定期自动重新加载作业配置的插件.有人知道合适的插件吗?

So I need a plugin that can auto reload job's configuration periodically. Does anyone know about a suitable plugin?

推荐答案

我不知道这种插件是否存在.但是,要定期重新加载作业的配置,可以结合crontab实用程序以编程方式使用.

I don't know whether this kind of plugin exists or not. But to reload job's configuration periodically, you can use a programmatically way by combining with the crontab utility.

第1步:

编写Groovy脚本reload-config进行重新加载配置.

Write a Groovy script reload-config to do the reload configuration.

第2步:

java -jar jenkins-cli.jar -s http://jenkins_url/ groovy reload-config.groovy

第3步:

设置crontab任务以执行步骤2.

Setup an crontab task to execute Step 2.

这篇关于Jenkins自动重新加载配置可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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