标签: azure-devops continuous-integration continuous-deployment
如何直接在CD管道中使用在CI管道中设置的变量?
示例: 如果在一组中声明了乘法变量。如何访问CI / CD管道中的特定变量?
还如何将变量组用于多个键库?
谢谢
答案 0 :(得分:1)
设置全局变量
YAML
https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml
经典
https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=classic
使用变量
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch
示例:
Batch script: %VARIABLE_NAME% PowerShell script: $env:VARIABLE_NAME Bash script: $VARIABLE_NAME
密钥库
https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=classic#link-secrets-from-an-azure-key-vault