如何使用TeamCity构建后部署? [英] How to deploy after a build with TeamCity?

查看:278
本文介绍了如何使用TeamCity构建后部署?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将TeamCity设置为我的构建服务器。



我有我的项目设置,它从subversion正确更新,并建立好。



那么什么下一个?



理想情况下,我希望自动部署到测试服务器,手动部署到实时/分段服务器。



最好的方法是什么?



由于我正在使用C#/ ASP.Net,我应该将Web部署项目添加到我的解决方案?

解决方案

本文介绍如何从TeamCity调用Microsoft的WebDeploy工具将Web应用程序部署到远程Web服务器。我一直在使用它来部署到测试Web服务器并在登记时运行selenium测试。



http://www.mikevalenty.com/automatic-deployment-from-teamcity-using-webdeploy/



  1. 安装WebDeploy

  2. 启用Web配置转换

  3. 配置TeamCity BuildRunner

  4. 配置TeamCity构建依赖关系

适用于我的应用程序的MSBuild参数是: p>

  / p:Configuration = QA 
/ p:OutputPath = bin
/ p:DeployOnBuild = True
/ p:DeployTarget = MSDeployPublish
/p:MsDeployServiceUrl=https://myserver:8172/msdeploy.axd
/ p:username = myusername
/ p:password = mypassword
/ p:AllowUntrustedCertificate = True
/ p:DeployIisAppPath = ci
/ p:MSDeployPublishMethod = WMSVC


I'm setting up TeamCity as my build server.

I have my project set up, it is updating correctly from subversion, and building ok.

So what's next?

Ideally, I'd like to have it auto deploy to a test server, with a manual deploy to a live/staging server.

What's the best way to go about this?

Since I am using C#/ASP.Net, should I add a Web Deployment project to my solution?

解决方案

This article explains how to call Microsoft's WebDeploy tool from TeamCity to deploy a web application to a remote web server. I've been using it to deploy to a test web server and run selenium tests on check-in.

http://www.mikevalenty.com/automatic-deployment-from-teamcity-using-webdeploy/

  1. Install WebDeploy
  2. Enable Web config transforms
  3. Configure TeamCity BuildRunner
  4. Configure TeamCity Build Dependencies

The MSBuild arguments that worked for my application were:

/p:Configuration=QA  
/p:OutputPath=bin  
/p:DeployOnBuild=True  
/p:DeployTarget=MSDeployPublish  
/p:MsDeployServiceUrl=https://myserver:8172/msdeploy.axd  
/p:username=myusername  
/p:password=mypassword  
/p:AllowUntrustedCertificate=True  
/p:DeployIisAppPath=ci  
/p:MSDeployPublishMethod=WMSVC

这篇关于如何使用TeamCity构建后部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆