在将我现有的所有Jenkins
工作转换为Pipeline工作时,我遇到了在后期构建操作中执行Scan for compiler warnings
的步骤,如下面的屏幕截图所示。
我为此尝试了很多语法,但它没有锻炼。 有没有人知道管道中的这个语法?
经过多次尝试后,我找到了可行的脚本。
post {
always {
step([$class: 'WarningsPublisher',
consoleParsers: [[parserName:'GNU C Compiler 4 (gcc)']],
defaultEncoding: '',
excludePattern: '',
healthy: '',
includePattern: '',
messagesPattern: '',
unHealthy: '',
useStableBuildAsReference: true
])
}
}
上面的脚本经过测试,效果很好。