Coder Social home page Coder Social logo

saurav2107 / vsts-sp-tasks Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 40.02 MB

This extension includes a group of tasks that leverages SharePoint and O365 functionalities for build and release.

Home Page: https://marketplace.visualstudio.com/items?itemName=tuleva.build-release-sharepointtasks

License: GNU General Public License v3.0

PowerShell 100.00%

vsts-sp-tasks's Introduction

SharePoint Build and Release Tasks

Build current build status
Internal release current internal release status
Public npm release current public release status

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.

Content:

Task Deploy SharePoint Artifacts

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.

Mandatory Fields

First the SharePoint version has to be chosen.

SharePoint Choice

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.

Mandatory Fields

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.

Type of Input

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>

Optional Fields

Handler To Be Used

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.

Parameters To Be Added

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

Parameters

See examples on how it works internally.

Advanced Parameters

ClearNavigation

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

Ignore duplicate data row errors when the data row in the template already exists.

Overwrite System Property Bag Values

Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.)

Provision Content Types To Sub Webs

If set content types will be provisioned if the target web is a subweb.

Task PnP PowerShell

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.

Mandatory Fields

First the SharePoint version has to be choosen.

SharePoint Choice

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.

Pnp Power Shell01

When the type is choosen, the file or inline PowerShell must be a valid PowerShell. An Example is provided in the following code, where $(UserPassword) and $(UserAccount) must be previously created variables.

$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)"

Optional Fields

ErrorActionPreference

Prepends the line $ErrorActionPreference='VALUE' at the top of your script. Possible values are 'STOP', 'CONTINUE' or 'SILENTLYCONTINUE'.

Advanced Parameters

Fail on Standard Error

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

Working directory where the script is run.


vsts-sp-tasks's People

Contributors

sebastianschuetze avatar

Watchers

James Cloos avatar Saurav Singh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.