How to get the variable value in TFS/AzureDevOps from Build to Release Pipeline?

前端 未结 1 2005
栀梦
栀梦 2020-12-04 01:28

I\'ve defined a variable in my TFS/AzureDevops Build definition (say it\'s time) and assign the value using PowerShell task within my build definition.

相关标签:
1条回答
  • 2020-12-04 02:09

    The is no official way to pass variables from Build to Release. The only way to accomplish this is to store the values in a file (json, xml, yaml, what have you) and attach that as a Build Artifact. That way you can read the file in the release and set the variable again.

    Martin Hinshelwood seems to have gotten frustrated enough by this problem and turned that functionality into an extension for Azure DevOps Pipelines.

    Tasks included

    • Variable Save Task - During your build you can save the variables to a json file stored with your other build assets
    • Variable Load Task - During your Release you can load the saved variables and gain access to them.
    0 讨论(0)
提交回复
热议问题