SPBlaze - Configuration
In this article | In this page |
---|---|
Configuration Files
The PowerShell scripts read an xml configuration file to identify all steps, actions and settings to be used for the deployment. Commonly you will need to have 1 configuration file per environment.
Typical config files are:
- Dev.Config.Xml
- Test.Config.Xml
- UAT.Config.Xml
- Prod.Config.Xml
Configuration Location
The configuration files reside on the file system, in a sub folder called Config. The scripts will try to locate config files in this folder.
Folder structure required | |
---|---|
The XML configuration files must exist in the Config Folder |
Configuration Overview
The XML files contain the following element hierarchy:
Config
PreDeploymentScripts
PostDeploymentScripts
Quotas
Solutions
Features
WebApplications
WebApplication
Solutions
Scripts
Features
SiteCollections
SiteCollection
Scripts
Features
Sample Configuration File
In the Config folder a sample configuration file called Sample.MyProject.Config.Xml has been created to assist new projects.
This is a good basis for a new environment configuration file. Simply copy and rename it. Then edit it to suit your needs.
Here is the Sample Xml Configuration file which has annotations next to the relevant entries for additional information.
<?xml version="1.0" ?> <Config> <BaseServerName>localhost</BaseServerName><!-- If you use localhost this value will be replaced with $env:COMPUTERNAME --> <FarmAcct>Domain\SPFarmAccount</FarmAcct> <Language>1033</Language><!-- The language code in use, see http://msdn.microsoft.com/en-us/goglobal/bb964664 --> <PreDeploymentScripts><!-- These scripts run first during the deployment phase --> <Script Name="InitialiseSharePointServices.ps1" Disabled="False" Confirm="False" /><!-- This script ensures the sharepoint windows services are running --> </PreDeploymentScripts> <PostDeploymentScripts><!-- These scripts run last --> <!-- Script must exist in the scripts folder --> <Script Name="CreateSharePointGroup.ps1" Disabled="False" Confirm="False" > <DirectParameters> <Parameter Name="SiteUrl">http://your.site.collection</Parameter> <Parameter Name="GroupName">YourGroupName</Parameter> <Parameter Name="GroupDescription">"Enter group description here"</Parameter> </DirectParameters> </Script> </PostDeploymentScripts> <PostDeploymentActions> <FeaturesToReactivate> <Feature Name="FullFeatureNameHere" scope="webapplication" url="http://your.site.collection" Job="False" /><!-- Activate a feature at Web Application level --> <Feature Name="FullFeatureNameHere" scope="site" url="http://your.site.collection" Job="False" /><!-- Activate a feature at Site Collection level --> <Feature Name="FullFeatureNameHere" scope="web" url="http://your.site.collection" Job="False" /><!-- Activate a feature at Web level --> </FeaturesToReactivate> </PostDeploymentActions> <DefaultParameters> <PortalAppPoolAcct>Domain\SPAppPoolAccount</PortalAppPoolAcct><!-- ***This must be setup first in SharePoint. Create it as a Managed Service Account in Central Admin.*** Used if no account specified for in a WebApplication section --> </DefaultParameters> <Quotas> <Quota Name="2GB"> <StorageMaximumLevel>2097152000</StorageMaximumLevel> <StorageWarningLevel>1887436800</StorageWarningLevel> <ResourcePoints>1000</ResourcePoints> </Quota> </Quotas> <Solutions> <Solution Name="SolutionInSolutionsFolder.wsp" GACDeployment="True" Global="True" /><!-- Add solutions here. They must exist in the Solutions subfolder --> <Solution Name="YourWebAppLevelWSPHere.wsp" GACDeployment="True" Global="False" /><!-- This solution has web app scoped features so Global is set to false and it is added to the appropriate web application below.--> </Solutions> <Features><!-- Farm Features to Activate. This section under development and requires testing --> <Feature Name="FullFeatureNameHere" /> </Features> <WebApplications> <!-- Add WebApplications here. If they don't exist they will be created --> <WebApplication> <Solutions> <Solution Name="YourWebAppLevelWSPHere.wsp" GACDeployment="True" /> <!--Add WebApplication WSP's here. Note that they should exist in the main solutions area above and have Global set to false--> </Solutions> <Scripts> <Script Name="YourScriptHere.ps1" Disabled="False" Confirm="False" /><!-- This script will be run after the WebApplication has been created. --> </Scripts> <Features> <Feature Name="FullFeatureNameHere" /><!-- Web application feature activated here --> </Features> <PortalName>Web Application Name</PortalName> <PortalProtocol>http</PortalProtocol><!-- Either http or https --> <PortalPort>80</PortalPort><!-- set your port number here. Use 443 if the protocol is https --> <PortalUseClaims>true</PortalUseClaims> <!-- Specify claims authentication provider --> <PortalLCID>1033</PortalLCID> <!-- Language Code for Web Application --> <PortalHostHeader></PortalHostHeader><!-- leave this blank to default to the computer name. Otherwise use http://yourweburl --> <PortalDB></PortalDB><!-- Leave this blank to allow random db name --> <PortalAppPool>AppPoolName</PortalAppPool><!-- The name for the app pool. Will be created if it doesn't exist. --> <PortalAppPoolAcct></PortalAppPoolAcct> <!-- leave this blank to use the default app pool account above or specify domain\account --> <PortalTimeZone>Brisbane</PortalTimeZone> <AllowAnonymous>true</AllowAnonymous> <SiteCollections> <SiteCollection> <Scripts> <Script Name="YourScriptHere.ps1" Disabled="False" Confirm="False" Job="true" /> <!-- This is an example of a script that will run once the site collection is created. It will also run in a new powershell session because Job is set to true --> </Scripts> <Features> <Feature Name="ContentTypeHub" /> <!-- This will activate the built in content type hub feature at the site collection level after the site collection is created --> </Features> <PortalName>The name of the site collection</PortalName> <PortalDescription>The description of the site collection</PortalDescription> <PortalTemplate>BLANKINTERNET#2</PortalTemplate><!-- Specify which site definition to use --> <PortalQuota>2GB</PortalQuota> <!-- Specify which quota this site collection should use, leave blank for no quota. --> <PortalCulture>en-AU</PortalCulture> </SiteCollection> </SiteCollections> </WebApplication> </WebApplications> </Config>
CodeMonkey Software is a division of JCHMedia www.jchmedia.com