敏捷开发,持续集成 CruiseControl.NET 自动发布 我的一点小实践 其中配置文件替换部分挺重要
2011-12-30 11:22
645 查看
首先声明:我是个刚开始学习使用,哪里不合理还请专家们多指导。
我的实践是这样的,我一台电脑是win2003+ii6是可以自动发布到iis的,但是工作时主要用的是xp+ii5的机器,在iis5下总也自动发布不成功,因此我想了一个折中的方法:
现在iis下发布一个应用,在用wdproj把程序生成到之前的那个目录下,采取替换的方式。
在实践中我觉得一点比较常见,但是国内的博客上很少介绍,但是实际工作中应该会肯定遇到的,就是文件的copy,因为开发环境跟测试环境,生产环境绝对是不同,因此需要配置文件的替换,我的配置文件里也有相关说明,希望给同样是cc.net的初学者以帮助。
把我的配置文件copy如下:
接下来我会在.wdproj做改造,完成发布的时候配置文件替换等操作,敬请您关注,谢谢.......
我的实践是这样的,我一台电脑是win2003+ii6是可以自动发布到iis的,但是工作时主要用的是xp+ii5的机器,在iis5下总也自动发布不成功,因此我想了一个折中的方法:
现在iis下发布一个应用,在用wdproj把程序生成到之前的那个目录下,采取替换的方式。
在实践中我觉得一点比较常见,但是国内的博客上很少介绍,但是实际工作中应该会肯定遇到的,就是文件的copy,因为开发环境跟测试环境,生产环境绝对是不同,因此需要配置文件的替换,我的配置文件里也有相关说明,希望给同样是cc.net的初学者以帮助。
把我的配置文件copy如下:
<project name="WebHelloWorld" webURL="http://localhost/ccnet"> <sourcecontrol type="vss"> <executable>D:\Program Files\Microsoft Visual SourceSafe\SS.EXE</executable> <project>$/WebHelloWorld</project> <username>ccnet</username> <password>ccnet</password> <ssdir>\\anderslu\andersvss\</ssdir> <applyLabel>false</applyLabel> <autoGetSource>true</autoGetSource> <alwaysGetLatest>false</alwaysGetLatest> <workingDirectory>E:\testspace\CCnetgroup\WebHelloWorld\code</workingDirectory> <culture>fr-FR</culture> <cleanCopy>true</cleanCopy> <timeout units="minutes">10</timeout> </sourcecontrol> <triggers> <!--60秒触发一次,buildCondition为触发的条件,有ForceBuild及IfModificationExists等条件 <intervalTrigger seconds="60" buildCondition="ForceBuild" />--> </triggers> <tasks> <exec executable="E:\testspace\CCnetgroup\WebHelloWorld\other\CoverSlnFile.bat" /> <msbuild> <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable> <workingDirectory>E:\testspace\CCnetgroup\WebHelloWorld\code</workingDirectory> <projectFile>WebHelloWorld.sln</projectFile> <buildArgs>/p:Configuration=Debug /v:diag</buildArgs> <timeout>900</timeout> <logger>d:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger> <targets>Clean;Rebuild</targets> </msbuild> <msbuild> <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable> <workingDirectory>E:\testspace\CCnetgroup\WebHelloWorld\WebHelloWorld_deploy</workingDirectory> <projectFile>WebHelloWorld_deploy.wdproj</projectFile> <buildArgs>/p:Configuration=Debug /v:diag</buildArgs> <timeout>900</timeout> <logger>d:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger> <targets>Clean;Rebuild</targets> </msbuild> </tasks> <publishers> <xmllogger logDir="E:\testspace\CCnetgroup\WebHelloWorld\log" /> <buildpublisher> <sourceDir>E:\testspace\CCnetgroup\WebHelloWorld\code</sourceDir> <publishDir>E:\testspace\CCnetgroup\WebHelloWorld\publishDir</publishDir> <useLabelSubDirectory>false</useLabelSubDirectory> <alwaysPublish>false</alwaysPublish> </buildpublisher> <email mailport="25" includeDetails="TRUE" mailhostUsername="******@qq.com" mailhostPassword="******" useSSL="FALSE"> <from>******@qq.com</from> <mailhost>smtp.qq.com</mailhost> <users> <user name="****" group="teamleader" address="****@qq.com" /> <!-- <user name="******" group="cto" address="****@****.com.cn" /> <user name="****" group="buildmaster" address="****@139.com" /> <user name="****" group="developers" address="*****@qq.com" /> <user name="*****" group="developers" address="********@qq.com" /> --> </users> <groups> <group name="cto"> <notifications> <notificationType>Success</notificationType> <notificationType>Fixed</notificationType> </notifications> </group> <group name="teamleader"> <notifications> <notificationType>Always</notificationType> </notifications> </group> <group name="developers"> <notifications> <notificationType>Failed</notificationType> <notificationType>Fixed</notificationType> </notifications> </group> <group name="buildmaster"> <notifications> <notificationType>Always</notificationType> </notifications> </group> </groups> <converters> <regexConverter find="{1}quot; replace="@qq.com" /> </converters> <modifierNotificationTypes> <NotificationType>Exception</NotificationType> <NotificationType>Failed</NotificationType> <NotificationType>Fixed</NotificationType> <NotificationType>Success</NotificationType> </modifierNotificationTypes> <subjectSettings> <subject buildResult="StillBroken" value="Build is still broken for {WebHelloWorld}" /> </subjectSettings> <xslFiles> <!--邮件里都包还那些内容--> <file>xsl\header.xsl</file> <file>xsl\compile.xsl</file> <file>xsl\unittests.xsl</file> <file>xsl\modifications.xsl</file> </xslFiles> <attachments> <file>E:\testspace\CCnetgroup\WebHelloWorld\other\AFile.txt</file> <file>Relative.txt</file> </attachments> </email> </publishers> </project>
<exec executable="E:\testspace\CCnetgroup\WebHelloWorld\other\CoverSlnFile.bat" />文件里执行的是:"Robocopy E:\testspace\CCnetgroup\WebHelloWorld\other\ E:\testspace\CCnetgroup\WebHelloWorld\code\ *.sln" 有关Robocopy的介绍请不了解的百度下。因为我不想再程序员那里的解决方案里出现autodeploy项目,因此在服务器端先写好了一个*.sln文件,去替换自动从vss获取的*.sln文件。还有一个问题是我发现build *.sln的时候并不会去执行.wdproj,因此单独写了一个<msbuild>去编译.wdproj,完成发布任务。
接下来我会在.wdproj做改造,完成发布的时候配置文件替换等操作,敬请您关注,谢谢.......
相关文章推荐
- 敏捷开发实践(3)-我们为什么需要持续集成? .
- 敏捷开发,持续集成的实践,开篇.....转文(请支持原文作者)
- Java开发流程自动化(svn+maven+nexus+jenkins) --自动编译,持续集成,测试,打包,发布/部署
- 续接上篇 cc.net 自动发布web应用程序 配置文件的替换
- Java开发流程自动化(svn+maven+nexus+jenkins) --自动编译,持续集成,测试,打包,发布/部署
- iOS开发集成——配置xcodeServer持续集成,自动打包上传蒲公英坑,掉一次两次三次就埋了它。。
- 敏捷开发实践(3)-我们为什么需要持续集成?
- 持续集成/发布-自动部署
- Gradle实战系列(二)__自动替换的配置文件
- 开发人员学Linux(11):CentOS7安装配置持续集成工具Jenkins
- CI/CD持续集成/持续部署 敏捷开发
- android配置集成CI持续化开发工具Jenkins
- IIS发布网站部分特殊配置--图片上传至别的服务器、iis配置 通配符应用程序映、iis配置 C#底层拦截.htm文件请求
- IOS开发创建开发证书及发布App应用(四)——创建配置概要文件
- java开发中所有的配置文件,持续更新
- maven 生产环境、开发环境替换配置文件打包
- 敏捷软件开发:原则、模式与实践——第10章 LSP:Liskov替换原则
- 实现Winform应用系统自动升级 ---------关于服务器端配置文件以实现的一点总结
- OFBiz 开发需要用到的几个重要(配置)文件
- 敏捷开发中的持续构建实践