【发布时间】:2021-10-11 17:25:31
【问题描述】:
我使用 Jenkins 矩阵并行运行一堆测试。有一个文件是测试的结果。完成所有测试后,我想将所有生成的文件放在一个构建代理上的一个工作区中并进行一些分析。
pipeline {
agent none
stages {
stage('TestEm') {
matrix {
agent any
axes {
axis {
name 'i'
values '1','2','3','4'
}
}
stages {
stage('Test') {
steps {
echo "Do Test for $i"
sh """
sleep 10
echo Test for $i > ${i}.txt
"""
}
}
}
}
}
stage("Aggregate results") {
agent any
steps {
// do the magic and get 1.txt .. 4.txt here, in this workspace
}
}
}
}
但我不知道如何施展魔法并在最后一步收集矩阵的所有结果。
【问题讨论】: