Search code examples
tfsazure-devopstfs-2015ms-release-management

TFS Build Task: Custom populated pick list with linked artifact values


I'm currently creating a new release task so I can use Release Management for the orchestration of my releases. Currently we're using an external tool for deploying our application. Luckily this application provides a REST API.

The application that we want to deploy consists of different parts (sub-applications). But in Release Management we want to deploy the different parts in one release definition (for now).

Each subapplication can be mapped to a build which is a linked artifact in the release definition. In the task that I'm currently creating I want to have a pick list which shows the linked artifact that must be deployed. I would be nice to have this information. So I can pass the name of the build that must be deployed to the underlying PowerShell script. With this information I can retrieve the buildnumber that must be deployed through the method that is described on the following site: https://www.visualstudio.com/en-us/docs/release/author-release-definition/understanding-artifacts#artifact-variables. With this information I can create a REST request to start the release.

I've checked the VSTS tasks repo on Github but couldn't find anything similar. I was wondering if someone knows if this is possible? If not what are the alternatives? Or does someone knows an extension where they did something similar?

Thanks in advance.

I'm developing this plugin for TFS2015U3 or TFS15RC1.


Solution

  • No, there isn't any way to get the linked artifacts and then populate the pick list with them in release task directly since before the release starts, the task cannot know which build will be deployed.

    The alternative way would be add a input box and enter the build number manually in the task.

    Update:

    If you want to populate the pickList with linked artifact alias, you can create a custom service endpoint to get the linked artifacts via Rest Call first and then bind the dataSource to the pickList in build task. enter image description here Here is the Rest API URL to get the release definition which includes the linked artifacts information: Get a release definition.