人工智能公司网站建设,怎么优化网站源码关键词,wordpress迁移空间后无法显示图片,设计头条官网刚换了工作#xff0c;有需要搭建一套持续集成的平台#xff0c;做一下总结。 首先是我用到的工具#xff1a; 上面缺少了Microsoft Fxcop#xff0c;可以用来做代码校验#xff0c;不过实际情况暂时还没有用到。主要的需求目前是#xff0c;使用已发布的稳定版本代码作为… 刚换了工作有需要搭建一套持续集成的平台做一下总结。 首先是我用到的工具 上面缺少了Microsoft Fxcop可以用来做代码校验不过实际情况暂时还没有用到。主要的需求目前是使用已发布的稳定版本代码作为新发布版本代码的基础避免有未完成的代码存在于发布版本中同时自动化集成发布后上传该新发布版本代码到tags中。elevate一般情况下是不需要的不过VisualSVN无法使用命令行登陆可以使用它来提升执行权限不过最终我使用了另外一个办法这个方法需要购买VisualSVN Server的License后面会说。 安装过程就不赘述了相信有兴趣看这个的都是做软件的下一步之类还有一些选项什么的没什么可说的。安装的时候部署的监控网站可能不成功只要自己手动在IIS上布下就好。另外先提一句CCTray是可以把配置好的集成方案服务添加运行的工具添加好后本身也具有监控的功能区别是它客户端工具。 先说SVN服务器VisualSVN Server是比较简单的SVN服务端所以功能比较简单比如就缺少命令行登陆的功能不过另一方面就是安装很简单。有两点需要说明一下一是新建Repository时勾选分为branches tags trunk三个目录分别用来放分支代码发布版代码主干版本代码其中tags下的代码是只能新增不能修改的另外一点是权限问题我使用的是windows的账户做操作的在这种情况下有个选项要勾选上不然执行svn提交代码命令时会报错身份验证不通过。 上图红框就是需要勾选的不过勾选这个是需要License的。 接下来就是主题部分了安装完CC以后到开始菜单里找到对应的菜单会发现里面有个配置文件对应的就是安装好的目录下的ccnet.config文件另外还有个验证工具可以用来辅助配置一目了然的东西就不细说了下面说说配置。 cruisecontrol xmlns:cburn:ccnet.config.builder!-- This is your CruiseControl.NET Server Configuration file. Add your projects below! --
这里配置服务的名字一个project对应的就是一个集成方案可以独立执行project nameProjectTestdescriptiondemoproject showing a small config queueQ1
工作使用的目录workingDirectoryD:\Store/workingDirectory
这里是正在集成工程中的临时配置文件保存的地方一次执行结束后该配置文件会被放到配置的日志文件夹中 artifactDirectoryD:\Store\Artifacts/artifactDirectory!-- specify a state folder to prevent CCNet from saving it in Program Files\CruiseControl.NET\server programs may not standard write their data in it on windows Vista and up)--state typestate directoryD:\Store\State /!-- specify a artifactDirectory to prevent CCNet from saving it in Program Files\CruiseControl.NET\server programs may not standard write their data in it on windows Vista and up)--
这是监控页面webURLhttp://localhost:90/ViewLatestBuildReport.aspx/webURLmodificationDelaySeconds10/modificationDelaySecondstriggers!-- check the source control every X time for changes, and run the tasks if changes are found --!--intervalTriggernamecontinuousseconds30buildConditionIfModificationExistsinitialSeconds5/--intervalTrigger namecontinuous seconds6000 //triggers
这里是配置获取源码的位置使用svnsourcecontrol typesvnexecutableC:\Program Files\VisualSVN Server\bin\svn.exe/executabletrunkUrlhttps://aaa/svn/Test/trunk/trunkUrlusernamesvn/username--登陆svn使用的用户名密码这个是我在测试服务器上创建的测试账户passwordsvn/passwordworkingDirectoryD:\Store\Code/workingDirectory--获取下来源码的存放位置autoGetSourcetrue/autoGetSource/sourcecontroltasks!-- if you want the task to fail, ping an unknown server --这个ping的作用在这里仅仅是测试的时候改成错的可以让它后面的配置都不执行execexecutableping.exe/executablebuildArgslocalhost/buildArgsbuildTimeoutSeconds15/buildTimeoutSecondsdescriptionPinging a server/description/exec这里是编译解决方案的配置也可以每个项目分别编译projectFile配置成项目的csproj文件就可以 msbuildexecutableC:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe/executableworkingDirectoryD:\Store\Code/workingDirectoryprojectFileD:\Store\Code\*******.sln/projectFilebuildArgs/noconsolelogger /p:ConfigurationRelease;OutDirD:\Store\Run\ /v:diag/buildArgsloggerC:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll/loggertargetsBuild/targetstimeout900/timeout/msbuild这是用来配置发布位置的sourceDir是生成的位置publishDir是发布的位置可以配置成远程的共享目录buildpublishersourceDirD:\Store\Run/sourceDirpublishDirD:\Store\Release/publishDiruseLabelSubDirectoryfalse/useLabelSubDirectory/buildpublisher!--删除.svn文件--
这个批处理文件时用来清除代码中svn绑定的因为这份代码需要提交到Tags上这个批处理代码类似的网上到处都是我就不贴了exec executableD:\Store\delSVN.bat /
这段注释掉的是单元测试的配置不过由于原来的代码都没做单元测试所以就先注释掉了!--删除单元测试结果文件否则不会创建新的结果文件exec executableD:\Store\delTestResult.bat /--!--buildArgs参数/testcontainer单元测试项目程序集(可以包含多个) /resultsfile测试结果文件execexecutableC:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe/executablebaseDirectoryD:\Store\UNTest/baseDirectorybuildArgs/testcontainer:TestProject\bin\Debug\TestProject.dll /resultsfile:TestResults\mstest-results.xml/buildArgsbuildTimeoutSeconds300/buildTimeoutSeconds/exec--提交代码的批处理: cd /d %~dp0C:\Program Files\VisualSVN Server\bin\svn.exe import -m New Tags D:\Store\Code https://aaa/svn/Test/tags/Tags_%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2% !--提交Tags代码--exec executableD:\Store\svnCTags.bat //taskspublishers
这个是完成后全部的日志xmllogger logDirD:\Store\Log/
日志可以配置成发送邮件不过这里不需要/publishers/project第二个集成服务project nameProjectTestWithOutGetSourcedescriptiondemoproject showing a small config queueQ1workingDirectoryD:\Store/workingDirectoryartifactDirectoryD:\Store\Artifacts/artifactDirectorystate typestate directoryD:\Store\State /webURLhttp://localhost:90/ViewLatestBuildReport.aspx/webURLmodificationDelaySeconds10/modificationDelaySecondstriggersintervalTrigger namecontinuous seconds6000 //triggerssourcecontrol typesvnexecutableC:\Program Files\VisualSVN Server\bin\svn.exe/executabletrunkUrlhttps://aaa/svn/Test/trunk/trunkUrlusernamesvn/usernamepasswordsvn/passwordworkingDirectoryD:\Store\Code/workingDirectoryautoGetSourcetrue/autoGetSource/sourcecontroltasks!-- if you want the task to fail, ping an unknown server --execexecutableping.exe/executablebuildArgslocalhost/buildArgsbuildTimeoutSeconds15/buildTimeoutSecondsdescriptionPinging a server/description/execmsbuildexecutableC:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe/executableworkingDirectoryD:\Store\Code/workingDirectoryprojectFileD:\Store\Code\*******.sln/projectFilebuildArgs/noconsolelogger /p:ConfigurationRelease;OutDirD:\Store\Run\ /v:diag/buildArgsloggerC:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll/loggertargetsBuild/targetstimeout900/timeout/msbuildbuildpublishersourceDirD:\Store\Run/sourceDirpublishDirD:\Store\Release/publishDiruseLabelSubDirectoryfalse/useLabelSubDirectory/buildpublisher!--删除.svn文件--exec executableD:\Store\delSVN.bat /!--提交Tags代码--exec executableD:\Store\svnCTags.bat //taskspublishersxmllogger logDirD:\Store\Log//publishers/project/cruisecontrol 最后是我集成使用的测试目录可以不用自己创建集成过程中会自己创建的 转载于:https://www.cnblogs.com/saaav/p/4003254.html