如何保存Jenkins配置? [英] How to save Jenkins configuration?
问题描述
是否有任何方法可以在Git或其他任何地方保存管道配置或项目配置,以便当我的Jenkins机器崩溃时,我可以在新的Jenkins实例中迁移保存的配置?
我会(一开始)让自己- https://wiki.jenkins.io/display/JENKINS/JobConfigHistory+Plugin 保留了对Jobs,系统配置等所做的所有更改的历史记录-多次保存了我.>
此外,您可以在Jenkins外部设置一个cron作业,以git push您的Job配置.
我设置为推送Jobs文件夹内容(包括构建历史记录-但您可以排除它- 这种方式让我放心,我将RSYNC同步到另一个盒子,并且我也有一个Backup插件正在运行...(我被刺伤了一次-再也没有!) 希望这会有所帮助. Is there any way to save a pipeline configuration or an item configuration in Git or anywhere else, so that when my Jenkins machine is crashed, i can migrate the saved configuration in the new Jenkins instance? I would ( as a start ) get yourself - https://wiki.jenkins.io/display/JENKINS/JobConfigHistory+Plugin which keeps history of all Changes made to Jobs , System config etc - has saved me multiple times. Also , you could setup a cron job outside Jenkins to git push your Job config. I setup to push the Jobs folder content ( including Build history - but you could exclude that - Correctly ignore all files recursively under a specific folder except for a specific file type ref ) . My script ( i had SSH stuff previously setup ) This way gives me piece of mind , I have RSYNC to another box and I also have a Backup plugin running too... ( i was stung once - not again! ) Hope this helps. 这篇关于如何保存Jenkins配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!cd /this/that/other/jenkins_data/jobs/
NOW=$(date +"%m-%d-%Y-%r")
git add .
git commit -m "Jenkins Backup $NOW"
git push -u origin jenkins-backup