jenkins -pipeline 執行 jmeter 指令碼 publish report 失敗

少年鹿發表於2020-12-09

具體情況如下:
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 去掉就可以了 ,請教下是什麼原因

相關文章