是否有可能使用持续集成技术开发sharepoint?

Loo*_*fer 6 sharepoint continuous-integration build-process

我们正在准备一些非常严肃的Sharepoint(MOSS 2007)开发,包括自定义Web部件,列表,母版页和布局等等.

我们正在评估版本控制,似乎讨论没有比这更深入.我很想知道我们可以通过尽可能少的人工接触轻松地从源控制部署到我们的测试和生产服务器,并且最好在每次检查后完全自动部署.

我以前没有使用CI,所以我对Sharepoint的可能性感到有点无知,而且太复杂而无法理解.

我担心如果我们走出一条过于"轻松"的道路,那么当我们发布一些新功能后,我们必须花费半天时间设置每个环境时,我们会很快后悔.

我甚至没有开始在脑海中解决当用户添加的列表中的实际内容以及这将如何影响我们在开发方面所做的事情时会发生什么.

欢迎链接到博客/文档.个人经历非常欢迎.

Nat*_*Nat 5

我最近的经验是使用STSDEV构建解决方案以进行发布的项目.自定义构建操作允许我们从目标服务器中删除sharepoint解决方案,安装新解决方案并重置所需的应用程序池.

花了一段时间来建造,但它运作良好.我们没有发布测试使用这个过程,但它可能是.

以下是目标文件的示例.不幸的是,它有点复杂.

<?xml version="1.0" encoding="utf-8" ?>
<Project DefaultTargets="DebugBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <PackageName>MyFeatures.wsp</PackageName>
    <PackageFile>MyFeatures.wsp</PackageFile>
    <TargetUrl>http://intranet</TargetUrl>
    <ProjectDeploymentFilesFolder>DeploymentFiles</ProjectDeploymentFilesFolder>
    <ProjectRootFilesFolder>$(ProjectDir)\RootFiles</ProjectRootFilesFolder>
    <WssRootFilesFolder>$(ProgramFiles)\Common Files\Microsoft Shared\web server extensions\12</WssRootFilesFolder>
    <ReleaseFolder>$(SolutionDir)Deployment</ReleaseFolder>
    <MAKECAB>"C:\Windows\System32\makecab.exe"</MAKECAB>
    <STSADM>"$(ProgramFiles)\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe"</STSADM>
    <STSDEV>"$(SolutionDir)..\Tools\STSDev\stsdev.exe"</STSDEV>
    <GACUTIL>"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe"</GACUTIL>
    <IISAPP>cscript c:\windows\system32\iisapp.vbs</IISAPP>    
    <WARMUPSITE>"$(SolutionDir)..\Tools\WarmUpServer\AsyncWarmup.bat" "$(SolutionDir)..\Tools\WarmUpServer\"</WARMUPSITE>
    <TIMERJOBSRESTART>net stop SPTimerV3 &amp; net start SPTimerV3</TIMERJOBSRESTART>
  </PropertyGroup>

  <ItemGroup>
    <WSSSourceFiles Include="$(ProjectDir)\RootFiles\**\*.*" />
  </ItemGroup>  

<Target Name="DebugBuild">
  <Message Text="Refreshing Deployment Files..." Importance="high" />
  <Exec Command="$(STSDEV) /refresh $(TargetName) $(ProjectDir)" ContinueOnError="true" />
  <Message Text="Deleting Solution Package File..." Importance="high" />
  <Delete Files="$(ProjectDeploymentFilesFolder)\$(PackageFile)" ContinueOnError="true" />
  <Message Text="Building Solution Package (Debug Version)" Importance="high" />
  <Exec Command="$(MAKECAB) /F $(ProjectDir)\$(ProjectDeploymentFilesFolder)\SolutionPackage.ddf /D CabinetNameTemplate=$(PackageFile)" ContinueOnError="false" />
  <Message Text="" Importance="high" />
  <Message Text="Copying WSP file to CAB" Importance="high" />
  <Delete Files="$(ProjectDeploymentFilesFolder)\$(PackageFile).cab" ContinueOnError="true" />
  <Copy SourceFiles="$(ProjectDeploymentFilesFolder)\$(PackageFile)" DestinationFiles="$(ProjectDeploymentFilesFolder)\$(PackageFile).cab" SkipUnchangedFiles="false" />
  <Message Text="Copying WSP file to release folder: $(ReleaseFolder) from $(ProjectDeploymentFilesFolder)\$(PackageFile)" Importance="high" />
  <Exec Command="attrib -r &quot;$(ReleaseFolder)\$(PackageFile)&quot;" ContinueOnError="true"></Exec>
  <Delete Files="$(ReleaseFolder)\$(PackageFile)" ContinueOnError="true" />
  <Copy SourceFiles="$(ProjectDeploymentFilesFolder)\$(PackageFile)" DestinationFolder="$(ReleaseFolder)" SkipUnchangedFiles="false" />
  <Message Text="" Importance="high" />
</Target>

<Target Name="DebugInstall" DependsOnTargets="DebugBuild">
  <Message Text="Installing Solution..." Importance="high" />
  <Exec Command="$(STSADM) -o addsolution -filename $(ProjectDeploymentFilesFolder)\$(PackageFile)" ContinueOnError="true" />
  <Exec Command="$(STSADM) -o execadmsvcjobs" />
  <Message Text="" Importance="high" />
</Target>

<Target Name="DebugDeploy" DependsOnTargets="DebugInstall">
  <Message Text="Deploying Solution..." Importance="high" />
  <Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -url http://intranet" />
  <Exec Command="$(STSADM) -o execadmsvcjobs" />
  <Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="C:\WINDOWS\assembly\GAC_MSIL\MyFeatures\1.0.0.0__ce271be627d58c77" SkipUnchangedFiles="" />
  <Message Text="$(TargetDir)$(TargetName).pdb copied to GAC for debugging." Importance="high" />
  <Message Text="" Importance="high" />
</Target>

<Target Name="DebugDeployForce" DependsOnTargets="DebugInstall">
  <Message Text="Deploying Solution..." Importance="high" />
  <Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -url http://intranet -force" />
  <Exec Command="$(STSADM) -o execadmsvcjobs" />
  <Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="C:\WINDOWS\assembly\GAC_MSIL\MyFeatures\1.0.0.0__ce271be627d58c77" SkipUnchangedFiles="" />
  <Message Text="$(TargetDir)$(TargetName).pdb copied to GAC for debugging." Importance="high" />
  <Message Text="" Importance="high" />
</Target>

<Target Name="DebugRedeploy" >
  <Message Text="" Importance="high" />
  <Message Text="Starting sequence of Retract/Delete/Build/Install/Deploy" Importance="high" />
  <CallTarget Targets="DebugRetract" />
  <CallTarget Targets="DebugDelete" />
  <CallTarget Targets="DebugBuild" />
  <CallTarget Targets="DebugInstall" />
  <CallTarget Targets="DebugDeployForce" />
  <Message Text="" Importance="high" />
</Target>      

  <Target Name="DebugRetract" >
  <Message Text="Retracting Solution" />
  <Exec Command="$(STSADM) -o retractsolution -name $(PackageName) -immediate -url http://intranet" ContinueOnError="true" />
  <Exec Command="$(STSADM) -o execadmsvcjobs" />
  <Message Text="" Importance="high" />
</Target>

<Target Name="DebugDelete" DependsOnTargets="DebugRetract">
  <Message Text="Deleting Solution Package from Farm Solution Package Store" />
  <Exec Command="$(STSADM) -o deletesolution -name $(PackageName)" ContinueOnError="true" />
  <Exec Command="$(STSADM) -o execadmsvcjobs" />
  <Message Text="" Importance="high" />
</Target>

   </Project>
Run Code Online (Sandbox Code Playgroud)