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

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

本文介绍了是否有可能使用持续集成技术开发sharepoint?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



评估版本控制,似乎讨论没有那么深。我希望我们可以轻松地从源代码管理部署到我们的测试和生产服务器,尽可能少的人际接触,最好在每次签入后自动完成。



我以前没有使用CI,所以我觉得有点无知,什么是可能的Sharepoint,和什么是太复杂,不明智。



我害怕如果我们在我们发布一些新功能之后,我们必须花半天时间设置每个环境。

p>我甚至还没有开始在我的头中发生什么情况,当用户添加的列表中有实际内容,以及这将如何影响我们在开发侧做什么。



欢迎指向博客/文档的链接。个人经验非常欢迎。

解决方案

我最近的经验是在一个项目中使用构建发布解决方案。自定义构建操作允许我们从目标服务器中删除共享点解决方案,安装新的解决方案并重置所需的应用程序池。



需要一段时间才能构建,好。
我们没有发布测试使用这个过程,但它是可能的。



这里是一个目标文件的例子。不幸的是,它有点复杂。

 <?xml version =1.0encoding =utf-8? ; 
< Project DefaultTargets =DebugBuildxmlns =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)部署< / 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 =刷新部署文件...Importance =high/>
< Exec Command =$(STSDEV)/ refresh $(TargetName)$(ProjectDir)ContinueOnError =true/>
< Message Text =正在删除解决方案包文件...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 =将WSP文件复制到CABImportance =high/>
< Delete Files =$(ProjectDeploymentFilesFolder)\ $(PackageFile).cabContinueOnError =true/>
< Copy SourceFiles =$(ProjectDeploymentFilesFolder)\ $(PackageFile)DestinationFiles =$(ProjectDeploymentFilesFolder)\ $(PackageFile).cabSkipUnchangedFiles =false/&
< Message Text =将WSP文件复制到发布文件夹:$(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 =DebugInstallDependsOnTargets =DebugBuild>
< Message Text =正在安装解决方案...Importance =high/>
< Exec Command =$(STSADM)-o addsolution -filename $(ProjectDeploymentFilesFolder)\ $(PackageFile)ContinueOnError =true/>
< Exec Command =$(STSADM)-o execadmsvcjobs/>
< Message Text =Importance =high/>
< / Target>

< Target Name =DebugDeployDependsOnTargets =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).pdbDestinationFolder =C:\WINDOWS\assembly\GAC_MSIL\MyFeatures\1.0.0.0__ce271be627d58c77SkipUnchangedFiles = >
< Message Text =$(TargetDir)$(TargetName).pdb复制到GAC进行调试。重要性=高/>
< Message Text =Importance =high/>
< / Target>

< Target Name =DebugDeployForceDependsOnTargets =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).pdbDestinationFolder =C:\WINDOWS\assembly\GAC_MSIL\MyFeatures\1.0.0.0__ce271be627d58c77SkipUnchangedFiles = >
< Message Text =$(TargetDir)$(TargetName).pdb复制到GAC进行调试。重要性=高/>
< Message Text =Importance =high/>
< / Target>

< Target Name =DebugRedeploy>
< Message Text =Importance =high/>
< Message Text =启动顺序撤回/删除/构建/安装/部署Importance =高/>
< 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:// intranetContinueOnError =true/>
< Exec Command =$(STSADM)-o execadmsvcjobs/>
< Message Text =Importance =high/>
< / Target>

< Target Name =DebugDeleteDependsOnTargets =DebugRetract>
< Message Text =从农场解决方案包存储中删除解决方案包/>
< Exec Command =$(STSADM)-o deletesolution -name $(PackageName)ContinueOnError =true/>
< Exec Command =$(STSADM)-o execadmsvcjobs/>
< Message Text =Importance =high/>
< / Target>

< / Project>


We are gearing up for some pretty serious Sharepoint(MOSS 2007) development including custom web parts, lists, master pages and layouts etc etc and etc.

We are evaluating version control and it seems that the discussion has not got much deeper than that. I am keen that we can easily deploy from the source control to our test and production servers with as little human contact as possible, and preferably entirely automatically after every check in.

I have not worked using CI before and so am feeling a bit ignorant as to what is possible with Sharepoint, and what is too complex to be sensible.

I fear if we head off down a too 'easy' path then we will come to regret it pretty swiftly when we have to spend half a day setting up each environment after we release some new functionality.

I have not even started to address in my head what happens when there is actual content in the lists added by users and how that will affect what we do on the development side.

Links to blogs/documentation are welcomed. Personal experiences VERY welcome.

解决方案

The closest I have experience is on a project that used STSDEV to build solutions for release. Custom build actions allowed us to remove the sharepoint solution from the target server, install the new solutions and reset the required application pools.

Took a while to build, but it worked well.We did not release to test using this process, but it may be possible.

Here is an example of a targets file. Unfortunately, it is a bit complex.

<?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>

这篇关于是否有可能使用持续集成技术开发sharepoint?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 03:46