参数中的变量似乎没有被库中的值替换

Variables in argument doesn't seems to be replaced with the value from the library

在 azure devops 中,我试图弄清楚如何构建发布管道以将静态网站发布到 firebase 云。我发现 this guide 可以帮我解决这个问题。

我在变量组中的库中添加了 2 个变量,名称为 'firebase_token' 和 'projectId'存储库。我通过下一个参数来做到这一点:

-fireBaseToken $(firebase_token) -fireBaseProject $(projectId) -releaseMessage $(Release.ReleaseName)

当我尝试执行发布管道时,调用 powershell 脚本时出现错误。这是我得到的错误

firebase_token : The term 'firebase_token' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

当我查看已尝试执行的命令时,我看到了:

Formatted command: . 'D:\a\r1\a\test-project\drop\deploy.ps1' -fireBaseToken $(firebase_token) -fireBaseProject $(projectId) -releaseMessage Release-3

据我所知,出于某种原因,$(firebase_token) 和 $(projectId) 没有被它们的值替换。

我猜这些变量应该用那里的值代替,我做错了什么?是什么导致了这些变量没有被替换的问题?

您需要 link 将变量组添加到您的发布定义中。仅仅创建一个变量组是不够的。