一台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的更多相关文章

  1. TFS Build Definition

    1.  TFS Build 简介 在团队项目开发中,编译常常是一个很困难的事情! 可能你会反问编译有什么难的?不就是右键,然后点击 Build/Rebuild, 或者直接按 F5 么?这都不会,真不知 ...

  2. 如何用TFS build definition添加自动建立nuget package 步骤

    参考网址:https://www.visualstudio.com/en-us/docs/build/steps/package/nuget-packager https://docs.nuget.o ...

  3. TFS build server搭建,搭建自动化构建服务器

    TFS build 服务器的搭建主要步骤如下: 一:环境准备: 新建一台build服务器 安装Visual Studio.主要目的是: a. 生成Build脚本所需要的build命令:b.与TFS组合 ...

  4. TFS Build做Web应用持续集成发布的一个技巧

    由于面向接口编程的关系,许多实现往往是动态注入运行,在一个项目中直接引用实现dll编译是不合理的.通常我们会在Post Build Event中添加一些xcopy命令将运行时才需要的dll复制到输出目 ...

  5. 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 ...

  6. auto deploy docs website

    auto deploy docs website { "name": "docs", "version": "0.0.1" ...

  7. TFS Build Silverlight项目的两个问题

    1.The Silverlight 4 SDK is not installed. 打开对应的Build Definition,Process -> Advanced -> MSBuild ...

  8. xeam Build Definition Extension uninstall 卸载

    之前在VS上装了Build definition 的扩展,后来发现很不好用,想卸载掉,就增 工具下面找add-in manager, 结果找不到,external tools下面也找不到, googl ...

  9. TFS2010单独安装配置tfs build server

    记录一下确实很磨人. 同样硬件和软件环境的两台服务器,其中一台服务器很久之前就配置好了tfs2010 build ,然后最近想再配置一台tfs build server,但是按照以前的配置流程始终提示 ...

随机推荐

  1. 打造H5里的“3D全景漫游”秘籍

    近来风生水起的VR虚拟现实技术,抽空想起年初完成的“星球计划”项目,总结篇文章与各位分享一下制作基于Html5的3D全景漫游秘籍. QQ物联与深圳市天文台合作,在手Q“发现新设备”-“公共设备”里,连 ...

  2. OAF_开发系列03_实现OAF如何在保存前判断数据是否存在变更(案例)

    2014-06-26 Created By BaoXinjian

  3. Python函数式编程:从入门到走火入魔

    一行代码显示"爱心" >>> print]+(y*-)**-(x**(y*<= ,)]),-,-)]) Python函数式编程:从入门到走火入魔 # @fi ...

  4. android 对sqlite数据库的增删改查等各种操作

    转载:http://blog.csdn.net/vrix/article/details/6717090 package com.sqlite.main; import java.io.File; i ...

  5. 利用微软AntiXss Library过滤输出字符,防止XSS攻击

    假如项目在前期没有过滤客户提交的字符,那么可以在输出的时候,对输出的字符进行过滤,防止出现XSS跨域攻击. 原理简单:利用ASP.NET API的管道原理,在MessageHandlers中添加一个自 ...

  6. Oracle Merge备忘示例

    Oracle的merge语法非常实用,用于Insert.Update判断情况.以下是自己书写的一个示例,以免时间长了语法形式忘记了. MERGE INTO T_FR_GUOSZX T USING (S ...

  7. 评论alpha版本发布

    讲解顺序: 1.  新蜂:俄罗斯方块 俄罗斯方块已经完成了核心的游戏部分,可以流畅的进行游戏,经验值功能也已经完成,目前进度很好:不足之处主要有:后续的显示内容还没完成,所以界面空出来很多板块,alp ...

  8. iptables删除规则

    查看nat规则: iptables -t nat -nL --line-number 添加规则是-A和-I,-A是添加到末尾,-I是添加到指定位置,默认添加到最前面.删除使用-D,也就是原来“ipta ...

  9. AX 2012 在Grid 中添加image标识状态

    refer to :http://kiwiaxguy.blogspot.hk/2013/10/displaying-image-on-form-grid-in.html

  10. sqlserver ,left join 不仅可以join表,还可以是一个结果集

    SELECT MA.NAME AS MakeName , M.ID AS ModelId , M.Name AS ModelName , M.Warranty AS ModelWarranty , S ...