使用单个配置文件在 CC.NET 中进行电子邮件组配置

发布于 2024-07-29 03:13:42 字数 1744 浏览 2 评论 0原文

我们已经开始使用 CC.NET 进行持续集成,随着监控项目数量的增加,我希望通过单个配置文件配置电子邮件警报。

我的意思是,我希望在一个配置文件中包含不同组中的用户列表,该配置文件由所有项目配置文件引用:

<user name="user1" group="buildmasters" address="[email protected]"/>
<user name="user2" group="internalapplications" address="[email protected]"/>
<user name="user3" group="internalapplications" address="[email protected]"/>
<user name="user4" group="externalapplications" address="[email protected]"/>
<user name="user5" group="externalapplications" address="[email protected]"/>

然后项目配置文件将引用正确的组:

<group name="internalapplications" notification="change"/>

因此对于不同的组作为内部应用程序的项目我将导入单个配置文件,然后设置内部应用程序组。 我还想为所有事情添加构建管理员,以便现在我可以跟踪人们是否遇到问题。

这意味着我希望有两个或多个组中的用户,但我不知道这是否可能:

<user name="user1" group="buildmaster, externalapplications" address="[email protected]"/>

我一直在假设有一天我可以配置它并且只有一个文件所有用户的电子邮件地址,但今天我已经去做了,但我不确定它是否能像这样工作。

谁能描述一下他们是如何解决这个问题的?

We have started using CC.NET for continuous integration and as the number of projects monitored builds up I would like configure the email alerts via a single config file.

What I mean by this is that I would like to have a list of the users in different groups in a single config file that is referenced by ALL the project configuration files:

<user name="user1" group="buildmasters" address="[email protected]"/>
<user name="user2" group="internalapplications" address="[email protected]"/>
<user name="user3" group="internalapplications" address="[email protected]"/>
<user name="user4" group="externalapplications" address="[email protected]"/>
<user name="user5" group="externalapplications" address="[email protected]"/>

Then the project configuration file will reference the correct group:

<group name="internalapplications" notification="change"/>

So for the different projects that are internal applications I would import the single config file then set the internal applications group. I would also like to add buildmasters for everything so that for now I can keep track of people if they are having problems.

This would mean I'd like to have a user in two or more groups for example but I don't know if it's possible:

<user name="user1" group="buildmaster, externalapplications" address="[email protected]"/>

I've been working under the assumption that one day I could configure this and have just a single file with all the users email addresses in, but today I've gone to do it and I'm not sure it works like this.

Can anyone describe how they have approached this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

简单 2024-08-05 03:13:42

你想要做的是使用

我制作的 CC.Net 配置预处理器 email.config

<cb:define name="email-template" xmlns:cb="urn:ccnet.config.builder">
    <email from="[email protected]" mailhost="server" includeDetails="TRUE"
         mailhostUsername="buildadmin" mailhostPassword="pass">
      <users>
        <user name="dev" group="dev" address="[email protected]"/>

      </users>
      <groups>
        <group name="buildmaster" notification="always"/>
        <group name="developers" notification="always"/>
      </groups>

    </email>
</cb:define>

并在需要的地方包含它...

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">

    <cb:include href="C:\email.config" />

<project name="MyProject" queue="Build" queuePriority="1" >

    <cb:email-template >

    </cb:email-template>

</project>

<project name="MyProject2" queue="Build" queuePriority="1" >

    <cb:email-template >

    </cb:email-template>

</project>

</cruisecontrol>

What you want to do is use CC.Net Configuration Preprocessor

I made an email.config

<cb:define name="email-template" xmlns:cb="urn:ccnet.config.builder">
    <email from="[email protected]" mailhost="server" includeDetails="TRUE"
         mailhostUsername="buildadmin" mailhostPassword="pass">
      <users>
        <user name="dev" group="dev" address="[email protected]"/>

      </users>
      <groups>
        <group name="buildmaster" notification="always"/>
        <group name="developers" notification="always"/>
      </groups>

    </email>
</cb:define>

and included it where needed...

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">

    <cb:include href="C:\email.config" />

<project name="MyProject" queue="Build" queuePriority="1" >

    <cb:email-template >

    </cb:email-template>

</project>

<project name="MyProject2" queue="Build" queuePriority="1" >

    <cb:email-template >

    </cb:email-template>

</project>

</cruisecontrol>
终难遇 2024-08-05 03:13:42

采取稍微不同的方法怎么样?

通过电子邮件服务器管理组并将邮件发送到组别名。

这样,在不同的组中拥有相同的用户就很简单,而且如果组成员身份发生变化,您不需要更改配置文件。

使用 Exchange 执行此操作非常简单,不了解其他电子邮件系统。

How about taking a slightly different approach.

Manage the groups through your e-mail server and send mails to the group alias.

That way it's trivial to have the same users in different groups, plus you shouldn't need to change your config files if the group membership changes.

Doing this with Exchange is pretty easy, don't know about other e-mail systems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文