在从 TeamCity 中的 SVN 拉取之前运行命令
我在使用 TeamCity 时遇到问题,这与它在运行构建步骤之前运行源代码控制步骤这一事实有关。我的项目是一个Windows服务,所以这会很复杂。
TeamCity 经常决定删除项目目录的全部内容,即使我未选中 clean build 选项。但是,由于这是一项 Windows 服务,因此无法运行,因为当尝试删除 dll 时,由于它们正在使用,因此会出错:
应用补丁时出错:无法删除:F:\PathToService\bin\Release \Library.dll
最令人沮丧的是,这些 dll 甚至不受源代码控制,TeamCity 似乎有自己的想法并决定无论如何删除它们。
有没有办法解决这个问题,能够在执行 svn 签出之前运行构建步骤,以便我可以先停止 Windows 服务?
I'm having an issue with TeamCity, which relates to the fact that it runs the source control step before it runs the build steps. My project is a windows service, so there are complications with this.
TeamCity often decides to delete the entire contents of the project directory, even though I have the clean build option unchecked. However, since this is a windows service this does not fly, as when trying to delete the dll's it errors out since they're in use:
Error while applying patch: Failed to delete: F:\PathToService\bin\Release\Library.dll
The most frustrating part is that the dll's aren't even under source control, TeamCity seems to have a mind of its own and decides to delete them anyway.
Is there a way to get around this, to be able to run a build step BEFORE doing the svn checkout so that I can stop the windows service first?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会尝试设置你的 CI 环境,以便在你完成测试后它会卸载 Windows 服务。我不知道 Teamcity 预结账挂钩。
I would try to set up your CI environment so it uninstalls the windows service once you are done testing it. I am not aware of Teamcity pre-checkout hook.
答案是将每个服务拆分到一个单独的工作目录中。这可以防止 teamcity 删除 dll。
The answer was to split up each service into a separate working directory. That prevents teamcity from deleting the dll's.