我有几个詹金斯的例子。每个Jenkins都有自己的配置、节点等。它们也有适当的别名:
其中一个是詹金斯的游乐场,但这并不重要。
是否有一种方法或最佳实践来保存和管理Jenkins的许多实例?不同的主机上。我不需要共享节点,我知道这里有gearman工具。
现在我还不能百分之百确定它应该是什么样子。简单的页面,所有的实例,以方便之间的切换,运行Jenkins网络接口的框架。用于*.jenkins.domain.tld的JS用户脚本。
我回来了
我目前正在使用简单主题插件,并添加了一些JS:
jQuery(function($) {
var currentUrl = window.location.pathname;
var switchTool = '<div class="dropdown task" id="switch-jenkins" >'+
'<a class="task-icon-link" href="#">'+
'<img class="icon-switch-jenkins icon-md" src="/userContent/image/switch-jenkins.png">'+
'</a>'+
'<a class="task-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'+
'Switch Jenkins to'+
'</a>'+
'<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">'+
'<a class="dropdown-item" href="#" style="display: none"></a>'+
'<a class="dropdown-item" href="http://jenkins1.tld' + currentUrl + '"><img class="icon-switch-jenkins" src="/userContent/image/jenkins1.png">jenkins1</a>'+
'<a class="dropdown-item" href="http://jenkins2.tld' + currentUrl + '"><img class="icon-switch-jenkins" src="/userContent/image/jenkins2.png">jenkins2</a>'+
'</div>'+
'</div>';
var switchContainer = $('#side-panel :first').addClass('switch-container');
switchContainer.prepend(switchTool);
$('#switch-jenkins').focusout(function(){
setTimeout(function(){ document.getElementById("switch-jenkins").style.display="block";},200);
});
});发布于 2020-08-13 22:01:57
我不知道任何既定的最佳做法。
我通过编写一个程序来解决这个问题,该程序生成一个HTML页面,该页面在单个页面上显示多个Jenkins主程序上的所有作业。作业应该有独特的名称(比如"projectA-taskC"),这样它们就可以很容易地围绕不同的主程序(由于故障、维护、负载等原因)。每当事情发生变化时,只需重新生成HTML页面。
CloudBees曾经为Jenkins提供了一个显示多个主程序的产品。听起来https://www.cloudbees.com/products/continuous-integration现在可以做到这一点,但那些专注于管理(相对于最终用户)的人。
https://stackoverflow.com/questions/48190042
复制相似问题