windows - azure devops 变量从任务到模板
问题描述
我需要将变量传递到模板中。例如,Small
(见下文)的输出应作为输入传递给介质。这怎么可能?
template: windows-tests.yml
parameters:
integration_tests: ["Small", "Medium"]
check_status: "$(Powershell1.var)"
除了上述之外,我想 从构建步骤中添加 o/p 将存储在 checkstatus 变量中,并将传递给模板。
Powershell1.var
将被小测试使用,然后生成一个需要被中等使用的值。
解决方案
我需要将变量传递到模板中。
您可以参考此文档了解如何在模板中传递变量的说明。
(见下文)的输出
Small
应作为输入传递给Medium
.
这是脚本:
模板:
parameters:
- name: Medium
type: {data type of `Medium`}
default: {defualt value of `Medium`}
管道:
extends:
template: {template file}
parameters:
Medium: $(Small)
我想从构建步骤中添加 o/p 将存储在 checkstatus 变量中,并将传递给模板。
这是脚本:
模板:
parameters:
- name: check_status
type: string
default: "$(Powershell1.var)"
管道:
extends:
template: {template file}
parameters:
check_status: "$(Powershell1.var)"
推荐阅读
- java - 无法通过 spring-boot-starter-test 测试 Spring Boot REST API,而相同的“api”正在为 Postman 工作
- angular - 如何在 Angular 应用程序中使用 ngrx 存储
- qt - 尝试编译基于 QT 的跨平台应用程序,但总是出现此错误:usr/bin/ld: cannot find -lGL
- flutter - Flutter Navigation:导航到新屏幕时使用的最佳技术是什么?
- r - 如何在 R 中的 For 循环中跳过错误。并提取导致错误的 i 列表单独处理它们
- python - Django 根据迁移修复现有数据库
- amazon-web-services - AWS Lambda 和版本上传?
- windows - 为什么命令提示符显示以下错误?
- c++ - 使用 Clang LibTooling 扫描在模板化父类中调用本地类的 C++ 源
- mysql - 我有一个计算并返回客户余额的函数,但它向我返回以下错误