Build | |
Internal release | |
Public npm release |
This extension includes a group of tasks that leverages SharePoint and O365 functionalities for build and release.
Note: This project is used with GitHub and VSTS projects features. Where GitHub is used for code and issues, but the complete build pipeline is hosted on VSTS in the background.
- GitHub Project start page: https://github.com/Tuleva-AG/vsts-sp-tasks
- Build definitions: https://tulevaag-public.visualstudio.com/vsts-sp-tasks/_build
- Release definitions: https://tulevaag-public.visualstudio.com/vsts-sp-tasks/_releases2
Deploys SharePoint artifacts (e.g. lists, fields, content type...) with the publish PnP PowerShell, which uses the PnP Provisioning Engine. This task works mainly in the same way as described in the documentation of the PnP PowerShell cmdlet Apply-PnPProvisioningTemplate. This PowerShell task allows you to use PnP PowerShell, which will be loaded prior executing any script. The newest releast modules are downloaded from the official PSGallery feed, if not present on the agent.
First the SharePoint version has to be chosen.
Then you need to fill the web URL to deploy the artifacts to the chosen web and the credentials which have the permissions to do the changes.
Next, you choose if you want to use a file from your build or if you want to use inline xml. A specific xml schema is expected which is parsed by the PnP provisioning engine.
You can include the following XML, which changes the title of the connected web
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2017/05/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.18.1709.0, Culture=neutral, PublicKeyToken=3751622786b357c2" />
<pnp:Templates ID="CONTAINER-TEMPLATE-CE97DA40966E445087F3E67032B06CC6">
<pnp:ProvisioningTemplate ID="TEMPLATE-CE97DA40966E445087F3E67032B06CC6" Version="1" BaseSiteTemplate="STS#0" Scope="Web">
<pnp:WebSettings NoCrawl="false" Title="My Web Title" WelcomePage="" AlternateCSS="" MasterPageUrl="{masterpagecatalog}/seattle.master" CustomMasterPageUrl="{masterpagecatalog}/seattle.master" />
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>
Then you can optionally give a comma separated list of Handlers (e.g. Lists,Fields). Leave empty if all Handlers should be used. This Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Check for available Handlers.
The field "Parameters To Be Added" allows you to specify parameters that can be referred to in the template by means of the {parameter:} token. use only one parameter-value pair per line.
Example:
ListTitle=Projects
parameter2=a second value
See examples on how it works internally.
Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template.
Ignore duplicate data row errors when the data row in the template already exists.
Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.)
If set content types will be provisioned if the target web is a subweb.
This task is inspired by the official PowerShell task for VSTS. The source code is located in GitHub. This PowerShell task allows you to use PnP PowerShell, which will be loaded prior executing any script. The newest releast modules are downloaded from the official PSGallery feed, if not present on the agent.
First the SharePoint version has to be choosen.
Next, you choose if you want to use a file from your build or if you want to use inline PowerShell. The correct PnP PowerShell library is downloaded and imported automatically.
When the type is choosen, the file or inline PowerShell must be a valid PowerShell.
An Example is provided in the following code, where
$secpasswd = ConvertTo-SecureString '$(UserPassword)' -AsPlainText -Force
$adminCredentials = New-Object System.Management.Automation.PSCredential ('$(UserAccount)', $secpasswd)
Connect-PnPOnline -Url 'http://mytenanthere.sharepoint.com' -Credentials $adminCredentials
$web = Get-PnPWeb
Write-Host "Connected to the url $($web.Url)"
Prepends the line $ErrorActionPreference='VALUE' at the top of your script. Possible values are 'STOP', 'CONTINUE' or 'SILENTLYCONTINUE'.
If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream. Otherwise the task will rely on the exit code to determine failure.
Working directory where the script is run.