如我所见,您使用了声明式管道语法。在这种情况下,您需要定义agent部分。来自官方文档:
agent none在 Pipeline 的顶层定义可确保不会不必要地分配 Executor。使用agent none还强制每个stage部分包含自己的agent部分。
所以,我认为您在agent none管道的顶层使用,这就是为什么您需要agent在舞台内添加部分。像这样的东西:
pipeline {
agent none
stages {
stage('reports') {
agent { docker 'openjdk:8-jre' }
steps {
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'target/allure-results']]
])
}
}
}
}
}
对于脚本化管道,您需要使用此语法(有关更多详细信息,请参阅 allure文档):
node {
// script body
allure([
includeProperties: false,
jdk: '',
properties: [[key: 'allure.issues.tracker.pattern', value: 'http://tracker.company.com/%s']],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'target/allure-results'], [path: 'other_target/allure-results']]
])
}
偶然的你
长风秋雁
相关分类