使用 cc.net 自动发布开发人员作品
我想构建一个开发人员构建项目,然后需要将其发布到服务器,成功发布后需要针对该开发人员发布构建我的测试项目。 基本思想是每当任何开发人员在 Svn 上提交某些内容时就运行此过程。
目前我正在使用 CC.net 和 MSBuild。 任何人都知道如何完成这项工作。
步骤 1. 开发人员在 SVN 上提交 步骤 2. 检测 Svn 上的更改并在构建服务器上进行更新 步骤 3. 使用最近的更改构建项目 步骤4.发布到服务器 步骤 5. 然后针对最近的发布运行测试(我使用 cc.net、msbuild 和 nunit 成功完成了此过程)
I want to build a developer build project and then needs to publish it to the server and After a successful publish need to build my test project against that developer publish. Basic idea is to run this process whenever any developer commits something on Svn.
Currently I am using CC.net and MSBuild. Any one ahaving idea how to accomplish this work.
Step 1. Developer commit on SVN
Step 2. Detect Changes on Svn and take an update on Build server
Step 3. Build the project with recent changes
Step 4. Publish it to the server
Step 5. then run tests against the recent publish (I am successfully doing this process by using cc.net, msbuild and nunit)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用“项目”标签,您还可以在“其中”包含其发布者。
例如:
if you're using the Project tag, you can also include "in it" the publisher for it.
For example:
无论构建成功还是失败,CC.Net 中的publisher 部分都会被执行。 您需要将“发布到构建服务器”添加为任务,位于任务部分下 - 将其放在最后一个构建步骤之后。
这将导致 CC.Net 仅在所有先前的“任务”完成后才“发布到构建服务器”,而不会引发错误代码。
通常,如果您知道 DOS .bat 文件中需要什么来“发布到构建服务器”,您可以执行以下操作:
正如 slawekg 指出的那样,您可以使用 buildpublisher,它仅在构建成功时才执行,但是我仍然发现使用批处理文件进行复制比使用 buildpublisher 更可配置。
The publisher section in CC.Net will be executed regardless if the build is successful or fails. You need to add the 'publish to build server' as a task, under the tasks section - putting it after your last build step.
This will cause CC.Net to only 'publish to build server' when all previous 'tasks' are completed, without raising an error code.
Typically, if you know what is needed in a DOS .bat file to 'publish to build server' you do as follows;
As slawekg points out, you can use the buildpublisher, which will execute only if the build is successful, however I still find using a batch file to do the copying more configurable than what is available using buildpublisher.
您还可以考虑将“推送”写入您的 MS 构建脚本。 这将为您提供 Sam 所说的灵活性和控制力,并且仍然确保仅在构建成功时才进行发布。
You might also consider writing the "push" into your MS Build Script. This would give you the flexibility and control that Sam is talking about and still ensure that the publish only happens if the build succeeds.