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,但是按照以前的配置流程始终提示 ...
随机推荐
- 智能指针weak_ptr解决循环依赖问题
#include <iostream> #include <memory> class Woman; class Man{ private: std::weak_ptr< ...
- 黄聪:关闭Win2003开机提示“上次意外关机”对话框
很多人在使用win2003服务器(特别是vps)的时候,都会意外关机,然后出现开机提示“上次意外关机”对话框,如果不及时发现,会影响到使用该服务器的网站,所以必须把这提示关闭,方法如下: 1.开始菜单 ...
- HBase配置性能调优(转)
因官方Book Performance Tuning部分章节没有按配置项进行索引,不能达到快速查阅的效果.所以我以配置项驱动,重新整理了原文,并补充一些自己的理解,如有错误,欢迎指正. 配置优化 zo ...
- Linux上分析java程序的问题
通过日志看不出来的问题,可以通过看java的堆栈信息(dump文件)来看出一些端倪. 1. 找java的进程id.jdk/bin的目录 ps -ef | grep java 2. cd 到bin的目录 ...
- 动态主机配置协议(DHCP)如何启动和关闭
启动方法: 开始-->运行-->cmd-->回车-->net start dhcp 关闭方法: 开始-->运行-->cmd-->回车-->net sto ...
- queue
http://www.codeforces.com/contest/625/problem/E
- CM给hive添加自定义jar包
使用的是cloudera manager管理的集群: hive添加自定义jar包 服务端:高级:Hive 辅助 JAR 目录 设置的的路径是影响所有服务端的设置,比如hue中使用到了hive查询编辑器 ...
- <-0基础学python.第一课->
初衷:我电脑里面的歌曲很久没换了,我想听一下新的歌曲,把他们下载下来听,比如某个榜单的,但是一首一首的点击下载另存为真的很恶心 所以我想有没有办法通过程序的方式来实现,结果还真的有,而且网上已经有有人 ...
- Android学习起步 - Button按钮及事件处理
按钮和文本框算是比较简单的控件了,以下主要讲按钮的事件响应,三种写法(匿名内部类响应事件.外部类响应事件.本类直接响应事件) 点击按钮后文本框中会显示 ”按钮被单击了”,先看效果: 以下是这个界面的布 ...
- SQL语句的增删查改
一.增:有2种方法 1.使用insert插入单行数据: 语法:insert [into] <表名> [列名] values <列值> 例:insert into Strdent ...