Developing SharePoint Solutions in your development enviroment is a lot of fun! Visual studio will help you a lot when it comes to testing these types of solutions by making the deployment proccess a breeze.
All you have to do is press F5 and, MAGIC HAPPENS! Visual Studio will package your solution, deploy it to the pre-configure site and activate the features for you. When this is all done, it opens a browser for you, so you can test it all. Nice integration stuff, all created for you by Microsoft. So far, so good! But when it comes to integration this into your DTAP (Development, testing, acceptance and production) process, its a whole different ballgame. I welcome you into the world of TFS (Team Foundation Server).
Prereq’s
- A Windows Domain (active directory, with working DNS)
- A working TFS environment
- A working Development environment
Initial server configuration
- Create a new “virtual” machine
ServerName: SP01 - Add server roles
Application Server
.NET Framework 3.5.1
Web Server (IIS) Support
Windows Precess Actiovation Service Support
HTTP Activation
IIS 6 Management Compatibility - Install SQL server 2008 (SP3)
- Add firewall rules for SQL (Port 1433 OPEN)
- Install SharePoint 2010 (With servicepacks / cumulative updates)
- Install Team Foundation Build Service
Add Build Controller
Add Build Agent
SharePoint Specific configuration
- Add accounts to local admin
svc-tfs - Copy TFS SharePoint files / gacutil
- Create new TFS Project
Add new “sharepoint.wouterspaans.nl” project
Delete created project
Add new project – “Branding”
Rename fiolder in TFS to DEV
Convert to branch “DEV” - Create PowerShell script for webapplication
Add GlobalFunctions.ps1
Add 1_CreateFarm.ps1
Add 2_CreateWebApplication.ps1
Add xml config file - Create Build Definition
workspace: $/sharepoint.wouterspaans.nl — $(SourceDir)sharepoint.wouterspaans.nl
msbuild arguments: /p:IsPackaging=True
droplocation: SP01DropFolder (share needs read/write for svc-tfs user)
Fase 1 completed, build of initial WSP file can nowbe tested!
Fase 2: Create Build Template
- Add Sequence “Run BuildPlay Script” after “Try Compile, Test, and Associate Changesets and Work Items”
- Add variabeles DeploymentScriptFilename – String – Sequence Start
- Add arguments buildPlayLocation – In – String
- Add ConvertWorkspaceItem DisplayeName: Convert deployment script filename Input: buildplayLocation Result: DeploymentScriptFilename Workspace: Workspace
- Add InvokeProcess Arguments: String.Format(” “” $BinaryPath='{1}’; $IsBuildServer='{2}’; “” “”& ‘{0}’ “” “, DeploymentScriptFilename, BinariesDirectory, “$True”) Displayname: execute deployment script FileName: “PowerShell”
- Add WriteBuildMessage Importance: Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High Message: stdOutput
- Add WriteBuildError Message: errOutput
Configure SharePoint server side
- Run scripts on server
$IsBuildServer = $true
1_CreateFarm.ps1
2_CreateWebApplication.ps1 - Add svc-tfs acount to content db as db_owner
- Restart server
- Add BuildPlay scripts…
- Copy SharePointDeploymentTemplate.xaml into BuildProcessTemplates (or create a new one)
- Choose SharePointDeploymentTemplate.xaml as template
BuildPlay location: $/SharePoint.wouterspaans.nl/Releases/Build/Build_Play.ps1 - Run build script