TFS Build Definition And Auto Deploy
一台build machine上一般只有一个build service[对应一个build controller]来serve一个team project collection,但又workaround来实现多个controller在一台机器上的共存,参考这里。
说一说自动化build和自动化部署:
1.创建Build Definition[build serivce的账号必须有drop folder的写权限,就是Build Definition\Build Defaults\Staging location下的UNC path如\\10.1.1.16\DropFolder]。
注意:a)之前在创建好然后trigger后老是挂掉,原因是版本引用问题,参考这篇mark。
b)在Process中Required->items to build指定要build的solution or project。
2.在build definition的Process->Advanced->MSBuild Arguments添加如下参数以完成build后的自动部署(参数之间用空格分开):
/p:DeployOnBuild=True
/p:Configuration=Debug //此处的Configuration可以在configuration manager中自己创建;每次发布都会做文件的全部替换,不希望web.config文件(此处以web项目为例)被 //替换的话,其实一般就是数据库的链接字符串和一些appsettings,可以在Web.Debug.Config中做一些设置,详见第三条;
/p:SkipExtraFilesOnServer=true
/p:DeployTarget=MSDeployPublish
/p:MSDeployPublishMethod=RemoteAgent //即使用web deploy的方法,如果用其他的比如IIS自带的WMSVC的话,相应参数另行设置;还有WebDeployPackage;
/p:AllowUntrustedCertificate=True
/p:CreatePackageOnPublish=true
/p:DeployIISAppPath=siteName/applicationName
/p:MsDeployServiceUrl=http://10.1.1.4
/p:username=domain\tfsbuild2
/p:password=Abcd1234!
3.
<?xml version="1.0" encoding="utf-8"?> <!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB". <connectionStrings>
<add name="MyDB" //这里写发布后需要被替换的连接字符串的名字
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" //connectionString为自动部署时要被设置的字符串
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> //Match是匹配"name"来替换相应的value
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute. <customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
操作中还碰到个问题:同一个site/application路径,一个project可以自动部署,另一个则不行,提问在这儿。
总结:做到以上,就可以做自动化build和部署了!PS:如果没有特殊问题比如上边提到的问题。put down this just for reminding me of how to do some auto-build/deploy related stuff later.
TFS Build Definition And Auto Deploy的更多相关文章
- TFS Build Definition
1. TFS Build 简介 在团队项目开发中,编译常常是一个很困难的事情! 可能你会反问编译有什么难的?不就是右键,然后点击 Build/Rebuild, 或者直接按 F5 么?这都不会,真不知 ...
- 如何用TFS build definition添加自动建立nuget package 步骤
参考网址:https://www.visualstudio.com/en-us/docs/build/steps/package/nuget-packager https://docs.nuget.o ...
- TFS build server搭建,搭建自动化构建服务器
TFS build 服务器的搭建主要步骤如下: 一:环境准备: 新建一台build服务器 安装Visual Studio.主要目的是: a. 生成Build脚本所需要的build命令:b.与TFS组合 ...
- TFS Build做Web应用持续集成发布的一个技巧
由于面向接口编程的关系,许多实现往往是动态注入运行,在一个项目中直接引用实现dll编译是不合理的.通常我们会在Post Build Event中添加一些xcopy命令将运行时才需要的dll复制到输出目 ...
- TF42064: The build number already exists for build definition error in TFS2010
In TFS2008, deleting a build removes it from the database itself. If you delete a build called Build ...
- auto deploy docs website
auto deploy docs website { "name": "docs", "version": "0.0.1" ...
- TFS Build Silverlight项目的两个问题
1.The Silverlight 4 SDK is not installed. 打开对应的Build Definition,Process -> Advanced -> MSBuild ...
- xeam Build Definition Extension uninstall 卸载
之前在VS上装了Build definition 的扩展,后来发现很不好用,想卸载掉,就增 工具下面找add-in manager, 结果找不到,external tools下面也找不到, googl ...
- TFS2010单独安装配置tfs build server
记录一下确实很磨人. 同样硬件和软件环境的两台服务器,其中一台服务器很久之前就配置好了tfs2010 build ,然后最近想再配置一台tfs build server,但是按照以前的配置流程始终提示 ...
随机推荐
- 如何提高ASP.NET页面载入速度的方法
前言 本文是我对ASP.NET页面载入速度提高的一些做法,这些做法分为以下部分: 1.采用 HTTP Module 控制页面的生命周期. 2.自定义Response.Filter得到输出流stream ...
- Dephi 和 Pascal 的关系
Pascal是一个有影响的面向对象和面向过程编程语言,由尼古拉斯·沃斯在1968年9月设计,在1970年发行,作为一个小型的和高效的语言,意图鼓励使用结构化编程和数据结构进行良好的编程实践. Delp ...
- HTML input-file 上传类型控制
HTML input-file 上传类型控制 input file 属性 accept 表示可以选择的文件MIME类型,多个MIME类型用英文逗号分开,常用的MIME类型见下表. 只能选择png和gi ...
- 新版Retrofit 2可运行例子(解决Could not locate ResponseBody converter for问题)
Retrofit这东西我就不多做解释了,反正最近应用很广,基本都快和OkHttp一起成为安卓的事实网络访问标准框架了. 这么好的一个东西,官网文档实在是不算太好,说的不太清晰.按官网的经常会有“Cou ...
- innodb的锁
观察innodb的锁时间,需要关注: mysqladmin extended-status -r -i 1 -uroot | grep "Innodb_row_lock_time" ...
- 利用sp_addlinkedserver实现远程数据库链接
--查看当前链接情况: select * from sys.servers; --使用 sp_helpserver 来显示可用的服务器 Exec sp_helpserver --删除已经存在的某个链接 ...
- Silverlight 页面传值问题(转)
共有两种方式来传递初始化参数 1)在html或者aspx页面中object对象中加入一下代码 参数格式:参数名 = 值,参数名 = 值,... <param name="initPar ...
- django orm 操作
django的orm使用方便,但对于一些复杂的操作,需要遵循特定的规范,特例特别记录一下: 模型: from django.db import models class Blog(models.Mod ...
- 基于mini2440的Qt移植
花了很长时间,终于把Qt移植到mini2440开发板上了,不能说完全成功,总算是完成一大步,各中过程心酸,废话不多说,下面正式讲解移植过程. 移植环境: win7系统,虚拟机是ubuntu12.04 ...
- Mysql 数据库创建基本步骤
1.创建数据库 create database school; 2.使用数据库 Use school; 3.创建用户 create user jame@localhost identified by ...