开发者

Hudson adding new E-Mail adress to every project

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


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.


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:

#from $HUDSON_HOME directory
for i in `ls */config.xml`; do sed -i.bak 's/oldlist@/newlist@/' $i; done

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜