Hudson 为每个项目添加新的电子邮件地址
我很好奇其他人是如何完成这项任务的。假设您有 100 多个项目,每个项目都配置了一些用户,以便在状态更改时收到通知。现在您必须将新电子邮件添加到此列表中。困难的方法是进入每个项目并手动添加。我就是这样做的(当然,atm 上没有 100 多个项目)。还有更好的办法吗? 我知道有一个配置切片插件,但上次我检查它没有覆盖电子邮件列表。
库库达斯
i'm curious how other people do this task. Let's say you have like 100+ projects and each project has configured some users to be notified when the status changes. Now you have to add a new e-mail to this list. The hard way is to go into every project and add it by hand. That's how i do it atm (of course there are no 100+ projects atm). Is there any better way ?
I know there is a configuration slicing plugin but last time i checked it didn't cover the e-mail list.
kukudas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的电子邮件系统中建立一个通讯组列表,然后将新地址添加到其中怎么样?
不过,如果您需要以困难的方式完成它,那么我建议将
sed
指向每个作业的 XML 配置文件。How about just having a distribution list in your email system and then you can add the new address to that?
Though if you need to do it the hard way, then I'd recommend pointing
sed
at the XML config file for each job.正如 Christopher 提到的,Hudson 将所有数据存储在磁盘上,这意味着您可以轻松编辑磁盘上任何和所有作业的配置,并告诉 Hudson 然后从磁盘重新加载配置。
几个月前,我需要更改几十个工作,以通过电子邮件发送一个通讯组列表而不是另一个(实际上,通讯组列表就是这里的答案,我无法想象为每个新地址编辑配置文件),这是我使用的 sed 命令:
-i
开关表示“就地编辑文件”并向其添加后缀 (.bak
) 告诉 sed 备份原始文件首先(在以后缀.bak
结尾的文件中)。如果您想将新电子邮件地址添加到现有电子邮件地址列表中,则必须调整 sed 命令以搜索
config.xml
文件中您希望匹配的任何字符串。之后,登录 hudson 管理控制台并告诉它重新加载配置信息。
As Christopher mentions, Hudson stores all of it's data on disk which means that you can easily edit the configuration of any and all jobs on disk and tell Hudson to then reload the configuration from disk.
A couple of months ago I needed to change a few dozens jobs to email one distribution list instead of another (really, distribution lists are the answer here, I can't imagine editing the configuration files for each new address), and here is the sed command I used:
The
-i
switch means "edit files in place" and adding a suffix to it (.bak
) tells sed to make a backup of the original file first (in files that end with the suffix.bak
).If you wanted to instead add a new email address to a list of existing email addresses, you'd have to adjust your sed command to search for whatever string in the
config.xml
file you are hoping to match.After this, login to the hudson management console and tell it to reload configuration info.