【问题标题】:CruiseControl.NET email publisher problemCruiseControl.NET 电子邮件发布者问题
【发布时间】:2010-11-05 02:02:44
【问题描述】:

我想将 ccnet 设置为:

  1. 在每次构建后向提交者发送邮件(无论状态如何)
  2. 在构建中断或修复时向所有其他开发人员发送邮件

随着 CCNet 的每个新版本,电子邮件发布者都会被重构(并且据说会有所改进),但我仍然遇到同样的问题:只有提交者会收到通知 - 如果构建中断,其他开发人员不会收到电子邮件消息。所以要么我没有得到系统,要么电子邮件发布者中有一个长期未修复的错误。

我使用的是 v1.4.4.83。我的示例配置(我删除了不相关的东西):

<email 
    includeDetails="true">
    <users>
        <user name="user1" address="user1@mail.com" group="developers" /> 
        <user name="user2" address="user2@mail.com" group="developers" /> 
    </users>
    <groups>
            <group name="developers">
                <notifications>
                    <notificationType>Failed</notificationType>
                    <notificationType>Fixed</notificationType>
                </notifications>
            </group>
    </groups>
    <modifierNotificationTypes>
        <NotificationType>Always</NotificationType>
    </modifierNotificationTypes>
</email>            

【问题讨论】:

  • 这似乎是一个没有人需要的功能,你能把它发到jira.public.thoughtworks.org/browse/CCNET吗?
  • 有趣的是——这在 CCNet 的早期版本中实际上是可能的(我记得是 1.3)。

标签: cruisecontrol.net


【解决方案1】:

我相信这可以满足您的需求(诚然,在您提出问题一年之后)。

注意:我们使用 SVN,带有 &lt;svn&gt; 块。在 CC.NET 1.4.xx 中,&lt;email&gt; 块支持正则表达式来计算 SVN 用户名的电子邮件地址。它应该可以与其他源代码控制块一起使用,但除了 SVN 之外我没有使用任何东西。

我们的&lt;publishers&gt; 块中有如下内容(我已对其进行了修改以符合您的规范):

<email ... includeDetails="true">
  <!-- Developers get an email whenever the build status changes -->
  <users>
    <user name="Dev1" group="developer" address="dev1@ourcompany.com" />
    <user name="Dev2" group="developer" address="dev2@ourcompany.com" />
  </users>
  <groups>
    <group name="developer" notification="change" />
  </groups>

  <!-- Committers get an email for every build they commit code for -->
  <converters>
    <regexConverter find="$" replace="@ourcompany.com" />
  </converters>
  <modifierNotificationTypes>
    <NotificationType>always</NotificationType>
  </modifierNotificationTypes>
</email>

因此,dev1@ourcompany.com 和 dev2@ourcompany.com 将在构建状态更改时收到一封电子邮件,而 [svnuser]@ourcompany.com 将在他们已提交代码的构建完成构建时收到一封电子邮件。

注意:如果构建失败,自上次成功后提交代码的 svn 用户将在每次构建完成时继续收到更多电子邮件,直到构建修复。

【讨论】:

  • 我会接受您的回答,尽管我无法测试解决方案 - 我们不久前切换到了 Hudson CI。我们只是厌倦了配置 XML 汤和回归错误。
  • @Igor: Hudson CI?我以前没听说过。虽然我很了解CC,但它确实有很多缺点!有时间我可能会看一下,为提及而欢呼。
  • hudson-ci.org ... 比 CC 友好得多。它基于 Java,但确实有一些面向 .NET 的插件。它有一个适当的 GUI :)
【解决方案2】:

我认为这可以满足您的需求...我们正在运行 1.4.3 版,所以 YMMV。开发人员仅在固定/失败状态发生变化时才会收到电子邮件,而 PM 每次构建时都会收到电子邮件。

<groups>
   <group name="Always">
        <name>Always</name>
        <notification>Always</notification>
    </group>
    <group name="developers">
        <name>developers</name>
        <notification>Change</notification>
    </group>
</groups>
<users>
    <user name="dev1">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
    <user name="pm1">
        <address>...</address>
        <group>Always</group>
        <name>...</name>
    </user>
    <user name="dev2">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
    <user name="dev3">
        <address>...</address>
        <group>developers</group>
        <name>...</name>
    </user>
</users>

【讨论】:

    【解决方案3】:
    <email from="CruiseControlBuild@xxxxxxxx.com" mailhost="xxxxxxxx.com" includeDetails="True">
                <users>
                    <user name="Dev Staff" group="group1" address="xxxxxxxxxxx"/>
                    <user name="QA Staff" group="group1" address="xxxxxxxxxxx"/>
                </users>
                <groups>
                    <group name="group1" notification="always"/>
                </groups>
                <modifierNotificationTypes>
                    <NotificationType>Always</NotificationType>
                </modifierNotificationTypes>
            </email>
    

    这可行,但要小心。为连续系统中的每个构建发送一封电子邮件给每个开发人员发送电子邮件是在乞求您的电子邮件被忽略。我发送给每个人的唯一电子邮件是夜间安装程序构建。

    【讨论】:

    • Alex,我不想将每个构建的电子邮件发送给每个开发人员。我想我在问题的开头就明确表示了(见 1. 和 2.)。
    • 不仅电子邮件会被忽略,而且根据您的 SMTP 主机规则,它可能会在 ISP 级别阻止或过滤您!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-18
    • 1970-01-01
    • 2010-10-02
    • 1970-01-01
    • 2012-01-02
    • 1970-01-01
    • 2021-04-03
    相关资源
    最近更新 更多