将 psake 与 MsBuild 集成
我正在使用 MSBuild 进行 CI。我最近正在寻找 psake 作为为日常构建创建脚本的附加工具,因为我需要对我们的构建进行一些更新,这在 psake 中会更容易。目前,我不打算替换现有脚本,因为它需要大量工作,但保留现有脚本并使用 psake 添加新脚本。
我的问题是 - 当我在 TFS 中创建构建时,如何在构建解决方案后运行 psake 脚本?我的理解是,我需要在执行构建后添加一个新目标并执行 psake/powershell。这是正确的做法吗?
I am using MSBuild for CI. I was looking recently to psake as an additional tool for creating scripts for daily builds as I need to do some updates to our builds which will be easier in psake. For the moment I’m not looking to replace our existing scripts as it requires a lot of work but keep the existing ones and add new using psake.
My question is - when I create a build in TFS how can I run the psake scripts after the solution is built? My understanding is that I need to add a new target after the build is executed and execute the psake/powershell. Is this the right way to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,你就是这样做的。最好将构建脚本的不同部分分开,这样如果您想更改某些内容,就可以轻松进行。
因此,理想情况下,您应该有一个任务用于编译解决方案,另一个任务用于运行测试,另一个任务用于打包源代码等等......我最近开始使用 psake 和 此是一个很好的参考,以防您想查找某些内容。
Yes that is how you would do it. It is best to separate different parts of your build script so that if you want to change something, you can proceed with ease.
So, Ideally, you should have a task for compiling your solution, another for running the tests, another for packaging the source and so on ... I recently started using psake, and this is a good reference in case you want to look up something.
正确的方法是使用 TeamCity 运行 psake 构建脚本。在 psake 脚本中,您将创建一个 psake 任务,该任务通过
exec { msbuild yourSolution.sln }
调用 msbuild。The right way to do this is to use TeamCity to run your psake build scripts. In your psake scripts you would create a psake Task that calls msbuild via
exec { msbuild yourSolution.sln }
.