如何在VSTS中将秘密变量添加为任务环境变量 [英] How to add secret variable as task environment variable in VSTS
问题描述
本文档指出该秘密变量是
未解密为环境变量.因此,默认情况下,您的构建步骤所运行的脚本和程序不会获得访问权限.
Not decrypted into environment variables. So scripts and programs run by your build steps are not given access by default.
我的一个构建任务要求设置一个环境变量,该环境变量存储在一个秘密变量中.这是否意味着在VSTS中使用秘密变量无法做到这一点?如果没有,我该怎么办?
One of my build tasks require that an environment variable be set that is stored in a secret variable. Does this mean it's impossible to do this using secret varaibles in VSTS? If not, how do I do this?
为进一步了解背景,我正尝试使用electronic-builder对我的电子应用程序进行代码签名. 它需要设置两个环境变量:CSC_LINK
和CSC_KEY_PASSWORD
.其中之一是代码签名证书的密码,因此需要确保安全.
For further background, I'm trying to code sign my electron app using electron-builder. It requires that two environment variables be set: CSC_LINK
and CSC_KEY_PASSWORD
. One of these is the password to a code signing certificate so needs to be kept secure.
推荐答案
您可以在构建定义的变量"页面中提供要传递给任务的变量:
You can supply variables to pass to tasks in the Variables page of the build definition:
然后可以将它们作为输入传递给任务,如下所示:
Then they can be passed in to a task as an input like so:
这篇关于如何在VSTS中将秘密变量添加为任务环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!