配置 TeamCity MSBuild 和 MSDeploy
我在使用 MSBuild 和 MSDeploy 设置不同环境时遇到问题。
我在 TeamCity TestConfiguration 上设置了 2 个配置
- (这会在测试配置中构建应用程序并运行单元测试)
- StagingConfiguration (旨在打包并部署到我们的暂存盒以进行 UA 测试)
我的 TestConfiguration 工作正常,但 StagingConfiguration 不会部署包裹。
<MSBuild Projects="MyProject\MyProject.csproj"
Properties="Configuration=Staging;
DeployOnBuild=true;
DeployTarget=Package;"/>
我已经尝试添加两者
_PackageTempDir=\\server\c$\WebDirectory;
PackageLocation=\\server\c$\WebDirectory;
,但似乎都没有做任何事情,我是否错过了重点?我还没有真正找到任何文档,只是到处都有奇怪的博客文章。我是否需要在 TeamCity 服务器上安装某些内容才能使 MSDeploy 正常工作?
我的理想场景是:
- 手动签入 tfs
- 在 TeamCity 中运行 StagingConfiguartion
- 构建代码并将其部署到 \server\c$\WebDirectory
I'm having issues setting up different envirnoments with MSBuild and MSDeploy.
I've setup 2 configurations on TeamCity
- TestConfiguration (This builds the app in Test Config and runs unit tests)
- StagingConfiguration (Is meant to package and deploy to our staging box for UA testing)
My TestConfiguration works fine but the StagingConfiguration doesn't deploy the package.
<MSBuild Projects="MyProject\MyProject.csproj"
Properties="Configuration=Staging;
DeployOnBuild=true;
DeployTarget=Package;"/>
I've tried adding both
_PackageTempDir=\\server\c$\WebDirectory;
PackageLocation=\\server\c$\WebDirectory;
But neither seem to do anything, am i missing the point? I've not really been able to find any documentation, just the odd blog post here and there. Do I need to install something on my TeamCity server for MSDeploy to work?
My ideal scenario is:
- Check in to tfs
- Run StagingConfiguartion in TeamCity manually
- Code is built and deployed to \server\c$\WebDirectory
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要配置 TeamCity“系统属性”,该属性将传递给 MsBuild 并控制 MsDeploy 管道。
正确设置有点棘手,但需要设置的是:
我在这里写了一篇博客文章,其中包含更多详细信息:来自 TeamCity 的 Web 部署 (MS Deploy) - http://www.geekytidbits.com/web-deploy-ms-deploy-from-teamcity/
这是我的配置:
You need to configure TeamCity "System Properties" that will be passed to MsBuild and control the MsDeploy pipeline.
It's a little tricky to get setup correctly but the ones you need to set are:
I wrote a blog article with more detail here: Web Deploy (MS Deploy) from TeamCity - http://www.geekytidbits.com/web-deploy-ms-deploy-from-teamcity/
Here's what my config looks like:
当 Visual Studio 未安装在构建服务器上时(绝对不应该如此),您需要开发计算机中的一些文件才能运行:
来自
C:\Program Files\开发计算机上的 MSBuild\Microsoft\VisualStudio\v10.0
文件夹将Web
和Web Applications
文件夹复制到生成服务器上的等效目录。(来自 未找到 MSBuild 目标包)
When Visual Studio is not installed on the build server (which it should definitely not be) you need a few files from your dev machine to make things running:
From the
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0
folder on your dev machine copy theWeb
andWeb Applications
folders to the equivalent directory on your build server.(from MSBuild target package not found)