我正在尝试在电子邮件中使用动态参数 发布者的subjectSettings块。例如,
<project>
...
<parameters>
<textParameter>
<name>version</name>
<display>Version to install</display>
<description>The version to install.</description>
<required>true</required>
</textParameter>
</parameters>
<tasks>
...
</tasks>
<publishers>
....
<email includeDetails="TRUE">
<from>buildmaster</from>
<mailhost>localhost</mailhost>
<users>
<user name="Joe" group="buildmaster" address="jdavies" />
</users>
<groups>
<group name="buildmaster">
<notifications>
<notificationType>Always</notificationType>
</notifications>
</group>
<group name="users">
<notifications>
<notificationType>Success</notificationType>
<notificationType>Fixed</notificationType>
</notifications>
</group>
</groups>
<subjectSettings>
<subject buildResult="Success" value="Version ${version}
installed." />
<subject buildResult="Fixed" value="Version ${version} fixed
and installed." />
</subjectSettings>
<modifierNotificationTypes>
<notificationType>Success</notificationType>
</modifierNotificationTypes>
</email>
</project>
我尝试过使用$ {version}和$ [version]。当我使用$ [版本]时, 整个主题行都是空的!
例如,我没有看到“安装了BLANK版本”,而只看到一个空主题行:
[Install:INFO] Emailing "" to joe
在这种情况下是否支持动态参数,如果是,我是什么 做错了?
答案 0 :(得分:1)
根据提供的评论,我从CC.Net 1.5.7256.1升级到1.6.7349.5。版本1.6似乎工作正常。
参数的正确格式为$ [parameter],如预期的那样。
答案 1 :(得分:0)
“dynamicValues”有一个选项(仅在v1.5及更高版本中支持)作为配置元素。
Email Publisher Documentation
Dynamic Values Documentation
从doucmenation(上下文中的例子)
<project name="Test Project">
<sourcecontrol type="svn">
<!-- Omitted for brevity -->
</sourcecontrol>
<triggers>
<intervalTrigger />
</triggers>
<tasks>
<nant>
<!-- Omitted for brevity -->
<buildArgs>Help</buildArgs>
<dynamicValues>
<directValue property="buildArgs" parameter="CommandToRun" default="Help" />
</dynamicValues>
</nant>
<!-- Omitted for brevity -->
</tasks>
<publishers>
<!-- Omitted for brevity -->
</publishers>
<parameters>
<!-- Omitted for brevity -->
</parameters>