Jenkins+PowerShell持续集成环境搭建(三)Web项目
1. 新建一个名字为HelloWorld.Web的Freesyle项目;
2. 配置源码管理;
3. 编译配置:
版本:选择MSBuild4
文件:D:\CI\Config\HelloWorld.Web.msbuild
其中,“HelloWorld.Web.msbuild”文件的内容为:
1 <?xml version="1.0" encoding="utf-8"?> 2 <Project 3 xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 4 ToolsVersion="12.0" 5 DefaultTargets="Build"> 6 <PropertyGroup> 7 <ProjectDir>D:\CI\HelloWorld.Web\</ProjectDir> 8 <SolutionDir>$(ProjectDir)HelloWorld.Web.sln</SolutionDir> 9 <PublishProfile>D:\CI\Config\HelloWorld.Web.pubxml</PublishProfile> 10 <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> 11 <BuildPlatform Condition=" '$(BuildPlatform)' == '' ">Any CPU</BuildPlatform> 12 </PropertyGroup> 13 <ItemGroup> 14 <BuildTask Include="$(SolutionDir)"> 15 <Properties>OutputPath=$(ProjectDir)HelloWorld.Web\bin;;Configuration=$(Configuration);Platform=$(BuildPlatform);VisualStudioVersion=12.0;PublishProfile=$(PublishProfile);DeployOnBuild=true;Disable_CopyWebApplication=True</Properties> 16 </BuildTask> 17 </ItemGroup> 18 <Target Name="Build"> 19 <MSBuild Projects="@(BuildTask)"/> 20 </Target> 21 </Project>
“HelloWorld.Web.msbuild”引用的“HelloWorld.Web.pubxml”文件内容为:
<?xml version="1.0" encoding="utf-8"?> <!-- This file is used by the publish/package process of your Web project. You can customize the behavior of this process by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. --> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem</WebPublishMethod> <SiteUrlToLaunchAfterPublish /> <publishUrl>D:\CI\Output\HelloWorld.Web</publishUrl> <DeleteExistingFiles>True</DeleteExistingFiles> </PropertyGroup> </Project>