如何在VSTS中将秘密变量添加为任务环境变量

编程入门 行业动态 更新时间:2024-10-28 06:26:41
本文介绍了如何在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中将秘密变量添加为任务环境变量

本文发布于:2023-11-15 17:43:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1596606.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中将   变量   环境变量   秘密   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!