Azure DevOps: Setting up a build to deploy a site package - akumina/AkuminaDev GitHub Wiki

Applies to

All versions of Akumina

Overview

This article describes how to create a build pipeline to deploy an Akumina Site Deployer package. For more information on a Site Deployer package, please see the References section below.

To create a build

Go into Azure DevOps for the project you want. In our example we will use the code located in the TFS path:

$/BPS/Example/

Go to Pipelines -> Builds. Click New pipeline.

For our example we have code in TFS, so we use the visual designer option.

Select TFVC as the source, and then enter in the TFS path:

In the Build definition, click the plus icon (+) to add under Agent job 1. Then select Command Line from the list.

In the command line option, please enter in the properties for the site deployer. Assuming you placed the site deployer at the root of the build (as instructed to earlier), then the following values will be used:

Property Value
Display name Run Akumina.SiteDeployer
Tool $(Build.SourcesDirectory)\tools\Akumina.SiteDeployer.exe
Arguments options lists envdir "" assetdirectory DigitalWorkplaceCore spcontextretrycount 3 spdirectory DigitalWorkplace spurl $(siteCollectionUrl) spuser $(siteCollectionUser) sppassword $(siteCollectionPassword)
Reference name CmdLine1

The options value above indicates what we want to deploy. In our example, we only have lists.

The spcontextretrycount 3 value is optional and would be used if there are issues with deploying to the tenant.

The assetdirectory value above depends on the name of your folder in the /sitedefinitions/ folder. See the Site deployer documentation for more information.

In order to run, the deployer needs variables such as the site collection URl, username and password. We need to add the following:

Property Description
siteCollectionUrl The site collection URL to deploy to.
siteCollectionUser The user to be used to connect to the site collection.
siteCollectionPassword Locked value - The password of the user to be used to connect to the site collection.

Note the siteCollectionPassword value should be LOCKED:

With the actions and the variables saved, we then need to Save. Click Save on the “Save build pipeline” dialog.

Once we save, we can then run the build – go back to builds, and either Run or Queue the build.

We can then separately queue up the build to run later, by returning to Pipelines -> Builds, and clicking the build. We can then queue it via the Queue button.

After the build runs, we will see its status.

And we can see the artifacts deployed into the site collection.

Deploying widgets

To deploy widget, add a few other tasks prior to the site deployer call to build and package the widgets:

Task Display Name Properties
Node.js tool installer Use Node >=8.9.1 Version Spec: >=8.9.1
Npm npm install Command: install
Npm npm build Command: custom
Command and arguments:run build
npm npm package Command: custom
Command and arguments:run package

And then you would use either a command line for the site deployer call (shown above), or a "Publish build artifacts" to a drop, which can then be used in a release pipeline.

References: