Zen Timestamp 插件不适用于矩阵构建
当我在 Windows 上构建 Matrix 时,Zen Timestamp Plugin 不适用于我覆盖格式在作业级别指定 - 默认格式在构建步骤和构建后操作中均保留。当格式在系统级别被覆盖时,它可以很好地处理常规构建和矩阵构建。
有人可以建议一个好的解决方法吗?
以防万一:Jenkins v1.442、Zen Plugin v3.0;这是用于测试构建的 config.xml:
<matrix-project>
<actions/>
<description/>
<logRotator>
<daysToKeep>-1</daysToKeep>
<numToKeep>2</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.zentimestamp.ZenTimestampJobProperty>
<changeBUILDID>true</changeBUILDID>
<pattern>yyyyMMddHHmmss</pattern>
</hudson.plugins.zentimestamp.ZenTimestampJobProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers class="vector"/>
<concurrentBuild>false</concurrentBuild>
<axes>
<hudson.matrix.LabelAxis>
<name>label</name>
<values>
<string>Master</string>
</values>
</hudson.matrix.LabelAxis>
</axes>
<builders>
<hudson.tasks.BatchFile>
<command>echo %BUILD_ID%</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<hudson.plugins.emailext.ExtendedEmailPublisher>
<recipientList>[email protected]</recipientList>
<configuredTriggers>
<hudson.plugins.emailext.plugins.trigger.SuccessTrigger>
<email>
<recipientList/>
<subject>$PROJECT_DEFAULT_SUBJECT</subject>
<body>$PROJECT_DEFAULT_CONTENT</body>
<sendToDevelopers>false</sendToDevelopers>
<includeCulprits>false</includeCulprits>
<sendToRecipientList>true</sendToRecipientList>
</email>
</hudson.plugins.emailext.plugins.trigger.SuccessTrigger>
</configuredTriggers>
<contentType>default</contentType>
<defaultSubject>$DEFAULT_SUBJECT</defaultSubject>
<defaultContent>BUILD_ID is ${ENV, var="BUILD_ID"}</defaultContent>
</hudson.plugins.emailext.ExtendedEmailPublisher>
</publishers>
<buildWrappers/>
<runSequentially>false</runSequentially>
</matrix-project>
这是控制台输出:
Started by upstream project "test Zen plugin matrix" build number 5
Building on master
No emails were triggered.
[Master] $ cmd /c call C:\DOCUME~1\hotbuild\LOCALS~1\Temp\hudson1252624466863059206.bat
C:\Documents and Settings\hotbuild\.jenkins\jobs\test Zen plugin matrix\workspace\label\Master>echo 2012-02-01_12-26-12
2012-02-01_12-26-12
C:\Documents and Settings\hotbuild\.jenkins\jobs\test Zen plugin matrix\workspace\label\Master>exit 0
Email was triggered for: Success
Sending email for trigger: Success
Sending email to: [email protected]
Finished: SUCCESS
输出应该是 20120201122612
- 它适用于类似的非矩阵构建。
Zen Timestamp Plugin does not work for me with Matrix builds on Windows when the overriding format is specified at the job level - the default format is retained both in build steps and post build actions. It works fine with regular builds and with matrix builds when the format is overridden at the system level.
Anybody can suggest a good workaround?
Just in case: Jenkins v1.442, Zen Plugin v3.0; here is config.xml for a test build:
<matrix-project>
<actions/>
<description/>
<logRotator>
<daysToKeep>-1</daysToKeep>
<numToKeep>2</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.zentimestamp.ZenTimestampJobProperty>
<changeBUILDID>true</changeBUILDID>
<pattern>yyyyMMddHHmmss</pattern>
</hudson.plugins.zentimestamp.ZenTimestampJobProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers class="vector"/>
<concurrentBuild>false</concurrentBuild>
<axes>
<hudson.matrix.LabelAxis>
<name>label</name>
<values>
<string>Master</string>
</values>
</hudson.matrix.LabelAxis>
</axes>
<builders>
<hudson.tasks.BatchFile>
<command>echo %BUILD_ID%</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<hudson.plugins.emailext.ExtendedEmailPublisher>
<recipientList>[email protected]</recipientList>
<configuredTriggers>
<hudson.plugins.emailext.plugins.trigger.SuccessTrigger>
<email>
<recipientList/>
<subject>$PROJECT_DEFAULT_SUBJECT</subject>
<body>$PROJECT_DEFAULT_CONTENT</body>
<sendToDevelopers>false</sendToDevelopers>
<includeCulprits>false</includeCulprits>
<sendToRecipientList>true</sendToRecipientList>
</email>
</hudson.plugins.emailext.plugins.trigger.SuccessTrigger>
</configuredTriggers>
<contentType>default</contentType>
<defaultSubject>$DEFAULT_SUBJECT</defaultSubject>
<defaultContent>BUILD_ID is ${ENV, var="BUILD_ID"}</defaultContent>
</hudson.plugins.emailext.ExtendedEmailPublisher>
</publishers>
<buildWrappers/>
<runSequentially>false</runSequentially>
</matrix-project>
And here's the console output:
Started by upstream project "test Zen plugin matrix" build number 5
Building on master
No emails were triggered.
[Master] $ cmd /c call C:\DOCUME~1\hotbuild\LOCALS~1\Temp\hudson1252624466863059206.bat
C:\Documents and Settings\hotbuild\.jenkins\jobs\test Zen plugin matrix\workspace\label\Master>echo 2012-02-01_12-26-12
2012-02-01_12-26-12
C:\Documents and Settings\hotbuild\.jenkins\jobs\test Zen plugin matrix\workspace\label\Master>exit 0
Email was triggered for: Success
Sending email for trigger: Success
Sending email to: [email protected]
Finished: SUCCESS
The output should be 20120201122612
- which it is for the similar non-matrix build.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是插件中的一个错误。已在版本 3.2(2012 年 3 月 10 日)中修复。我已经测试过它并且工作正常。
Was a bug in the plugin. Fixed in Release 3.2 (March 10, 2012). I've tested it and it works fine.