我需要读取jenkins构建控制台输出并grep某个部分并将其发送到松弛状态?从初学者到时髦。任何帮助将不胜感激。
notifyStarted() //Function to grep the console log
def notifyStarted() {
def loggg = manager.build.log
loggg.split('\n') // Split into lines
.dropWhile { !(it ==~ /----*.+/) } // Drop all lines before the text
.drop(1)
.takeWhile { !(it ==~ /----*.+/) }
.each {
manager.listener.logger.println(it)
}
}