2017-08-22 35 views
0

我正在尋找一種使用某種配置管理方式添加/刪除/更新Jenkins主環境變量的方法。如何使用配置管理來配置Jenkins?

如果這可以用Ansible做得更好。

請注意,我想避免手動補丁config.xml文件,特別是因爲這將有可能產生問題,將需要重新啓動詹金斯,這是要避免的,只要是可能的。

如果不清楚,我正試圖找到一個自動化解決方案來更改Manage Jenkins - Configure System - Global properties

+0

你見過http://docs.ansible.com/ansible/latest/list_of_all_modules.html? – Kyslik

回答

0

你可以使用groovy配置你所有的Jenkins master。

我只是做同樣的,當我們升級到詹金斯2.

這裏有一些鏈接:https://pghalliday.com/jenkins/groovy/sonar/chef/configuration/management/2014/09/21/some-useful-jenkins-groovy-scripts.html

https://github.com/DotCi/jenkinsci-dotci-example/blob/master/configure-dotci.groovy

https://gist.github.com/vrivellino/97954495938e38421ba4504049fd44ea

BTW,您可以使用插件CLI它安裝將爲您節省時間。

,您可以創建使用DSL,因此所有的改變將在github上的所有作業。

如果你有具體的問題,讓我知道