Specifying Pipeline resource version using variable

最后都变了- 提交于 2021-01-28 06:13:16

问题


When using Pipeline resource an error occurs when I am trying to use the value of the Version field as a variable value.

resources:
  pipelines:
  - pipeline: BuildApp
    source: BuildApp
    # version: $(appversion) <- this doesn't work
    version: 20191204.17  <- this works

Static version looks not so useful. Is it possible to specify such version for each run dynamically? For example, using variables.


回答1:


I tested and reproduced the problem you met and use parameters, template variable, template parameter or template will make no change, it keeps throwing error messages.

I think you can only use predefined variables here according to this thread: Is it possible to use a variable in the ref property of resources:repository for Azure DevOps YAML?.

You could add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions. Thank you for helping us build a better Azure DevOps.




回答2:


The suggestion is resolved:

https://developercommunity.visualstudio.com/content/idea/845445/pipeline-resource-version-property-as-a-variable-1.html

Microsoft's answer: While we can’t allow variables in that field, this is an excellent use case for runtime parameters.



来源:https://stackoverflow.com/questions/59184728/specifying-pipeline-resource-version-using-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!