以下是我的管道YAML的摘录:
strategy:
maxParallel: 4
matrix:
dev_1:
instanceName: DEV1
dev_2:
instanceName: DEV2
dev_3:
instanceName: DEV3
dev_4:
instanceName: DEV4
我想做的是声明一个变量,例如DEV1,DEV2,DEV3,DEV4,然后以某种方式在矩阵摘录中解析这些变量,如下所示:
strategy:
maxParallel: 4
matrix:
dev_1:
instanceName: $(instance[0])
dev_2:
instanceName: $(instance[1])
dev_3:
instanceName: $(instance[2])
dev_4:
instanceName: $(instance[4])
有什么办法可以做到这一点?