具体情况如下:
pipeline:
stage('publish report'){
steps{
script{
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: './html1/', reportFiles: 'TestReport$Dateparameter.html', reportName: 'HTML Report', reportTitles: '汇总测试报告'])
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: './html/', reportFiles: 'TestReport$Dateparameter.html', reportName: 'DetailL Report', reportTitles: '详细测试报告'])
}
}
}
stage('result'){
steps{
echo "查看测试结果"
sh '''
cd /home/jkusr/report/html1
grep -o '

[0-9] [0-9][0-9]*' TestReport$Dateparameter.html | grep -c 100
if [ $?=0 ]
then
exit 0
else
exit 1
fi

'''
}
}

脚本执行失败就没有 发布 html report ,但是把 stage result 去掉就可以了 ,请教下是什么原因


↙↙↙阅读原文可查看相关链接,并与作者交流