Task Publisher
Overview
The Task Publisher extension adds a task to Azure DevOps which helps you to publish custom tasks using service endpoint.
Features
Using Task Publisher extension you can publish any custom pipeline task directly into your Azure DevOps account without a need to create an extension. This extension also helps to control version of your task and manage custom dependencies.
- Publish new or update existing task
- Replace existing task entirely
- Update task patch version number
- Update task preview version settings
- Automatically update task dependencies
- Use service endpoint for authentication
Prerequisites
This is a PowerShell based extension, which means your build agent must be capable of running PowerShell
tasks as well as have Node.js pre-installed to run TFX-CLI (installed automatically) commands.
How To Use
The extension requires Azure DevOps service endpoint with specific access to target account to be able to work. There are two types of Azure DevOps service endoints supported:
Type |
Name |
Account |
integrated |
SystemVssConnection |
Project Collection Build Service |
specific |
User specified |
User specified |
You may need to create a new Azure Pipelines service connection using PAT token with Agent Pools: read & manage
scope access.
Using Task Publisher extension is simple:
- Add Task Publisher task to your pipeline
- Select service endpoint with Azure DevOps account access
- Specify or select full path to task directory
- Choose task versioning options (optionally)
Update task version
When Update patch version
selected the publisher will automatically update target task patch
version to current release ID from RELEASE_RELEASEID
pipeline variable.
{
"version": {
"Major": 1,
"Minor": 0,
"Patch": 123
}
}
Selecting Upload preview version
will automatically enable preview
flag in the task definition. After this, the published task version will be visible as Preview
in the pipeline.
{
"preview": true
}
Please refer to the task.json schema definition for reference.
Update task dependencies
You can make Task Publisher to automatically update external dependencies of the task before publishing. There are two types of dependencies supported:
Type |
Source |
Target |
Description |
Modules |
/Modules |
{task}/ps_modules |
PowerShell modules or *.ps1 scripts |
Resources |
/Resources |
{task}/resources |
Any artifacts, folders or executables |
You can configure dependencies deployment by adding the following configuration to your task.json
definition and configuring path to artifacts source directory in the settings.
{
"modules": [
"MyModule",
"MyScript.ps1"
],
"resources": [
"MyResource-1.0"
]
}
When configuration in preset, the publisher will automatically locate required artifacts and modules and copy them to the destination task directory before publishing. This makes the modules and resource be available for the task to consume on runtime.
Support
For aditional information and support please refer to project repository.